LeetLLM
My PlanLearnGlossaryTracksPracticeBlog
LeetLLM

Your go-to resource for mastering AI & LLM systems.

Product

  • Learn
  • Glossary
  • Tracks
  • Practice
  • Blog
  • RSS

Legal

  • Terms of Service
  • Privacy Policy

© 2026 LeetLLM. All rights reserved.

Blog
DeepSeekOpen ModelsAI InfrastructureAgentic Coding+1

DeepSeek V4 and the US AI Lab Squeeze

DeepSeek V4 Flash 0731 pairs MIT-licensed weights, 1M text context, DSpark speculative decoding, and strong vendor-reported agent results. Learn where it fits, where GLM-5.2 differs, and what to verify before routing traffic.

LeetLLM TeamApril 27, 2026Updated August 8, 202612 min read

Your coding agents don't need a premium closed model for every step. Some requests need hard reasoning. Many others are repo scans, issue summaries, test-log triage, or low-risk codebase Q&A.

DeepSeek V4 Flash 0731 matters because it gives teams a cheaper long-context lane to evaluate before every request goes to the most expensive model.

Routing premise: Test Flash 0731 on routine and agentic coding steps, Pro on harder knowledge-heavy work, and a premium closed model on the failures that remain. Keep every lane on the same task pack.

DeepSeek-V4-Pro is a 1.6 trillion parameter mixture-of-experts (MoE) model with about 49 billion active parameters per token. DeepSeek-V4-Flash has a 284 billion parameter core with 13 billion active parameters. Both are open-weight, MIT-licensed, and advertised with a 1 million token context window across official DeepSeek services.[1]Reference 1DeepSeek V4 Preview Releasehttps://api-docs.deepseek.com/news/news260424[2]Reference 2DeepSeek-V4: Towards Highly Efficient Million-Token Context Intelligencehttps://huggingface.co/deepseek-ai/DeepSeek-V4-Pro

The release doesn't prove that every company should self-host V4. It changes the baseline question. Instead of asking, "Which closed model should handle this?", engineering teams can ask, "Which requests belong on Flash, which need Pro, and which still need a premium closed model?"

What changed in Flash 0731

DeepSeek released deepseek-ai/DeepSeek-V4-Flash-0731 on July 31, 2026. Its changelog says the architecture and core size did not change from Flash Preview. The update is post-training, aimed at stronger agent behavior. Hosted callers keep the API name deepseek-v4-flash; self-hosters can pin the exact 0731 checkpoint.[3]Reference 3DeepSeek-V4-Flash-0731 Public Betahttps://api-docs.deepseek.com/updates/[4]Reference 4DeepSeek-V4-Flash-0731 Model Cardhttps://huggingface.co/deepseek-ai/DeepSeek-V4-Flash-0731

PropertyFlash 0731
Core size284B total, 13B active per token[5]Reference 5DeepSeek-V4: Towards Highly Efficient Million-Token Context Intelligencehttps://arxiv.org/abs/2606.19348
Released artifactHugging Face reports about 304B parameters; 0731 has an attached DSpark speculative-decoding module[4]Reference 4DeepSeek-V4-Flash-0731 Model Cardhttps://huggingface.co/deepseek-ai/DeepSeek-V4-Flash-0731[6]Reference 6DeepSeek-V4-Flash-DSpark Model Cardhttps://huggingface.co/deepseek-ai/DeepSeek-V4-Flash-DSpark
Context1M-token total context; API output cap is 384K within that window[7]Reference 7Models and Pricinghttps://api-docs.deepseek.com/quick_start/pricing[8]Reference 8Create Chat Completionhttps://api-docs.deepseek.com/api/create-chat-completion
InputText only; official Codex metadata lists text input, and Anthropic compatibility rejects image and document blocks[9]Reference 9Use DeepSeek with Codexhttps://api-docs.deepseek.com/quick_start/agent_integrations/codex/[10]Reference 10Anthropic API Compatibilityhttps://api-docs.deepseek.com/guides/anthropic_api/
ModesNon-thinking plus low, high, and max reasoning effort[9]Reference 9Use DeepSeek with Codexhttps://api-docs.deepseek.com/quick_start/agent_integrations/codex/
ServingOfficial Transformers, vLLM, and SGLang recipes; FP4 experts, mostly FP8 remaining weights, optional DSpark speculative decoding[4]Reference 4DeepSeek-V4-Flash-0731 Model Cardhttps://huggingface.co/deepseek-ai/DeepSeek-V4-Flash-0731[5]Reference 5DeepSeek-V4: Towards Highly Efficient Million-Token Context Intelligencehttps://arxiv.org/abs/2606.19348
LicenseMIT[4]Reference 4DeepSeek-V4-Flash-0731 Model Cardhttps://huggingface.co/deepseek-ai/DeepSeek-V4-Flash-0731

