Modelsdeepseek-aiDeepSeek-V4-Flash-0731
providerdeepseek-ai /

DeepSeek-V4-Flash-0731

32 DZD in 72 DZD out 6.4 DZD cached/ 1M tokens
Service tier pricing, in DZD per 1M tokens
TierInputOutputCached input
PriorityLearn more
32.497.28.1
17.351.94.4
Prices in DZD per 1M tokens

DeepSeek V4 Flash 0731 is the official release of V4 Flash, and it is the checkpoint where the series became genuinely agentic. Built on the same efficiency-first Mixture-of-Experts design — 284B total parameters with only 13B active per token and a one-million-token context window — it adds a substantially rebuilt agentic capability that lifts long-horizon coding, terminal automation, and tool-use scores far above the preview, in several cases past the much larger V4 Pro preview despite activating a fraction of its parameters. Reasoning effort is a per-request setting with three levels, and the checkpoint ships with a speculative decoding module for faster generation. Released under the MIT license, it is the model to reach for on DEVUP AI when an agent has to finish a long job, not just start one.

Publicfp4JSON
DeepSeek-V4-Flash-0731
Capabilities
ToolsReasoning (optional)Structured output
ArchitectureTransformer
Context Window1M

DeepSeek V4 Flash 0731

Overview

DeepSeek V4 Flash 0731 is the official release of DeepSeek V4 Flash. It keeps the efficiency-first design of the series — a Mixture-of-Experts model with 284B total parameters of which only 13B activate per token, and a one-million-token context window — and rebuilds what the model can do when it has to act rather than answer.

The gap over the preview checkpoint is not incremental. On long-horizon software engineering the resolve rate moves from single digits to over fifty percent. On terminal automation and security-oriented code tasks it improves by twenty to forty points. On most of these it now exceeds the far larger V4 Pro preview, which activates nearly four times as many parameters per token.

Two properties define how it is used in practice: reasoning effort is a per-request control with three levels, and the checkpoint ships with a speculative decoding module attached, which serving stacks use to generate faster without changing the output distribution.


At a Glance

FieldValue
Model TypeMixture-of-Experts transformer
Total Parameters284B
Activated Parameters13B per token
Context Window1,048,576 tokens (1M)
PrecisionFP4 + FP8 mixed
ModalityText in → text out
ReasoningThree effort levels, separate reasoning_content field
Tool CallingSupported
Speculative DecodingModule included in the checkpoint
LicenseMIT

Architecture

ComponentDetail
SparsityMoE — 284B total, 13B activated per token
AttentionHybrid stack: Compressed Sparse Attention (CSA) + Heavily Compressed Attention (HCA)
Residual pathManifold-Constrained Hyper-Connections (mHC)
Speculative decodingDraft module attached to the same checkpoint
PrecisionMoE expert weights in FP4; attention, normalization and router in FP8

Hybrid attention is what makes a million-token window usable rather than nominal. CSA and HCA together attack the two costs that normally make long-context inference impractical — per-token compute and KV cache size — bringing both down by roughly an order of magnitude at full context across the V4 series.

mHC strengthens the conventional residual connection, improving stability of signal propagation across layers without sacrificing expressivity. It is a training-stability property rather than a feature, but it is part of why a model this sparse stays coherent across very long inputs.

Speculative decoding is unusual here in that the draft weights live in the same checkpoint as the target model rather than in a separate smaller model. The practical effect is lower generation latency, which matters most on the long outputs this model produces at high reasoning effort.


Relationship to the Preview Checkpoint

This release supersedes the V4 Flash preview. Same architecture, same context window, same activated parameter count — a rebuilt agentic capability and a renamed reasoning-effort scale.

If you are currently calling the preview checkpoint, migration is a model ID change plus one adjustment: the fastest reasoning level is now named low.


Reasoning Effort Levels

The most important operational decision when using this model.

LevelBehaviourUse it for
lowMinimal deliberation, fast responsesRoutine tasks, classification, extraction, formatting
highExplicit reasoning before answeringComplex problems, planning, code, analysis
maxReasoning pushed to its fullest extentLong-horizon agent work, the hardest problems

DeepSeek evaluates the agentic benchmarks below at the max level. If you are building an agent that must complete a long task rather than answer a question, that is the level the published results describe.

Selecting a level

DEVUP AI forwards the complete request body upstream without stripping unknown fields, so reasoning effort can be passed directly in your payload:

JSON
{
  "model": "deepseek-ai/DeepSeek-V4-Flash-0731",
  "messages": [{ "role": "user", "content": "Fix the failing test in this repository." }],
  "reasoning_effort": "max",
  "temperature": 1.0,
  "top_p": 0.95
}

Capabilities

