Home/Use cases/deepseek-v3 for coding
Use case

DeepSeek V3 for coding

DeepSeek V3 is an open-source 671B MoE model (37B active) with strong code-generation benchmarks and full OpenAI tool-calling support. At $0.24 input / $0.70 output per 1M tokens on QuickSilver Pro, it's the practical default for coding agents and pull-request bots where GPT-4 class quality is needed but 5-10x cheaper.

$0.24 / $0.70 per 1M tokens

What V3 is good at for coding

Code generation: Strong HumanEval, MBPP, and LiveCodeBench scores. Produces idiomatic Python, JavaScript, Go, Rust, TypeScript. Handles multi-file refactors well within the 128K context window.

Tool calling: Implements OpenAI tools / function calling. Drop-in replacement for GPT-4 in LangChain agents, LlamaIndex ReAct loops, Aider, Cline, Cursor — any framework that expects tool_calls in the response.

Structured output: Supports response_format: json_schema strict mode. Useful for code-review bots that return typed diffs, fixers that emit JSON patches, or API doc generators.

When to use V3 vs R1 for coding

Default to V3 for routine code generation, refactoring, PR reviews, and documentation. It's cheaper, faster, and the output is short and direct — no chain-of-thought preamble.

Escalate to R1 for algorithmic problems that benefit from step-by-step reasoning: competitive programming, tricky concurrency bugs, porting from mathematical specifications, or debugging intermittent failures where the chain of reasoning matters more than the final code.

Concretely, R1 costs $1.70 per 1M output tokens and generates 3-5x more tokens (its thinking trace is part of the output). For routine coding, using R1 is 10-15x more expensive with no quality gain.

Quickstart code

python
from openai import OpenAI

client = OpenAI(
    base_url="https://api.quicksilverpro.io/v1",
    api_key="sk-qsp-...",
)

resp = client.chat.completions.create(
    model="deepseek-v3",
    messages=[
        {"role": "system", "content": "You are a senior Python engineer. Write clean, idiomatic code."},
        {"role": "user", "content": "Implement an LRU cache in Python without using functools.lru_cache."},
    ],
    temperature=0.2,
)
print(resp.choices[0].message.content)
print(f"Cost: ${resp.usage.cost:.6f}")
python-tools
tools = [
    {
        "type": "function",
        "function": {
            "name": "read_file",
            "description": "Read a file from disk",
            "parameters": {
                "type": "object",
                "properties": {"path": {"type": "string"}},
                "required": ["path"],
            },
        },
    },
    {
        "type": "function",
        "function": {
            "name": "write_file",
            "description": "Write content to a file",
            "parameters": {
                "type": "object",
                "properties": {
                    "path": {"type": "string"},
                    "content": {"type": "string"},
                },
                "required": ["path", "content"],
            },
        },
    },
]

resp = client.chat.completions.create(
    model="deepseek-v3",
    messages=[{"role": "user", "content": "Refactor app.py to extract the auth helpers."}],
    tools=tools,
    tool_choice="auto",
)
for call in resp.choices[0].message.tool_calls or []:
    print(call.function.name, call.function.arguments)

FAQ

Does DeepSeek V3 match GPT-4 on coding?

On published benchmarks (HumanEval, MBPP, LiveCodeBench), DeepSeek V3 scores competitively with GPT-4o. Real-world developer perception varies by task; V3 tends to produce cleaner idiomatic code in mainstream languages. For edge-case languages or domain-specific code (e.g. Verilog, COBOL), GPT-4 still wins.

Does it work with Aider, Cline, Cursor?

Yes. All three accept a custom OpenAI base URL. For Aider: aider --openai-api-base https://api.quicksilverpro.io/v1 --openai-api-key $QSP_KEY --model deepseek-v3. Cline and Cursor have "Custom OpenAI-compatible provider" settings that accept the same inputs.

Does V3 support strict JSON output?

Yes. Pass response_format: {type: "json_schema", json_schema: {...}}. The model will emit valid JSON matching the schema; strict mode constrains the decoder to the grammar.

What's the context window?

131,072 tokens on QuickSilver Pro. Enough for multi-file refactors in most repos. For larger codebases, use retrieval to feed relevant files, or consider Qwen3.5-35B-A3B with its 262K context.

Try it on $1 free credits

Get API Key