The 284B and 304B figures aren't two different base models. DeepSeek describes DSpark as the same checkpoint with an additional speculative module. Use 284B/13B for core model architecture and treat the full 0731 artifact as its own storage and serving object.[4]Reference 4DeepSeek-V4-Flash-0731 Model Cardhttps://huggingface.co/deepseek-ai/DeepSeek-V4-Flash-0731[6]Reference 6DeepSeek-V4-Flash-DSpark Model Cardhttps://huggingface.co/deepseek-ai/DeepSeek-V4-Flash-DSpark[5]Reference 5DeepSeek-V4: Towards Highly Efficient Million-Token Context Intelligencehttps://arxiv.org/abs/2606.19348

The core has 43 Transformer layers, 256 routed experts plus one shared expert in each MoE block, and six routed experts selected per token. Total parameters describe stored capacity; active parameters describe the sparse path. For the underlying architecture, see mixture-of-experts architecture.[5]Reference 5DeepSeek-V4: Towards Highly Efficient Million-Token Context Intelligencehttps://arxiv.org/abs/2606.19348

Why 1M context isn't just a bigger number

A long context window is useful only if the model can afford to keep using it.

During generation, the server keeps a KV cache: saved attention keys and values from prior tokens. That cache lets the model avoid recomputing the whole prefix for every new token, but it grows with context length. At hundreds of thousands of tokens, memory and bandwidth can dominate the system.

Coding agents are exactly the kind of workload that stresses this. A useful agent may carry instructions, file contents, stack traces, tool results, failed patches, test logs, and prior decisions. If long context is too expensive, the product falls back to aggressive truncation, summaries, or retrieval before the model has seen enough raw evidence.

Hybrid attention claim

DeepSeek V4's technical pitch is hybrid attention. The report describes Compressed Sparse Attention (CSA) and Heavily Compressed Attention (HCA), and reports that Flash at 1M context uses 10% of DeepSeek-V3.2's single-token inference FLOPs and 7% of its KV cache.[5]Reference 5DeepSeek-V4: Towards Highly Efficient Million-Token Context Intelligencehttps://arxiv.org/abs/2606.19348

That's the center of the release. The world already had long-context models. The harder problem is making long context cheap enough for agents that keep running.

Dense long-context attention compared with DeepSeek V4 Flash hybrid attention: a recent dense block, sparse selected positions, compressed HCA memory, and vendor-reported 10 percent FLOPs and 7 percent KV cache at 1M context relative to DeepSeek-V3.2.
V4's model card describes recent dense attention, sparse selected positions, and compressed memory. Bars show its release-reported 1M-context ratios relative to DeepSeek-V3.2.

Coding benchmarks are promising, not decisive

DeepSeek positions Flash 0731 directly at coding agents. Official integrations cover Codex, Claude Code, OpenClaw, and OpenCode.[9]Reference 9Use DeepSeek with Codexhttps://api-docs.deepseek.com/quick_start/agent_integrations/codex/[11]Reference 11Integrate with AI Toolshttps://api-docs.deepseek.com/guides/coding_agents

