File size: 2,567 Bytes
787d7bf | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | // OpenCode configuration for the Dragon finance agent.
//
// Copy to your project root as `opencode.jsonc` (or to
// ~/.config/opencode/opencode.jsonc for every project).
//
// Two things are wired here:
// 1. the local model (llama.cpp serving the 7B, OpenAI-compatible)
// 2. the dragon MCP server, which supplies search_knowledge + query_financials
{
"$schema": "https://opencode.ai/config.json",
// ---- 1. the local model ------------------------------------------------
// Adjust the port if you changed it in serve-model.sh.
"model": "dragon/dragon-finance-7b",
"providers": {
"dragon": {
"name": "Dragon (local llama.cpp)",
"package": "@opencode/ai/providers/openai-compatible",
"settings": {
"baseURL": "http://127.0.0.1:8080/v1"
},
"models": {
"dragon-finance-7b": {
"modelID": "dragon-finance-7b",
"name": "Dragon Finance 7B (local)",
"capabilities": {
"tools": true,
"input": ["text"],
"output": ["text"]
},
"limit": {
"context": 32768,
"output": 8192
}
}
}
}
},
// ---- 2. the dragon tool server ----------------------------------------
// These tools are where the accuracy lives. See
// https://huggingface.co/dragonlimited/dragon-harness
"mcp": {
"servers": {
"dragon": {
"type": "local",
"command": ["python", "-m", "dragon_harness.mcp_server"],
// codemode false -> tools appear directly instead of behind a
// code-execution layer. Simpler for a 7B model.
"codemode": false,
"environment": {
"DRAGON_RAG_DIR": "{env:DRAGON_RAG_DIR}",
"DRAGON_FACTS_DB": "{env:DRAGON_FACTS_DB}",
"DRAGON_DEVICE": "{env:DRAGON_DEVICE}",
"DRAGON_EMBED_MODEL": "BAAI/bge-small-en-v1.5"
},
// the fact queries can take a moment on a cold cache
"timeout": { "startup": 60000, "catalog": 60000, "execution": 300000 }
}
}
},
// ---- 3. the finance agent ---------------------------------------------
"agents": {
"dragon-finance": {
"description": "Finance research agent grounded in the Dragon Finance Corpus",
"mode": "primary",
"model": "dragon/dragon-finance-7b",
"instructions": ["AGENTS.md"]
}
},
"default_agent": "dragon-finance",
// keep tool results bounded so a 32k context survives a long session
"tool_output": { "max_lines": 800, "max_bytes": 24000 }
}
|