ModelsDeepSeekDeepSeek-V4.1-Flash
providerdeepseek-ai /

DeepSeek-V4.1-Flash

70 DZD in 210 DZD out 2.4 DZD cached/ 1M tokens
Service tier pricing, in DZD per 1M tokens
TierInputOutputCached input
PriorityLearn more
1083243.24
40.32120.961.224
Prices in DZD per 1M tokens

DeepSeek V4.1 Flash is a multimodal Mixture-of-Experts model built around one goal: making the memory cost of long context collapse. It carries 552 billion backbone parameters but activates only 8 billion per token while reading your input and 16 billion while writing its answer — an asymmetry made possible by a causal encoder-decoder design where the decoder's key-value cache is projected from the encoder's final states rather than rebuilt layer by layer. The result is 890 bytes of cache per token, roughly a quarter of the previous generation and a fraction of a percent of where the series began. Reasoning effort is a continuous integer from 1 to 100 rather than a handful of preset levels, so cost and accuracy can be tuned rather than chosen from a menu.

Publicfp8JSONStreaming
DeepSeek-V4.1-Flash
Capabilities
ToolsVisionReasoning (optional)Structured output
ArchitectureMultimodal MoE
Context Window1M

Use DeepSeek-V4.1-Flash in VS Code, Cursor and Antigravity

DEVUP Code, the DEVUP AI extension, is free to install. Requests are paid from your DEVUP balance.

Explore DEVUP Code

DeepSeek V4.1 Flash

A multimodal Mixture-of-Experts model with 552B backbone parameters and a one-million-token context window, built around a single engineering target: collapsing the memory cost of long context.


The Numbers That Define It

Backbone parameters552B
Activated during prefill8B per token
Activated during decode16B per token
Global KV cache890 bytes per token
Experts6 routed of 384, plus 1 shared
Context1,048,576 tokens
PrecisionFP8 weights, FP4 KV cache

Two of those deserve attention.

Activation is asymmetric. Most models activate the same parameters whether they are reading input or generating output. This one uses 8B while reading and 16B while writing. Reading is the expensive half of an agentic workload — long histories, tool output, retrieved documents — and that is the half this model made cheaper.

890 bytes per token is roughly a quarter of the previous generation and, per DeepSeek's own comparison, about 1/437 of the first model in the series. Long context stops being a memory problem and becomes a throughput one.


Reasoning Effort Is a Number, Not a Level

reasoning_effort takes an integer from 1 to 100.

Every other reasoning model works from a fixed vocabulary — three or four named levels, each a discrete jump. This one is continuous. The practical difference is that you can calibrate rather than choose.

JSON
{
  "model": "deepseek-ai/DeepSeek-V4.1-Flash",
  "messages": [{ "role": "user", "content": "..." }],
  "reasoning_effort": 35
}

That matters for a reason worth internalising: on other models, measurement has shown the lowest named level can be worse than no reasoning at all — enough deliberation to go wrong, not enough to arrive. A continuous scale lets you find where a workload actually flips to reliable, rather than guessing between two presets that bracket it.

All published benchmark results use reasoning_effort=100. Read every score below with that in mind — they describe the model at its most expensive setting.

A workable approach: start at 100 to establish a ceiling, then bisect downward until accuracy drops on your own evaluation set. The point where it holds is your production setting.


Architecture

Causal Encoder-Decoder

A 40-layer Transformer, structured as a 20-layer causal encoder followed by a 20-layer decoder.

The consequential part: the decoder's global KV cache is projected from the encoder's final hidden states rather than derived from each decoder layer's own hidden states. That single change is what allows 8B activated parameters during prefill on a 552B model.

Compressed Sparse Attention 2

Each attention layer is assigned one of three static modes — Full, Reindex, or Reuse — which share main KV and indexer keys across layers and reuse Top-K sparse-attention indices.

In the decoder, a Hierarchical Sparse Indexer restricts later indexing layers to a candidate pool built by the first Full-mode layer. This bounds deeper indexer cost independently of context length — the reason a million-token window does not degrade into an indexing problem.

Cache compression

TechniqueEffect
FP4 main KV cachingE2M1 format, one E4M3 scale per 16 channels
SWA Bounded ReplayReconstructs missing sliding-window KV states by replaying only the most recent tokens, avoiding SSD persistence — roughly 1/8 the persistent footprint of the previous generation

Other components

Single-Pass mHC — revised residual-stream mixing with a dedicated fused kernel.

Engram conditional memory — 196B parameters, held outside the backbone and accessed sparsely through token-based lookup. Capacity that does not cost activation.

DSpark speculative decoding — semi-autoregressive draft generation with confidence-scheduled verification, shipped in the checkpoint.