The 0731 model card reports 82.7 on Terminal-Bench 2.1, 54.2 on NL2Repo, 54.4 on DeepSWE, and 70.3 on Toolathlon-Verified. Its comparison table reports GLM-5.2 at 81.0, 48.9, 46.2, and 59.9 on those same rows. GLM-5.2 is a different kind of heavyweight: Z.AI labels it 744B total and about 40B active, while its Hugging Face checkpoint metadata counts about 753B. GLM-5.2 also has MIT-licensed weights, text-only input, and a 1M context window.[4]Reference 4DeepSeek-V4-Flash-0731 Model Cardhttps://huggingface.co/deepseek-ai/DeepSeek-V4-Flash-0731[12]Reference 12GLM-5.2 Model Cardhttps://huggingface.co/zai-org/GLM-5.2[13]Reference 13GLM-5 Repositoryhttps://github.com/zai-org/GLM-5[14]Reference 14GLM-5.2 Model Documentationhttps://docs.z.ai/guides/llm/glm-5.2

Treat those as vendor-reported numbers, not deployment proof. Public code-agent rows used DeepSeek's unreleased minimal harness at max reasoning effort, and two DSBench rows use internal datasets. A coding team still needs workload-local evals: real repos, real issue types, real tests, real latency limits, and clear failure categories. Put Flash 0731, GLM-5.2, and one premium closed model through the same task pack before changing routing.[4]Reference 4DeepSeek-V4-Flash-0731 Model Cardhttps://huggingface.co/deepseek-ai/DeepSeek-V4-Flash-0731

Benchmark caveat: Vendor-reported coding scores are screening evidence, not routing evidence. Use the same tasks, retries, tool limits, and acceptance tests across each model before moving traffic.

API migration: deadline passed

For hosted usage, DeepSeek says teams can keep the same base_url and use deepseek-v4-pro or deepseek-v4-flash. The latter now routes to Flash 0731. The API supports OpenAI Chat Completions and Anthropic formats.[3]Reference 3DeepSeek-V4-Flash-0731 Public Betahttps://api-docs.deepseek.com/updates/[1]Reference 1DeepSeek V4 Preview Releasehttps://api-docs.deepseek.com/news/news260424

DeepSeek's published retirement deadline for deepseek-chat and deepseek-reasoner passed on July 24, 2026 at 15:59 UTC. The release says those aliases became inaccessible after that time. Treat them as retired instead of relying on their former mapping to V4-Flash non-thinking and thinking modes.[1]Reference 1DeepSeek V4 Preview Releasehttps://api-docs.deepseek.com/news/news260424

Migration status: DeepSeek's legacy alias deadline has passed. Pin deepseek-v4-pro or deepseek-v4-flash, then rerun compatibility and quality checks before restoring traffic.

Pin explicit model IDs now. If you're using an Anthropic-compatible coding tool, copy the exact model name from the integration guide. DeepSeek's Claude Code example uses deepseek-v4-pro[1m] for the main Anthropic-compatible lane and deepseek-v4-flash for lower-cost subagent defaults.[11]Reference 11Integrate with AI Toolshttps://api-docs.deepseek.com/guides/coding_agents

Hosted concurrency is also part of the routing decision. DeepSeek's rate-limit docs set account-level concurrent-request caps at 500 for deepseek-v4-pro and 2,500 for deepseek-v4-flash. Crossing the cap returns HTTP 429, and an in-flight request counts until the response completes.[15]Reference 15Rate Limithttps://api-docs.deepseek.com/quick_start/rate_limit/ Fleet plans that assume unlimited parallel Flash workers will hit that wall before quality evaluation becomes the limiting factor.

