// 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 } }