Vision

A vision encoder trained from scratch (2D-RoPE, 3×3 pixel-unshuffle downsampling) feeding a two-layer MLP projector. Visual and text embeddings are processed jointly from the start of language-model pre-training rather than aligned afterwards.

Training

Pre-trained from scratch on a 45T-token multimodal corpus. Sparse attention was trained at 64K sequence length, with context extended to 1M after 34T tokens.

Post-training follows a standard SFT → RL → on-policy-distillation pipeline with no algorithmic modifications. DeepSeek is explicit that the gains came from the data pipeline instead: large-scale automated synthesis of agent tasks and environments, with progressive scaling of data, tasks, and rollouts.


Capabilities

CapabilityValue
input_typestext, image
output_typestext
context_window1048576
reasoningContinuous integer, 1–100
streamingSupported
tool_callingSupported
structured_outputSupported
requires_promptYes — text prompt required, image optional

Recommended Generation Parameters

ParameterValue
temperature1.0
top_p0.95 or 1.0
max_tokens≥ 256K

The output budget recommendation is unusually large and should be taken seriously. At high reasoning effort the trace consumes output tokens, and truncating a reasoning model mid-trace returns an unfinished response rather than a shorter one.

Note that some serving interfaces default to lower temperature and top-p values than these. If you have not set them explicitly, you are probably not running the recommended configuration.


Evaluation Results

All figures at reasoning_effort=100, temperature=1.0, top_p=0.95.

Against the previous generation

BenchmarkV4.1 FlashV4 ProV4 Flash
Terminal-Bench 2.190.687.982.7
Terminal-Bench 3.030.011.87.6
Terminal-Bench 4.031.212.47.0
DeepSWE v1.174.262.754.4
CyberGym88.183.376.7
SEC-Bench Pro62.856.430.9
AutomationBench54.843.237.7
Agent's Last Exam31.825.725.2
NL2Repo-Bench64.061.554.2
Codeforces (rating)347133483289
HLE with tools63.960.051.5

It surpasses the previous flagship — a model with roughly three times its backbone and six times its activated parameters — across essentially every agentic benchmark.

The honest read

DeepSeek also publishes comparisons against frontier models from other developers, and the picture there is not uniform.

Where it leads the published comparison set: Terminal-Bench 2.1, DeepSWE v1.1, CyberGym, AutomationBench, Agent's Last Exam, HLE with tools, and Codeforces rating.

Where it trails clearly: raw knowledge and reasoning without tools. On HLE it scores 36.8 against a leading proprietary model's 56.3 — the widest gap in the table. It also trails on the harder Terminal-Bench 3.0 and 4.0 variants, on ProgramBench, and on exploitation benchmarks.

The pattern is consistent and worth stating plainly: this model executes better than it knows. Given tools and an environment, it is at or near the top. Asked to answer from what it learned, it is not. HLE moving from 36.8 without tools to 63.9 with them is the same fact stated twice.

Multimodal (base model)

BenchmarkScore
DocVQA95.6
RefCOCO (avg)86.0
CVBench77.9
MMMU-Pro56.5

The Harness Matters as Much as the Model

DeepSeek published something most vendors do not: the same model, the same benchmarks, across eight different agent scaffolds.

ScaffoldDeepSWE v1.1Terminal-Bench 2.1
mini-SWE74.2—
DSH Minimal72.690.6
DSH Standard70.585.8
DSH PTC67.685.8
Claude Code69.888.0
Pi66.286.1
Codex65.684.1
OpenCode65.585.0

A nine-point spread on DeepSWE and a six-point spread on Terminal-Bench, from the scaffold alone. Same model, same weights, same settings.

Two things follow.

Your harness is a first-class variable. The difference between the best and worst scaffold here is larger than the difference between many model generations. Before concluding that a model underperforms, check what is wrapping it.

More sophisticated is not better. The minimal harness outscored the standard and programmatic-tool-calling variants on both benchmarks. Complexity in a scaffold adds failure modes as readily as capability.


Using DeepSeek V4.1 Flash on DEVUP AI

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

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.1-Flash",
    "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": 50,
    "temperature": 1.0,
    "top_p": 0.95,
    "max_tokens": 32768
  }'

Calibrating reasoning effort — Python

The control this model gives you that others do not. Find where your workload flips to reliable rather than picking between presets.

PYTHON
import os
from openai import OpenAI

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