Thinking mode creates a second ops trap for Anthropic-compatible agents. Thinking is enabled by default. A non-streaming call waits for the full completion, including reasoning tokens, so time-to-first-byte can look like the entire thinking budget. DeepSeek documents keep-alives and can close a connection if inference has not started within about 10 minutes.[16]Reference 16Thinking Modehttps://api-docs.deepseek.com/guides/thinking_mode[15]Reference 15Rate Limithttps://api-docs.deepseek.com/quick_start/rate_limit/ For latency-sensitive background tools, use stream: true or disable thinking with thinking: { "type": "disabled" } on the Anthropic-compatible path.[16]Reference 16Thinking Modehttps://api-docs.deepseek.com/guides/thinking_mode

Ops check: Before putting V4 behind a coding agent or classifier that uses non-streaming calls, prove the client timeout, concurrency budget, and thinking setting on a cold path.

Pricing pressure is the business story

Checked on August 8, 2026. DeepSeek's pricing page identifies the hosted Flash version as DeepSeek-V4-Flash-0731 and lists it at $0.14 per 1M cache-miss input tokens and $0.28 per 1M output tokens. It lists V4-Pro at $0.435 input and $0.87 output. Cache-hit input is lower for both, and DeepSeek warns that prices may change.[7]Reference 7Models and Pricinghttps://api-docs.deepseek.com/quick_start/pricing

Treat the next rows as a fleet spend checkpoint for 2M input tokens plus 0.5M output tokens in a day, not a bake-off of one 1M-token request. Short-tier and long-tier rows stay separate because Gemini and GPT price bands change with prompt length. OpenAI lists GPT-5.6 Sol at $5.00 input and $30.00 output per 1M tokens. Requests above 272K input tokens bill the full request at 2x input and 1.5x output, and explicit cache writes cost 1.25x the uncached input rate.[17]Reference 17OpenAI API Pricinghttps://developers.openai.com/api/docs/pricing[18]Reference 18GPT-5.6 Sol Modelhttps://developers.openai.com/api/docs/models/gpt-5.6-sol[19]Reference 19Prompt cachinghttps://developers.openai.com/api/docs/guides/prompt-caching Anthropic lists Claude Sonnet 5 at $2.00 input and $10.00 output through August 31, 2026, then $3.00 input and $15.00 output starting September 1, 2026, and says Sonnet 5 includes a 1M-token context window at standard pricing.[20]Reference 20Anthropic Model Pricinghttps://platform.claude.com/docs/en/about-claude/pricing[21]Reference 21Context windowshttps://platform.claude.com/docs/en/build-with-claude/context-windows Google's Gemini page lists Gemini 3.1 Pro Preview Standard at $2.00 input and $12.00 output per 1M text tokens for prompts up to 200K, and $4.00 input and $18.00 output for prompts above 200K.[22]Reference 22Gemini API Pricinghttps://ai.google.dev/gemini-api/docs/pricing

Hosted laneInput per 1MOutput per 1MFleet example: 2M input + 0.5M output
DeepSeek V4-Flash-0731$0.14$0.28$0.42
DeepSeek V4-Pro$0.435$0.87$1.31
Gemini 3.1 Pro Preview, short tier$2.00$12.00$10.00
Gemini 3.1 Pro Preview, long tier$4.00$18.00$17.00
GPT-5.6 Sol, up to 272K input$5.00$30.00$25.00
GPT-5.6 Sol, above 272K input$10.00$45.00$42.50
Claude Sonnet 5, through Aug 31$2.00$10.00$9.00
Claude Sonnet 5, from Sep 1$3.00$15.00$13.50
Cited daily cost comparison for two million input and half a million output tokens across DeepSeek V4 Flash 0731, V4 Pro, Gemini 3.1 Pro Preview, Claude Sonnet 5, and GPT-5.6 Sol pricing lanes.
Every bar matches the cited fleet-spend table, including Gemini prompt tiers, GPT-5.6 Sol below and above 272K input tokens, and Sonnet 5 pricing before and after September 1, 2026.

