Skip to main content

DeepSeek

DeepSeek builds high-performance coding models. AgentXchain connects via api_proxy using DeepSeek's OpenAI-compatible API.

Which adapter?

api_proxy with provider: "openai" and a custom base_url — DeepSeek's API is OpenAI-compatible.

Prerequisites

  • A DeepSeek API key — get one from platform.deepseek.com
  • DEEPSEEK_API_KEY set in your environment
  • agentxchain CLI installed

Configuration

{
"runtimes": {
"deepseek-dev": {
"type": "api_proxy",
"provider": "openai",
"model": "deepseek-coder-v3",
"auth_env": "DEEPSEEK_API_KEY",
"base_url": "https://api.deepseek.com/v1/chat/completions"
}
},
"roles": {
"dev": {
"runtime": "deepseek-dev",
"mandate": "Implement features and fix bugs",
"authority": "proposed"
}
}
}

Minimal working example

agentxchain init --governed --template api-service --goal "Build a feedback intake API" --dir my-project -y
cd my-project
# Replace the scaffolded runtime wiring in agentxchain.json with the DeepSeek config above.
agentxchain doctor
agentxchain connector check
agentxchain connector validate deepseek-dev
agentxchain run

If you prefer the guided interactive scaffold, run agentxchain init --governed without -y, then update agentxchain.json with the DeepSeek config above before agentxchain connector check and agentxchain connector validate deepseek-dev.

Available models

ModelBest for
deepseek-v3.2General-purpose, strong reasoning
deepseek-r2Deep reasoning, complex architecture
deepseek-coder-v3Optimized for code generation

Local via Ollama

DeepSeek models are open-weight and can run locally:

ollama pull deepseek-coder-v3:33b
{
"runtimes": {
"deepseek-local": {
"type": "api_proxy",
"provider": "ollama",
"model": "deepseek-coder-v3:33b",
"auth_env": "OLLAMA_API_KEY"
}
}
}

Verify the connection

export DEEPSEEK_API_KEY="sk-..."
agentxchain connector check
agentxchain connector validate deepseek-dev

Budget configuration

DeepSeek models are not in the bundled cost defaults. Add an operator override keyed by the exact runtime model string:

{
"budget": {
"cost_rates": {
"deepseek-coder-v3": { "input_per_1m": 0.14, "output_per_1m": 0.28 }
}
}
}

Gotchas

  • OpenAI-compatible: DeepSeek uses OpenAI's API format. Set provider: "openai" with a base_url override.
  • Pricing: DeepSeek models are significantly cheaper than comparable proprietary models. Good for high-volume governed runs.
  • Rate limits: DeepSeek applies rate limits. Check your account tier.