DeepSeek V4 is the most capable open-weight AI model available in 2026, and it costs less per token than a coffee refills budget. The V4-Pro variant — 1.6 trillion total parameters with 49 billion activated per token — scores 80.6% on SWE-bench Verified, statistically tied with Claude Opus 4.6 at 80.8%, while charging roughly 1/29th the output price (DeepSeek API pricing). Both V4-Pro and the lighter V4-Flash ship under the MIT license with a 1-million-token context window, meaning you can download the weights, fine-tune them, and ship commercial products without asking anyone for permission (Hugging Face).
Last verified: 2026-07-21 · V4-Pro: 1.6T params, 49B active, 80.6% SWE-bench Verified · V4-Flash: 284B params, 13B active, 79.0% SWE-bench · Both: 1M context, MIT license · V4-Pro: $0.435/$0.87 per 1M in/out tokens · V4-Flash: $0.14/$0.28 · Pricing/limits are volatile — re-check before budgeting.
What Is DeepSeek V4?
DeepSeek V4 is a family of Mixture-of-Experts (MoE) language models released by Chinese AI lab DeepSeek on April 24, 2026, as a preview (DeepSeek release notes). Two variants shipped the same day: V4-Pro for frontier reasoning and coding, V4-Flash for high-throughput, cost-sensitive workloads. Both carry a 1-million-token context window, 384K max output tokens, and open weights on Hugging Face under the MIT license (Hugging Face blog).
The release came exactly one year after DeepSeek's R1 model shook the AI industry by proving a smaller lab could compete with OpenAI and Anthropic on reasoning. V4 is the generational leap that followed — not a refresh of V3.2, but a new architecture designed to make million-token context actually usable in production rather than a marketing checkbox.
How Does DeepSeek V4's Mixture-of-Experts Architecture Work?
DeepSeek V4 uses a Mixture-of-Experts (MoE) design, which means only a fraction of the model's total parameters fire on any given token. Think of it as a huge office building with 1.6 trillion workers, but only 49 billion of them — about 3% — get called into the room for each question. The rest stay dormant. That keeps inference fast and cheap despite the model's massive total size.
| Model | Total Parameters | Active Per Token | Layers | Routed Experts | Activated Experts |
|---|---|---|---|---|---|
| V4-Pro | 1.6T | 49B | 61 | 384 | 6 |
| V4-Flash | 284B | 13B | 43 | 256 | 6 |
| V3.2 (previous) | 671B | 37B | 61 | 256 | 8 |
Sources: Hugging Face blog, DeepSeek V4 architecture report
The key innovation over V3.2 isn't just scale — it's efficiency. V4 introduces a hybrid attention architecture that interleaves two compression strategies across layers instead of running dense self-attention everywhere.
How Does V4 Handle 1 Million Tokens Without Slowing Down?
A million-token context window is just capacity — what matters is the cost of every forward pass at that depth. Standard transformer attention scales badly: push a real million-token prompt through a conventional model and the KV cache (the memory the model uses to avoid recomputing earlier tokens) alone can eat tens of gigabytes of VRAM.
V4 solves this with two attention mechanisms working together:
Compressed Sparse Attention (CSA) — compresses the attention pattern so the model doesn't re-examine every previous token with equal weight. Think of a librarian who has already read the whole library and flips straight to the right page instead of starting from page one every time you ask a question.
Heavily Compressed Attention (HCA) — aggressively compresses long-range dependencies where fine-grained attention isn't needed, saving memory and compute.
The results at 1M-token context are significant: V4-Pro requires only 27% of the per-token inference FLOPs and 10% of the KV cache memory compared to V3.2. V4-Flash goes further — just 10% of FLOPs and 7% of KV cache (Hugging Face blog, DeepSeek release notes). Compared to a standard grouped-query-attention architecture with 8 heads in bfloat16, V4's KV cache is roughly 2% the size — making it dramatically easier to deploy for large-context workloads.
Two additional architectural choices round out V4's design:
- Manifold-Constrained Hyper-Connections (mHC) — a residual-propagation scheme that stabilizes signal flow through very deep MoE stacks, preventing the signal degradation that plagues models with 60+ layers.
- Muon optimizer with FP4/FP8 mixed-precision training — MoE experts train in FP4 while most other parameters use FP8, maximizing memory efficiency. The model was pre-trained on over 32 trillion tokens.
DeepSeek V4 Pro vs V4 Flash: Which Should You Use?
Pick V4-Flash as your default. Escalate to V4-Pro only when you need harder reasoning, agentic coding, or maximum long-context quality. That's the practical guidance from every source that has tested both variants.
| Spec | V4-Pro | V4-Flash |
|---|---|---|
| Total parameters | 1.6T | 284B |
| Active per token | 49B | 13B |
| Context window | 1M tokens | 1M tokens |
| Max output | 384K tokens | 384K tokens |
| SWE-bench Verified | 80.6% | 79.0% |
| Terminal-Bench 2.0 | 67.9% | 56.9% |
| LiveCodeBench | 93.5 | — |
| GPQA Diamond | 90.1% | 88.1% |
| Input price (cache miss) | $0.435/M | $0.14/M |
| Output price | $0.87/M | $0.28/M |
| Best for | Frontier coding, reasoning, agents | High-volume tasks, chatbots, summarization |
Sources: DeepSeek API pricing, DeepInfra model overview, buildfastwithai review
The 12.4× output price gap between Pro ($0.87/M) and Flash ($0.28/M) is the single biggest reason to default to Flash. On SWE-bench Verified, Flash scores 79.0% — only 1.6 points behind Pro. The real gaps appear on complex multi-step tool use (Terminal-Bench 2.0: 56.9% vs 67.9%) and factual recall (SimpleQA-Verified: 34.1% vs 57.9%), suggesting Flash struggles more on agentic workflows that require chaining many tool calls (buildfastwithai review).
For most API use cases — summarization, code generation at moderate complexity, structured extraction, chatbot responses — Flash holds its own completely. For deep-dive comparisons of V4 Pro against specific frontier competitors, see our DeepSeek V4 Pro vs Claude Fable 5 comparison.
How Much Does DeepSeek V4 Cost Compared to GPT-5.5 and Claude?
DeepSeek V4's pricing resets the floor for frontier-class AI. V4-Pro's current permanent rate is $0.435 per million input tokens and $0.87 per million output tokens — a 75% discount that DeepSeek made permanent on May 22, 2026, down from the original list price of $1.74/$3.48 (DeepSeek API pricing, Codersera guide).
| Model | Input $/M (cache miss) | Output $/M | Context |
|---|---|---|---|
| DeepSeek V4-Flash | $0.14 | $0.28 | 1M |
| DeepSeek V4-Pro | $0.435 | $0.87 | 1M |
| GPT-5.5 | ~$15 | ~$15 | 256K |
| Claude Opus 4.6 | ~$15 | ~$75 | 200K |
Sources: DeepSeek API pricing, apidog pricing analysis. Competitor prices are approximate published rates as of July 2026 and may vary by tier.
Cache-hit input pricing makes repeated prompts nearly free. When your request reuses a recently seen prompt prefix (same system prompt, same conversation history), DeepSeek bills that portion at the cache-hit rate: $0.0028/M for V4-Flash and $0.003625/M for V4-Pro — roughly 98-99% off the cache-miss price. Caching is automatic and best-effort (DeepSeek context caching docs).
A dollar buys approximately 1.15 million output tokens from V4-Pro, versus about 40K from Claude Opus 4.8 and 33K from GPT-5.5 (MorphLLM analysis). For a deeper look at how this pricing shift affects the broader AI market, see our analysis of the AI model pricing war of 2026.
What Are DeepSeek V4's Benchmark Scores — Honestly?
The headline number is real but needs context. On SWE-bench Verified (agentic coding — can the model autonomously fix bugs in real GitHub repos?), V4-Pro-Max scores 80.6%, within 0.2 points of Claude Opus 4.6 at 80.8% (byteiota analysis, DataCamp review).
| Benchmark | DeepSeek V4-Pro (Max) | Claude Opus 4.6 | GPT-5.5 | Gemini 3.1 Pro |
|---|---|---|---|---|
| SWE-bench Verified | 80.6% | 80.8% | 74.9% | 80.6% |
| SWE-bench Pro (harder) | ~55% | 64.3% | N/A | N/A |
| LiveCodeBench | 93.5 | 88.8 | N/A | 91.7 |
| Codeforces Rating | 3,206 | N/A | 3,168 | N/A |
| GPQA Diamond | 90.1% | 91.3% | N/A | 94.3% |
| MMLU-Pro | 73.5 | N/A | N/A | N/A |
| Humanity's Last Exam | 37.7% | 40.0% | N/A | N/A |
Sources: DataCamp, byteiota, DeepInfra. Vendor-reported figures as of April 2026; independent replication ongoing.
Here's the honest read:
Where V4-Pro wins: LiveCodeBench (93.5 — highest of any tested model), Codeforces rating (3,206, edging out GPT-5.5), and cost-performance ratio by a wide margin.
Where V4-Pro ties: SWE-bench Verified (statistically tied with Claude Opus 4.6 and Gemini 3.1 Pro).
Where V4-Pro trails: SWE-bench Pro (the harder, messier bug-fixing eval) — about 55% versus Claude's 64.3%, a 9-point gap that matters for complex refactors. Humanity's Last Exam (37.7% vs 40.0%) and HMMT 2026 math (95.2% vs 96.2%) — nuanced reasoning and deep math still favor closed frontier models. V4-Pro also has a known hallucination tendency: a 94% rate on the AA-Omniscience benchmark, meaning when it doesn't know an answer, it nearly always responds anyway rather than abstaining (DeepInfra).
Bottom line: For the majority of API use cases — coding at moderate complexity, structured extraction, summarization, long-document analysis — V4 holds its own completely. For gnarly legacy codebase refactors or tasks requiring calibrated confidence, the closed frontier still holds an edge.
How Do You Set Up the DeepSeek V4 API?
The V4 API is OpenAI-compatible, which means any client you already use against GPT models works with a single base-URL swap. DeepSeek also offers an Anthropic-compatible endpoint for Claude SDK users.
Step 1: Create an API key
Sign up at platform.deepseek.com and top up at least $2. Without a balance, calls return 402 Insufficient Balance (apidog guide).
Step 2: Install the OpenAI SDK
pip install openai
Step 3: Set the base URL and model ID
from openai import OpenAI
client = OpenAI(
api_key="your-deepseek-api-key",
base_url="https://api.deepseek.com"
)
response = client.chat.completions.create(
model="deepseek-v4-flash", # or "deepseek-v4-pro"
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Explain MoE architecture in simple terms."}
],
temperature=1.0,
top_p=1.0
)
print(response.choices[0].message.content)
Step 4: Choose your reasoning mode
V4 exposes three reasoning modes toggled at inference time:
| Mode | When to use | Token cost |
|---|---|---|
non-thinking |
Fast responses, simple tasks | Lowest |
thinking (high) |
Most reasoning tasks | Moderate |
thinking_max |
Hardest problems, pair with 384K+ context | Highest |
The rate per token is the same across modes — thinking modes just consume more tokens because the model writes reasoning traces. Track reasoning_tokens in the usage object to measure the true cost (apidog guide).
Migration note: The legacy deepseek-chat and deepseek-reasoner aliases now map to V4-Flash (non-thinking and thinking modes) and will be fully retired on July 24, 2026 at 15:59 UTC. Update your model IDs before then (DeepSeek API pricing).
What Can You Actually Do With a 1-Million-Token Context Window?
A million tokens is approximately 750,000 words — roughly 10 thick books, an entire mid-sized codebase, or hundreds of pages of legal documents. V4's architecture makes this capacity genuinely usable rather than a theoretical limit that degrades in practice.
Here are practical workflows where the 1M context window creates real value:
1. Codebase Q&A without RAG
V4's MRCR 1M retrieval score of 83.5 and CorpusQA 1M score of 62.0 mean you can fit a whole service-sized codebase (~750K tokens) into a single prompt and query it directly — no vector database, no chunking pipeline, no retrieval errors (Codersera guide). Cache-hit pricing ($0.003625/M for V4-Pro) makes re-querying the same repo prefix essentially free.
2. Whole-document analysis
Legal review, financial report analysis, multi-hour transcript processing — anywhere the old pattern was "summarize then re-summarize and lose detail," V4 lets you keep the full corpus in context. Cache the document on the first call, then query it repeatedly at near-zero input cost.
3. Long-running agent workflows
V4 was specifically designed for agentic tasks that break other models: long tool-use trajectories where the context budget fills up, KV cache overflows, and tool-call quality degrades halfway through. The hybrid attention architecture keeps per-token costs low even as the context grows to hundreds of thousands of tokens. For a deeper dive into building agents that last, see our guide to AI agent architecture that survives the 6-month churn.
4. Batch content generation
V4-Flash at $0.14/$0.28 per million tokens makes high-volume content generation effectively free at typical usage. Generating 30 articles per month with 2,000-token prompts and 4,000-token outputs costs approximately $0.04/month on V4-Flash (Puter developer guide).
How Do You Self-Host DeepSeek V4?
Because V4 ships under the MIT license, you can download the weights from Hugging Face and run them on your own hardware — no API fees, no data leaving your infrastructure.
V4-Flash self-hosting:
- Runs on a single H100 (tight) or comfortably on 4×H200
- Native FP4+FP8 mixed quantization keeps memory requirements manageable
- Use vLLM or SGLang for serving
V4-Pro self-hosting:
- Requires 8×H100 minimum at FP8 quantization
- Best suited for organizations with existing GPU clusters
For teams where data sovereignty matters — handling sensitive code, proprietary IP, or regulated data — self-hosting via open weights is the mitigation path. The DeepSeek API infrastructure is operated from China, which creates compliance considerations for some organizations (buildfastwithai review). If you're weighing whether to invest in GPUs for local AI, see our guide on whether you should buy a GPU for local AI in 2026.
NVIDIA shipped an official NeMo fine-tuning recipe for V4-Flash on Blackwell GPUs on April 25, 2026, handling V4-specific Q-LoRA and O-LoRA quirks. Most teams should fine-tune Flash and use Pro as a teacher model rather than attempting to fine-tune Pro directly (Codersera guide).
What Are DeepSeek V4's Limitations?
An honest assessment requires naming the gaps:
- SWE-bench Pro gap: On the harder, messier bug-fixing eval, V4-Pro scores ~55% versus Claude Opus 4.6's 64.3%. For automated coding agents handling complex refactors or gnarly legacy codebases, this 9-point gap is real (byteiota).
- Hallucination tendency: V4-Pro has a 94% hallucination rate on the AA-Omniscience benchmark — when it doesn't know an answer, it almost always responds anyway rather than abstaining. This matters for production use cases where confidence calibration is critical (DeepInfra).
- Preview status: DeepSeek explicitly labels the April 24 launch as a preview. The models are production-stable, but capabilities may expand. The official non-preview version is expected to add traffic-management features during peak hours.
- Data sovereignty: The hosted API runs on DeepSeek-operated infrastructure based in China. Self-hosting via open weights is the path for teams with compliance constraints.
- Closed training pipeline: You get the weights and architecture, not the training code, training data, or RLHF pipeline. You can fine-tune V4, but you cannot train your own V4 from scratch using DeepSeek's recipe.
- HLE and deep math: On Humanity's Last Exam (37.7% vs 40.0%) and HMMT 2026 (95.2% vs 96.2%), Claude Opus 4.6 holds a meaningful edge on nuanced reasoning and mathematical problem-solving.
What This Means for You
If you're a developer or builder: Start with V4-Flash as your default model for most tasks. The API is OpenAI-compatible — swap the base URL and model ID, and your existing code works. Escalate to V4-Pro for hard coding, agentic workflows, or long-context quality. The cost savings over Claude or GPT-5.5 are large enough to fund experimentation you'd otherwise skip.
If you run a small business: V4's 1M-token context window means you can feed it your entire corpus of standard operating procedures, customer FAQs, and past content in one go — then query it repeatedly at near-zero cost thanks to cache-hit pricing. A customer support chatbot handling 1,000 conversations/month costs approximately $1.90 on V4-Flash, dropping below $1 with caching (Puter guide).
If you're considering self-hosting: V4-Flash is the practical target for self-hosting — it fits on a single H100 and delivers frontier-adjacent quality. V4-Pro requires serious hardware (8×H100 minimum). If you handle sensitive data or operate under data-sovereignty constraints, the MIT license makes self-hosting a viable compliance path. For a free local AI setup guide, see our free local AI agent setup guide for 2026.
If you're evaluating model strategy: The open-weight frontier has closed the gap with closed models to within months, not years. V4-Pro trails Claude Opus 4.6 by 0.2 points on SWE-bench Verified at 1/29th the output cost. The strategic question is no longer "can open models compete?" — it's "what justifies paying 30× more for a closed model?" For a broader perspective on how open-weight models are reshaping the market, see our analysis of the AI pricing war and why frontier labs lost their pricing power.
FAQ
Q: Is DeepSeek V4 free to use?
A: The web chat at chat.deepseek.com is free. The API is pay-per-token: V4-Flash costs $0.14/$0.28 per million input/output tokens, V4-Pro costs $0.435/$0.87. The model weights are free to download under the MIT license, so self-hosting has no licensing fee — you only pay for your own hardware.
Q: Is DeepSeek V4 better than Claude or GPT-5.5?
A: On coding benchmarks (SWE-bench Verified, LiveCodeBench, Codeforces), V4-Pro is statistically tied with or ahead of Claude Opus 4.6 and GPT-5.5. On harder reasoning tasks (SWE-bench Pro, Humanity's Last Exam, deep math), closed frontier models still hold a meaningful edge. V4-Pro costs roughly 1/29th the output price of Claude Opus 4.6.
Q: Can I use DeepSeek V4 for commercial products?
A: Yes. Both V4-Pro and V4-Flash ship under the MIT license, which permits commercial use, fine-tuning, redistribution, and shipping derivative products without licensing fees or permission from DeepSeek. You keep your fine-tuned weights private.
Q: What's the difference between V4-Pro and V4-Flash?
A: V4-Pro has 1.6 trillion total parameters (49B active per token) and costs $0.435/$0.87 per million tokens. V4-Flash has 284 billion total parameters (13B active) and costs $0.14/$0.28. Flash is 12.4× cheaper on output and sufficient for most tasks. Use Pro for hard reasoning, agentic coding, or maximum long-context quality.
Q: How does DeepSeek V4's 1M context window actually perform?
A: V4's MRCR 1M retrieval score is 83.5, and needle-in-haystack testing shows 97-99% retrieval accuracy for facts buried at varying depths across the full context window. The hybrid attention architecture (CSA + HCA) keeps inference costs low — V4-Pro uses only 27% of V3.2's per-token FLOPs and 10% of its KV cache at 1M context.
Q: When do the old DeepSeek model names stop working?
A: The legacy deepseek-chat and deepseek-reasoner API aliases (which now map to V4-Flash non-thinking and thinking modes) will be fully retired on July 24, 2026 at 15:59 UTC. After that, API calls using those names will return errors. Update to deepseek-v4-flash or deepseek-v4-pro before then.
Q: Can I fine-tune DeepSeek V4 on my own data?
A: Yes. The MIT license permits fine-tuning, and NVIDIA released an official NeMo fine-tuning recipe for V4-Flash on April 25, 2026. Most teams should fine-tune Flash (which fits on fewer GPUs) and use Pro as a teacher model. You keep your fine-tuned weights private — no obligation to share them.

Discussion
0 comments