This isn't an apples-to-apples quality claim. It's a margin and routing claim. If Flash passes quality checks for summaries, repo Q&A, classification, or low-risk agent steps, a premium model has to justify each escalation.

For scale, a daily workload with 2 million input tokens and 500,000 output tokens costs about $0.42 on V4-Flash-0731, $1.31 on V4-Pro, roughly $10 to $17 on Gemini 3.1 Pro Preview depending on whether the prompt crosses the 200K tier, $25 to $42.50 on GPT-5.6 Sol depending on whether a request crosses 272K input tokens, or $9 to $13.50 on Claude Sonnet 5 depending on date. Quality differs, but the gap is large enough to test before assuming the premium lane is required.

Self-hosting is real, but not casual

Open weights don't make Flash 0731 or V4-Pro laptop models.

Two questions matter: can you load the weights, and can you serve useful traffic at the target context length?

Hardware reality

SGLang's V4 cookbook lists Flash as a single-node datacenter serving target on B200, B300, GB200, GB300, H200, or H100-class setups. It lists Pro as a higher-capacity deployment across larger GPU configurations, including 8-GPU Blackwell or H200 recipes and 2-node options for some Hopper paths.[23]Reference 23DeepSeek-V4https://docs.sglang.io/cookbook/autoregressive/DeepSeek/DeepSeek-V4 vLLM also publishes dedicated V4-Pro recipes, including 8-GPU B300 and H200 options, with context constraints depending on hardware.[24]Reference 24DeepSeek-V4-Pro vLLM Recipehttps://recipes.vllm.ai/deepseek-ai/DeepSeek-V4-Pro

NVIDIA reports that V4's architecture reduces per-token FLOPs and KV-cache burden relative to DeepSeek-V3.2, and describes early Blackwell serving results for V4-Pro.[25]Reference 25Build with DeepSeek V4 Using NVIDIA Blackwell and GPU-Accelerated Endpointshttps://developer.nvidia.com/blog/build-with-deepseek-v4-using-nvidia-blackwell-and-gpu-accelerated-endpoints/ That helps explain why the hosted price can be low, but it doesn't erase storage, interconnect, cache, batching, or operations costs.

Pilot order

Start with the hosted API to measure quality and routing value. Pilot V4-Flash-0731 if you have steady traffic, privacy needs, or existing inference staff. Treat both Flash 0731 and V4-Pro self-hosting as cluster projects, and benchmark at your real context length. Passing at 32K doesn't prove the 384K or 1M case.

For serving fundamentals, review KV cache and PagedAttention, continuous batching, and LLM cost engineering.

The right response is routing

DeepSeek V4 doesn't end the closed-frontier model business. Strong closed models still win on many hard tasks, enterprise controls, hosted reliability, multimodal products, safety work, and access to the newest closed-frontier releases.

The pressure comes from the middle of the workload. If an open-weight model can handle enough routine steps at a fraction of the price, premium APIs stop being the default lane for every token. This creates the routing dynamic shown below:

Diagram showing Incoming agent step, Private data or policy lock?, yes, and Self-hosted open-weight plus same guardrails.
Incoming agent step, Private data or policy lock?, yes, and Self-hosted open-weight plus same guardrails.

Default lane to test: V4-Flash-0731 for low-risk summaries, classification, repo inspection, and agentic coding; GLM-5.2 for long-horizon repository and tool workflows; V4-Pro for knowledge-heavy or harder agent work; premium closed models for highest-risk reasoning or policy work. Route only after matched evals.

Self-hosting addresses residency and egress. It does not remove prompt injection, tool abuse, secret logging, or policy failure. Keep the same tool allowlists, redaction, approval gates, and no-exfil network boundaries on the private branch that you would require on any other lane.

Routing quadrant places chat and repo scans in V4-Flash-0731, long repository work in GLM-5.2 or V4-Pro, private data on self-hosted open weights, and high-risk work on frontier APIs.
Move right as capability demands rise. Move up when privacy, residency, or policy constraints dominate.