CapabilityValue
input_typestext
output_typestext
image_inputNot supported
context_window1048576
reasoningNative — low, high, max
reasoning_fieldreasoning_content — separate from content
streamingSupported
tool_callingSupported
requires_promptYes — text prompt required

Recommended Use Cases

  • Long-horizon coding agents — the capability this release was built for. Tasks that span many turns, many files, and many failed attempts before succeeding.
  • Terminal and infrastructure automation — planning a sequence of commands, reading the output, and recovering from errors without a human in the loop.
  • Full-stack development assistance — generating and wiring code across layers rather than producing isolated snippets.
  • Tool-heavy workflows — orchestrating many tools across a long trajectory, where the failure mode is losing the thread rather than formatting a call incorrectly.
  • Whole-repository and whole-corpus analysis — the context window holds a codebase, a contract set, or a long log archive without a retrieval layer in front of it.
  • High-throughput production traffic — 13B activated parameters plus speculative decoding is what makes this viable as a default rather than an escalation tier.

Using DeepSeek V4 Flash 0731 on DEVUP AI

Base URL: https://api.devupai.com/v1 · Model ID: deepseek-ai/DeepSeek-V4-Flash-0731

Quick start — cURL

BASH
curl https://api.devupai.com/v1/chat/completions \
  -H "Authorization: Bearer $DEVUP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-ai/DeepSeek-V4-Flash-0731",
    "messages": [
      {
        "role": "user",
        "content": "Two services write to the same row without a transaction. Walk through the failure modes in order of likelihood and propose the smallest fix for each."
      }
    ],
    "reasoning_effort": "high",
    "temperature": 1.0,
    "top_p": 1.0,
    "max_tokens": 32768
  }'

Node.js — DEVUP AI SDK

BASH
npm install devupai
JAVASCRIPT
import DevupAI from "devupai";

const client = new DevupAI({
  apiKey: process.env.DEVUP_API_KEY,
});

const response = await client.chat.completions.create({
  model: "deepseek-ai/DeepSeek-V4-Flash-0731",
  messages: [
    {
      role: "system",
      content:
        "You are a staff engineer reviewing a migration. Report only defects that would " +
        "cause data loss or downtime, each with a severity and the smallest safe fix.",
    },
    { role: "user", content: migrationPlan },
  ],
  reasoning_effort: "high",
  temperature: 1.0,
  top_p: 1.0,
  max_tokens: 32768,
});

console.log(response.choices[0].message.content);

Agent loop — Python

The agentic scenario this release targets. Note top_p: 0.95 and reasoning_effort: "max", which are the settings DeepSeek uses for its own agent evaluations.

PYTHON
import os
import json
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["DEVUP_API_KEY"],
    base_url="https://api.devupai.com/v1",
)

TOOLS = [
    {
        "type": "function",
        "function": {
            "name": "read_file",
            "description": "Return the contents of a file at a repository-relative path.",
            "parameters": {
                "type": "object",
                "properties": {"path": {"type": "string"}},
                "required": ["path"],
            },
        },
    },
    {
        "type": "function",
        "function": {
            "name": "run_tests",
            "description": "Run the test suite and return pass/fail counts with failure output.",
            "parameters": {"type": "object", "properties": {}},
        },
    },
]


def read_file(path: str) -> dict:
    """Replace with your real, sandboxed file access."""
    raise NotImplementedError


def run_tests() -> dict:
    """Replace with your real, sandboxed test runner."""
    raise NotImplementedError


HANDLERS = {"read_file": read_file, "run_tests": run_tests}

messages = [{"role": "user", "content": "The invoice rounding test is failing. Find the cause and fix it."}]

for _ in range(30):  # bounded loop — never let an agent iterate without a ceiling
    response = client.chat.completions.create(
        model="deepseek-ai/DeepSeek-V4-Flash-0731",
        messages=messages,
        tools=TOOLS,
        reasoning_effort="max",
        temperature=1.0,
        top_p=0.95,
        max_tokens=32768,
    )

    message = response.choices[0].message
    messages.append(message)

    if not message.tool_calls:
        print(message.content)
        break

    for call in message.tool_calls:
        handler = HANDLERS.get(call.function.name)
        if handler is None:
            result = {"error": "unknown_tool", "name": call.function.name}
        else:
            try:
                result = handler(**json.loads(call.function.arguments or "{}"))
            except Exception as exc:  # surface the failure to the model, do not crash
                result = {"error": type(exc).__name__, "detail": str(exc)}

        messages.append(
            {
                "role": "tool",
                "tool_call_id": call.id,
                "content": json.dumps(result),
            }
        )
else:
    print("Agent loop exceeded its iteration limit.")

Returning a structured error to the model rather than raising is deliberate. This checkpoint was trained on trajectories where actions fail and the agent recovers, so a described failure is information it can use.