def solve(prompt: str, effort: int, max_tokens: int = 32768) -> tuple[str, int]:
    """Return the answer and the reasoning tokens consumed at a given effort level."""
    if not 1 <= effort <= 100:
        raise ValueError(f"reasoning_effort must be an integer from 1 to 100, got {effort!r}")

    response = client.chat.completions.create(
        model="deepseek-ai/DeepSeek-V4.1-Flash",
        messages=[{"role": "user", "content": prompt}],
        temperature=1.0,
        top_p=0.95,
        max_tokens=max_tokens,
        extra_body={"reasoning_effort": effort},
    )

    usage = response.usage
    return response.choices[0].message.content, usage.completion_tokens


# Sweep your own evaluation set to find the cheapest level that still holds.
for effort in (100, 75, 50, 25, 10):
    answer, tokens = solve(hard_prompt, effort)
    print(f"effort={effort:>3}  output_tokens={tokens:>6}  correct={check(answer)}")

Published results all use 100. Your production setting is the lowest value that still passes your own checks — and on a continuous scale, that value is findable rather than guessed.

Image input — Python

PYTHON
import base64

with open("invoice.png", "rb") as handle:
    encoded = base64.b64encode(handle.read()).decode("utf-8")

response = client.chat.completions.create(
    model="deepseek-ai/DeepSeek-V4.1-Flash",
    messages=[
        {
            "role": "user",
            "content": [
                {
                    "type": "image_url",
                    "image_url": {"url": f"data:image/png;base64,{encoded}"},
                },
                {
                    "type": "text",
                    "text": (
                        "Extract every line item as JSON with fields: description, quantity, "
                        "unit_price, line_total. Report the currency exactly as printed. "
                        "Use null for any illegible field — do not infer."
                    ),
                },
            ],
        }
    ],
    temperature=1.0,
    top_p=0.95,
    max_tokens=16384,
    extra_body={"reasoning_effort": 40},
)

print(response.choices[0].message.content)

Instructing the model to return null rather than infer is not optional in document work. An invented figure is undetectable downstream.

Long-context agent loop — Python

The workload the architecture was built for. Input is the cheap half here.

PYTHON
import json

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(40):  # bounded loop — never let an agent iterate without a ceiling
    response = client.chat.completions.create(
        model="deepseek-ai/DeepSeek-V4.1-Flash",
        messages=messages,
        tools=TOOLS,
        temperature=1.0,
        top_p=0.95,
        max_tokens=65536,
        extra_body={"reasoning_effort": 100},
    )

    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:  # describe the failure — do not crash the loop
                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.")

Growing conversation history is what this architecture made cheap. A long agent run accumulates input faster than output, and input is the 8B-activation half.

The iteration ceiling is the only bound you have — there is no per-request spending limit on this platform, so an unbounded loop runs against your full balance.

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.1-Flash",
  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 },
  ],
  temperature: 1.0,
  top_p: 0.95,
  max_tokens: 32768,
  reasoning_effort: 60,
});

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

Streaming

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

for chunk in stream:
    if not chunk.choices:
        if getattr(chunk, "usage", None):
            print(f"\n\nTokens — in: {chunk.usage.prompt_tokens}, out: {chunk.usage.completion_tokens}")
        continue

    delta = chunk.choices[0].delta
    if getattr(delta, "content", None):
        print(delta.content, end="", flush=True)

Watching output tokens across effort levels is how you calibrate. The reasoning trace and the answer share the same budget.


Prompt Encoding

This release ships no Jinja chat template. DeepSeek provides a self-contained Python reference implementation instead, with test cases covering multi-turn conversations, tool calling, thinking mode, numeric reasoning effort, mid-conversation system messages, and interleaved image content.

For production, a maintained Rust toolkit with Python bindings is also published. It converts Messages, Chat Completions, and Responses API requests into DeepSeek's conversation format, encodes them, and parses model output back — covering thinking, tool calls, images, and generation settings.

This matters only if you are serving the model yourself. Through a hosted API the encoding is handled for you.


Limitations

  • Knowledge trails execution. On tool-free reasoning benchmarks this model is well behind the leading proprietary models. Its strength appears when it has an environment to work in.
  • Published results all use maximum reasoning effort. Real deployments at lower settings will not reproduce them.
  • Text output only. Images in, text out. No image generation.
  • Harness-dependent results. A nine-point spread across scaffolds on the same benchmark is published by DeepSeek itself. Treat any single agentic figure as a measurement of a model-and-harness pair.
  • A very large output budget is recommended — at least 256K tokens. Undersizing it truncates reasoning rather than shortening answers.
  • No Jinja chat template for self-hosted deployments; a reference encoder must be used.
  • No per-request spending limit exists on this platform. Bound agent loops by iteration count and watch your balance.
  • Recently released, with correspondingly little independent verification.
  • Not a safety layer. Apply your own moderation and validation before acting on model output in a production system.