Good routing needs explicit gates:

  • Quality: pass task-specific evals before traffic moves.
  • Risk: escalate security, policy, legal, or high-blast-radius work.
  • Context: measure the context length the task uses.
  • Cost: include cache hit rate, retries, fallback calls, and engineer time.
  • Operations: include rate limits, observability, incident response, and vendor failure modes.
PreviousHow to Become an AI Engineer from Zero in 2026NextBest AI Plans for OpenClaw in 2026
Share this article
XFacebookLinkedInBlueskyRedditHacker NewsEmail
References

DeepSeek V4 Preview Release

DeepSeek · 2026

https://api-docs.deepseek.com/news/news260424

DeepSeek-V4: Towards Highly Efficient Million-Token Context Intelligence

DeepSeek-AI · 2026

https://huggingface.co/deepseek-ai/DeepSeek-V4-Pro

DeepSeek-V4-Flash-0731 Public Beta

DeepSeek · 2026

https://api-docs.deepseek.com/updates/

DeepSeek-V4-Flash-0731 Model Card

DeepSeek-AI · 2026

https://huggingface.co/deepseek-ai/DeepSeek-V4-Flash-0731

DeepSeek-V4: Towards Highly Efficient Million-Token Context Intelligence

DeepSeek-AI · 2026

https://arxiv.org/abs/2606.19348

DeepSeek-V4-Flash-DSpark Model Card

DeepSeek-AI · 2026

https://huggingface.co/deepseek-ai/DeepSeek-V4-Flash-DSpark

Models and Pricing

DeepSeek · 2026

https://api-docs.deepseek.com/quick_start/pricing

Create Chat Completion

DeepSeek · 2026

https://api-docs.deepseek.com/api/create-chat-completion

Use DeepSeek with Codex

DeepSeek · 2026

https://api-docs.deepseek.com/quick_start/agent_integrations/codex/

Anthropic API Compatibility

DeepSeek · 2026

https://api-docs.deepseek.com/guides/anthropic_api/

Integrate with AI Tools

DeepSeek · 2026

https://api-docs.deepseek.com/guides/coding_agents

GLM-5.2 Model Card

Z.AI · 2026

https://huggingface.co/zai-org/GLM-5.2

GLM-5 Repository

Z.AI · 2026

https://github.com/zai-org/GLM-5

GLM-5.2 Model Documentation

Z.AI · 2026

https://docs.z.ai/guides/llm/glm-5.2

Rate Limit

DeepSeek · 2026

https://api-docs.deepseek.com/quick_start/rate_limit/

Thinking Mode

DeepSeek · 2026

https://api-docs.deepseek.com/guides/thinking_mode

OpenAI API Pricing

OpenAI · 2026

https://developers.openai.com/api/docs/pricing

GPT-5.6 Sol Model

OpenAI · 2026

https://developers.openai.com/api/docs/models/gpt-5.6-sol

Prompt caching

OpenAI · 2026

https://developers.openai.com/api/docs/guides/prompt-caching

Anthropic Model Pricing

Anthropic · 2026

https://platform.claude.com/docs/en/about-claude/pricing

Context windows

Anthropic · 2026

https://platform.claude.com/docs/en/build-with-claude/context-windows

Gemini API Pricing

Google · 2026

https://ai.google.dev/gemini-api/docs/pricing

DeepSeek-V4

SGLang · 2026

https://docs.sglang.io/cookbook/autoregressive/DeepSeek/DeepSeek-V4

DeepSeek-V4-Pro vLLM Recipe

vLLM · 2026

https://recipes.vllm.ai/deepseek-ai/DeepSeek-V4-Pro

Build with DeepSeek V4 Using NVIDIA Blackwell and GPU-Accelerated Endpoints

NVIDIA · 2026

https://developer.nvidia.com/blog/build-with-deepseek-v4-using-nvidia-blackwell-and-gpu-accelerated-endpoints/