Reading the reasoning trace

Reasoning arrives in a separate field, not inline in the answer. Read it explicitly, and null-check it — not every model on the platform populates it.

PYTHON
message = response.choices[0].message

reasoning = getattr(message, "reasoning_content", None)
if reasoning:
    # Log it, do not show it. Reasoning traces are intermediate, not conclusions.
    logger.debug("trace length: %d chars", len(reasoning))

print(message.content)

Never concatenate reasoning_content into content before parsing or display. Doing so breaks JSON parsing on structured-output paths and shows users an unpolished draft of an answer they never asked to see.

Streaming with usage

PYTHON
stream = client.chat.completions.create(
    model="deepseek-ai/DeepSeek-V4-Flash-0731",
    messages=[{"role": "user", "content": "Design a retry policy for a webhook delivery system."}],
    reasoning_effort="high",
    temperature=1.0,
    top_p=1.0,
    max_tokens=32768,
    stream=True,
    stream_options={"include_usage": True},
)

for chunk in stream:
    if chunk.choices and chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="", flush=True)
    if chunk.usage:
        print(f"\n\nTokens — in: {chunk.usage.prompt_tokens}, out: {chunk.usage.completion_tokens}")

Setting stream_options.include_usage returns a final chunk carrying token counts. At high and max effort the trace can dominate the output budget, and this is the only way to see it.

Delegating access with a scoped JWT

Long-horizon agents run unattended, which is exactly when an unbounded loop becomes expensive. Issue a token restricted to this model with an expiry and a spending limit instead of sharing your API key:

BASH
curl -X POST "https://api.devupai.com/v1/scoped-jwt" \
  -H "Authorization: Bearer $DEVUP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "api_key_name": "auto",
    "models": ["deepseek-ai/DeepSeek-V4-Flash-0731"],
    "expires_delta": 7200,
    "spending_limit": 500
  }'

The returned token is used exactly like an API key in the Authorization header. Requests for any other model, or past the expiry or spending limit, are rejected — a hard ceiling on what a runaway agent loop can consume.


Recommended Generation Parameters

ParameterValue
temperature1.0
top_p0.95 for agentic scenarios, 1.0 otherwise
max_tokensLarge — see below

DeepSeek recommends allowing up to 384K output tokens at the high and max effort levels. Truncating a reasoning model mid-trace yields an unfinished, unusable response rather than a shorter one, so size max_tokens to the effort level you selected, not to the answer you expect.


Benchmark Results

As reported by DeepSeek, evaluated at the max reasoning effort level with temperature = 1.0, top_p = 0.95. The comparison columns are the checkpoint this release supersedes and the larger V4 Pro preview.

BenchmarkThis releaseV4 Flash (preview)V4 Pro (preview)
Terminal-Bench 2.182.761.872.1
NL2Repo54.239.438.5
Cybergym76.738.752.7
DeepSWE54.47.312.8
Toolathlon-Verified70.349.755.9
Agents' Last Exam25.215.816.5
AutomationBench Public25.110.812.8
DSBench-FullStack68.737.041.8
DSBench-Hard59.625.831.1

DSBench-FullStack and DSBench-Hard are DeepSeek's internal test sets for full-stack development and difficult coding-agent problems respectively. DeepSeek also publishes comparisons against leading proprietary models, which are not reproduced here.

The DeepSWE row is worth reading twice: 7.3 to 54.4 on the same architecture at the same size. Long-horizon software engineering is where this release changed, and it is where the model should be pointed.


Best Practices

  • Set reasoning_effort deliberately, per request. It is the highest-impact parameter on this model, and no single value is right for every path in an application.
  • Use max for agent work. The published agentic results describe that level; running an agent at low is not a cheaper version of the same behaviour.
  • Set top_p to 0.95 in agentic scenarios, 1.0 elsewhere. This is a documented split, not a preference.
  • Budget output tokens generously at high and max. A truncated reasoning model returns nothing useful.
  • Read reasoning_content as a separate field. Do not merge it into content, and null-check it — other models on the platform leave it empty.
  • Return tool errors as data. This checkpoint was trained to recover from failed actions, so a described failure is more useful than a raised exception.
  • Bound every agent loop with an iteration ceiling and a scoped token.
  • Use the context window instead of building retrieval where the corpus fits.

Limitations

  • Text only. No image, audio, or document input.
  • low effort is a different capability tier, not merely a faster one. Treat the levels as distinct configurations rather than a speed dial.
  • Reasoning traces are not conclusions. Content in reasoning_content may be unpolished or contradict the final answer.
  • Agentic gains do not imply knowledge gains. This release rebuilt long-horizon action; factual recall is a separate axis and is not what changed.
  • Not a safety layer. Apply your own moderation and validation before acting on model output in a production system.