In our series comparing two of the most popular language models, Mixtral-8x7B and LLaMA2-70B, we previously explored usingOobabooga's web-based text generation UI to run these LLMs in the cloud. We covered important aspects such as choosing the right GPU instance, setting up the required environment, deploying a cloud VM, starting the web UI and running a pre-trained model.
With the fundamentals out of the way, we now move forward on learning about the use of batching for GPU utilisation. In this next part of the series, we'll explore strategies for maximising throughput and getting the absolute most out of your GPU infrastructure when running cutting-edge LLM batch inference.
Use Case: Summarising Educational Nature Video Transcripts
For this tutorial, we'll use a real-world and interesting use case i.e. generating summaries for educational video transcripts about nature from the popular YouTube playlist on TED-Ed. The playlist covers fascinating topics like why animals form swarms, the three different ways mammals give birth, and other curiosities about the natural world. While highly informative, the full video transcripts can be quite long. The goal is to leverage the capabilities of large language models like Mixtral-8x7B and LLaMA2-70B to automatically generate concise 100-word summaries that extract the key facts and takeaways from each video transcript.
This use case provides a great benchmark for evaluating the text generation capabilities of large language models, as well as optimising their inference performance on GPUs through techniques like GPU batching. By the end of this tutorial, we'll be able to rapidly generate summaries for all 100 video transcripts in our dataset in a highly optimised and parallelised way, showcasing the power of models like Mixtral-8x7B and LLaMA2-70B.
First, you'll need a Python environment configured with GPU acceleration, such as a cloud VM instance with one or more NVIDIA GPUs. For example, we use a beefy setup with 4 NVIDIA A100 80GB GPUs connected via PCIe for excellent latency and throughput, though you can use fewer GPUs as available. We'll work in Visual Studio Code with the GPU-powered VM instance remotely connected.
Getting Video Transcripts from YouTube
Our use case is to generate summaries for educational nature video transcripts from the popular TED-Ed YouTube channel. We scrape the video list and transcript data from the channel's website.
Using the “youtube-transcript-api” Python library, we can fetch the raw transcript text for any given YouTube video ID. This returns the transcript as a list of dictionaries, which we can flatten into the full transcript text string. We'll export these 100 transcripts using Pandas into a CSV file for easy processing in the next step.
Performing LLM Inference to Obtain Summaries
We'll utilise two powerful open-source language models to generate summaries from the video transcripts: the 70 billion parametres LLaMA model from Meta and Mixtral-8x7 from Mistral.AI. We load these large models using the HuggingFace Transformers library. The key is to share the model across multiple GPUs using the” device_map” parameter. We also enable the “FlashAttention2” kernel for efficient GPU utilisation.
With the model loaded, we can now generate summaries for each video transcript by building a prompt combining a template and the transcript text:
“The following is a transcript from an educational video on nature. Summarise the transcript, extracting the main takeaways. Focus on curious facts. Use a friendly tone and write in simple English.”
This prompts the model to generate a summary extracting the key takeaways and interesting facts from the given video transcript, in a friendly tone aimed at educational content.
Batching Requests for Better GPU Utilisation
While this approach works for generating individual summaries, if we monitor LLM GPU utilisation during the inference, we see it is surprisingly low. To better optimise our hardware, we can take advantage of batch size and GPU memory - grouping multiple inference requests into one larger forward pass through the model. This allows us to feed more work to the GPU at once for better parallelisation.
We modify the code to make a batch of prompts as input, packing their tokens into a single inference request. So by increasing the batch size from 1 (no batching) to 2, 4, 8, 16, 32 and higher, we are feeding more parallel work to the GPU which can dramatically improve utilisation. However, larger batches also increase memory requirements, so there is a tradeoff in finding the optimal batch size for the available GPU memory.
Evaluating the Batching Performance
To systematically analyse the performance impact of batching, we run a series of experiments generating video summaries with different batch sizes from 1 to 64.
For each experiment, we record the overall tokens/second throughput achieved and plot the results for both the Mixtral-8x7B and Llama 2-70B models:
As expected, we see that larger batch sizes yield significantly higher throughput, as we are better able to utilise the GPU's parallel computing capabilities.
Interestingly, for smaller batch sizes under 16, the smaller Mixtral model is faster than LLaMA. But as we increase the batch size to 32 and 64, the advantage flips and the larger LLaMa model starts to outperform, achieving over 1500 tokens/sec at the maximum 64 batch size.
We can visualise this crossover more clearly by plotting the speedup factor over ideal inference batching:
The green llama line stays closer to the ideal linear 32x speedup at batch size 32, compared to Mixtral which sees more diminishing returns from batching on the larger model.
This indicates that while all models benefit from batching to experience GPU parallelism, different models may scale differently.
Limitations of Batching
While extremely effective, batching does have its limits. If we try to batch too many requests together, we run into out-of-memory issues even on the NVIDIA A100 80GB GPUs used in this tutorial. For the 100 video transcripts, both models ran out of memory when trying to batch all of them together into one forward pass, despite the high GPU memory capacity.
So there is a tradeoff between batch size and memory usage that needs to be balanced. We can't pack infinite requests together, but we can always work towards finding an optimal batch size while staying within the available memory
Conclusion
In this tutorial, we learned about improving the inference performance of large language models like Mixtral-8x7B and LLaMA2-70B when running on GPU hardware. The key technique was batching - grouping multiple inference requests into one larger forward pass through the model.
Even simple batching strategies enabled massive speedups in throughput and much better utilisation of the GPU's parallel computing capabilities. While pushing too large of batch sizes can cause out-of-memory issues, a reasonable batch size like 32 yielded around 6x speedup over naive single-request inference.
However, focusing solely on throughput metrics is not enough. In the next part, we'll evaluate the quality of the summarisation outputs in this Mixtral-8x7B and LLaMA2-70B series!
Watch the full tutorial below
Subscribe to Hyperstack!
Enter your email to get updates to your inbox every week
Claude Fable 5.2 Tested: Effort, Cost and How Mythos 5.2 Differs
Anthropic has released Claude Fable 5.2 and Claude Mythos ...
Anthropic has released Claude Fable 5.2 and Claude Mythos 5.2, one underlying model offered two ways. Fable 5.2 is available to every customer, with cyber and biology safeguards, and Mythos 5.2 is for organisations Anthropic approves for security or life-sciences work.
Launch benchmarks show which model scores highest, but do not make it clear which Claude model is worth paying for on your workload.
We gave Fable 5.2 small tasks with built-in traps (a GPU job schedule, a SQL query over a messy database and a dense line chart), ran the schedule five times at each effort level and measured accuracy, cost and speed. We tested Fable 5.2 on the Claude API against Fable 5.1, Opus 5.5, Sonnet 5.5 and Haiku 5.5.
Tests ran in November 2026. We have included Anthropic’s own scores, how to choose an effort level and where cheaper Claude models are enough. We also cover speed, fast mode and the code changes that break older integrations.
One Model, Two Ways In
Who can use which model
Prices fall from $10 and $50 on Fable 5.1, and Anthropic reports output up to 30% faster; its developer notes list the API changes.
Claude Fable 5.2 Benchmarks
In Anthropic’s scores, the largest gains over Fable 5.1 come in robotics, chart reading and knowledge work. The biggest jump is in simulated robotics, where RoboDojo Sim rises from 27.6% to 64.9%. Chart reading (Chartography) goes from 44.8% to 73.4%, and the Remote Labor Index from 17.9% to 41.3%. In the chart’s Coding and agents view, the biggest rise is Terminal-Bench-Science, from 52.6% to 74.6%. Fable 5.2 is also ahead of Opus 5.5 on all ten benchmarks shown:
Fable 5.2 vs Fable 5.1 vs Opus 5.5
Scores reported by Anthropic.
What Fable 5.2 and Mythos 5.2 Built
Anthropic’s launch videos show the range:
Fable 5.2 coordinated over 1,000 subagents for eight days to build an operating system that boots on a laptop.
Thinking is always on, so effort (an API setting from low to max that controls how much the model reasons) sets depth, time and cost. To test it, we set a trap: 12 jobs to schedule on three GPU nodes, where job C needs all three nodes at once. Starting whatever is ready whenever nodes are free keeps job C waiting until hour 12, and the plan runs to hour 30. The best plan finishes at hour 21 by deliberately leaving nodes idle so job C can start at hour 2.
Over five runs per effort level, xHigh and max found the 21-hour schedule every time, and every miss was 22 hours. Low and high found it in four runs out of five, but medium found it only once, so more effort did not always mean a better answer. With five runs per level, treat that dip as a warning rather than a rule.
Five runs per effort level
Runs that found the 21-hour schedule, out of five per level; the other views show the average cost and output tokens per run.
Cost rises with every level, from $0.068 a run at Low to $0.176 at max, 81% more than xHigh for the same result. XHigh is the cheapest level that never missed; low suits jobs where you can check the answer and retry.
Claude Fable 5.2 vs Cheaper Claude Models
On short, well-defined work, cheaper models kept pace: Opus 5.5, Sonnet 5.5 and Haiku 5.5 solved the trap in all three runs at high effort, and all five models found the exact revenue in a trap-laden SQL database. Haiku 5.5 did both at about 1/26 to 1/80 of Fable 5.2’s cost.
Same tasks, five Claude models
One SQL agent run per model; the other views show its time and the average cost of a scheduling run.
We also asked Fable 5.2, Fable 5.1 and Opus 5.5 to read every value from a dense line chart with 48 closely spaced points, in one run each. Fable 5.2 read all 48 exactly, against 47 for Opus 5.5 and 5 for Fable 5.1, though none of Fable 5.1’s readings was more than 3 GPU hours out.
Claude Fable 5.2 Speed and Fast Mode
On one prompt at low effort, Fable 5.2 averaged 78 output tokens per second against 57 for Fable 5.1, 36% faster, above Anthropic’s figure of up to 30%. Opus 5.5 generated tokens faster still, at 86 per second, and cost about half as much per answer: $0.026 against $0.052. Fast mode takes one parameter and reaches 220 tokens per second, finishing in about a third of the time (5.4 seconds against 16.5 in standard mode) for 1.8 times the cost per answer:
speed.pyPYTHON
extra = {"speed": "fast"} if speed == "fast"else {} # fast mode needs no beta header on Claude Fable 5.2# ...with client.messages.stream(
model=model,
max_tokens=4000,
output_config={"effort": "low"},
messages=[{"role": "user", "content": PROMPT}],
**extra,
) as stream:
Output: run 1OUTPUT
claude-fable-5-2 standard 1119 tokens first text 1.72s total 14.74s 75.9 tokens/s $0.0452
claude-fable-5-2 fast 1191 tokens first text 0.84s total 5.39s 220.9 tokens/s $0.0962
claude-fable-5-1 standard 1127 tokens first text 0.62s total 19.41s 58.1 tokens/s $0.0569
claude-opus-5-5 standard 1301 tokens first text 1.56s total 15.11s 86.1 tokens/s $0.0262
Three runs per setup
Claude Fable 5.2 API: Getting Started
The Models API shows which models a key can call:
models_check.pyPYTHON
import anthropic
client = anthropic.Anthropic() # reads ANTHROPIC_API_KEY
available = {m.id: m for m in client.models.list()}
for model_id in ["claude-fable-5-2", "claude-mythos-5-2", "claude-fable-5-1", "claude-opus-5-5"]:
print(f"{model_id:20} {'available' if model_id in available else 'not available to this key'}")
fable = client.models.retrieve("claude-fable-5-2")
caps = fable.capabilities
print("\n" + fable.display_name)
print("context window :", f"{fable.max_input_tokens:,} tokens")
print("max output :", f"{fable.max_tokens:,} tokens")
# ...print("thinking types :", [t for t, v in caps.thinking.types.to_dict().items() if v["supported"]])
print("effort levels :", [e for e in ("low", "medium", "high", "xhigh", "max") ifgetattr(caps.effort, e).supported])
OutputOUTPUT
claude-fable-5-2 available
claude-mythos-5-2 not available to this key
claude-fable-5-1 available
claude-opus-5-5 available
Claude Fable 5.2
context window : 1,000,000 tokens
max output : 128,000 tokens
thinking types : ['adaptive']
effort levels : ['low', 'medium', 'high', 'xhigh', 'max']
Can be declined as reasoning_extraction, which has no fallback; set display to "summarized" instead.
Edited history
Fails the prefix check on every account: keep system and tools fixed, and only append.
stop_reason: refusal
Turn on server-side fallback to rerun cyber and biology refusals on Claude Opus 4.8 or Opus 5.
safeguards.pyPYTHON
response = client.beta.messages.create(
model="claude-fable-5-2",
max_tokens=8000,
output_config={"effort": effort},
# ...
fallbacks="default", # retry a declined request on the model Anthropic recommends for its category
betas=["server-side-fallback-2026-07-01"],
messages=[{"role": "user", "content": prompt}],
)
# ...if response.stop_reason == "refusal": # check this before reading contentprint(f"declined: category={response.stop_details.category} | {response.stop_details.explanation}")
Running the Capsid Folding Models on Hyperstack
Anthropic’s gene-therapy capsid example (the Mythos capsid clip) shows how the work splits. Mythos 5.2 wrote the method, and for the AAV2 capsid a single NVIDIA H200 GPU ran the open protein-folding models OpenFold3-preview2 and ESMFold2:
Run folding pipelines and open models on NVIDIA H200 and NVIDIA H100 GPUs.
NVIDIA H200 SXMAI StudioPer-minute billing
Get started with Hyperstack in minutes.
FAQs
How do Claude Fable 5.2 and Claude Mythos 5.2 differ?
One model, one price: Fable 5.2 is open to everyone, with safeguards, and direct access to Mythos 5.2 goes to approved organisations.
How much does Claude Fable 5.2 cost?
$8 per million input tokens and $40 per million output tokens; batch requests cost half, and fast mode $16 and $80.
How do I access Claude Mythos 5.2?
Apply to Anthropic’s Cyber or Life Sciences Verification Program; approved organisations use the model ID claude-mythos-5-2. Claude Enterprise customers can also use it inside Claude Security.
Is Claude Fable 5.2 better than Claude Opus 5.5?
Anthropic’s scores put it ahead on all ten charted benchmarks; in our tests, Opus 5.5 matched it on scheduling and SQL for less and generated output faster.
Can Qwen 4 Compete With Claude Opus 5.5? We Put It to the Test
New models launch with their makers’ own benchmark scores, ...
New models launch with their makers’ own benchmark scores, but public benchmark questions can leak into training data, so those scores may not show how a model handles work it has not seen. That is why we test new models on the same sealed tasks, built on Kestrelmoor Freight, a synthetic company.
Our latest blog puts Alibaba’s Qwen 4 through those tests, covering the results first, then what they mean for your workloads, then the code to reproduce the test yourself.
How the Qwen 4 Benchmark Works
We built Kestrelmoor Freight for this test: a fictional logistics company whose invoices, dashboards, app screens, screen recordings and case files are all generated by code. The generator knows every answer, so each task is graded exactly, and none of it can appear in a model’s training data.
One synthetic company, nine jobs, three stages
The map put Qwen 4, Claude Opus 5.5, Kimi K3.1 Pro and three earlier Qwens through all nine jobs. The duel then reran the four jobs where Qwen 4 looked strongest (dense screens, paperwork, hard paperwork and writing to 16 to 20 rules) on 400 new tasks, each sealed with a cryptographic hash before any model saw it. A scale run then had Qwen 4 read 1,250 invoices and receipts.
Qwen 4 vs Claude Opus 5.5 on Sealed Tests
On all four sealed jobs, Opus led Qwen 4 by 0.2 to 0.8 points, and only the paperwork gap holds up statistically. The largest generational step is writing to 16 to 20 rules: 99.6 against 87.3 for Qwen3.8 Max, which ran out of tokens on 18 of 100 tasks.
Claude Fable 5.1, which joined only the duel, led Qwen 4 on all four jobs, by 0.3 to 1.1 points. The open-weight Kimi K3.1 Pro scored 0.2 to 0.8 points above Qwen 4 on three jobs, within 0.1 points of Opus on each, and Qwen 4 led it only on hard paperwork, by 0.5 points. The earlier Qwens trail Qwen 4: Qwen3.8 Max by 0.5 to 12.3 points, and Qwen3.8 Flash-Next and Omni-Flash by up to 31.2 and 34.9 points, on 16 to 20 rules.
Qwen 4 minus each rival, in points
Paired by task; left of zero, the rival led.
Where Qwen 4 Stands Out
Five tasks from the test show the range:
Invoice
20 rules
Pixel click
8 languages
Video
A photographed Russian invoice with handwritten corrections: every header field, quantity, price and amount matched, and across 1,250 documents it read 99.8% of fields correctly.
A customs notice under 20 rules at once: Qwen 4 passed all 20, while every earlier Qwen ran out of tokens.
Click an 18 by 17 pixel icon on a dense console: Qwen 4 hit it, while earlier Qwens missed by 41 to 161 pixels.
The same stock problem in eight languages: Qwen 4 answered 2224 each time, and all 64 tasks of the job correctly.
One 10-minute recording with three one-second errors, sent as an MP4: Qwen 4 answered all four questions. Given 96 still frames instead, it answered half.
Where Claude Opus 5.5 Keeps an Edge
Opus leads on two jobs: dashboard threshold times, 100% against 71% in the first round, and long archives, 99.0 against 84.4. Qwen 4’s dashboard misses are chart-reading errors: given the same data as text, it answered every question. Its archive misses all came at 128K tokens or more.
Where Opus leads
Opus also wrote about a third of Qwen 4’s output tokens, at a lower reasoning-effort setting: high against xhigh.
Qwen 4 Speed and Token Efficiency
On the same 912 tasks, Qwen 4 wrote 20% fewer output tokens than Qwen3.8 Max and answered in 40% less time. It also used fewer input tokens than Claude on a screenshot, 1,262 against 1,728, and fewer on a 12-second clip sent as video than as frames, 7,823 against 15,453:
Where Qwen 4 saves tokens and time
Sending Images and Video to Qwen 4
One converter builds every Qwen 4 request as an OpenAI-compatible chat completion, with images and video inline as base64 data URLs:
families/base.pyPYTHON
MEDIA_TYPES = {".png": "image/png", ".jpg": "image/jpeg", ".jpeg": "image/jpeg", ".mp4": "video/mp4"}
# ...def _b64(rel: str) -> tuple[str, str]:
path = EVAL / rel
return MEDIA_TYPES[path.suffix.lower()], base64.b64encode(path.read_bytes()).decode()
def to_openai(prompt: dict) -> list:
parts = []
for rel in prompt.get("images") or []:
mt, data = _b64(rel)
parts.append({"type": "image_url", "image_url": {"url": f"data:{mt};base64,{data}"}})
if prompt.get("video"):
mt, data = _b64(prompt["video"])
parts.append({"type": "video_url", "video_url": {"url": f"data:{mt};base64,{data}"}})
parts.append({"type": "text", "text": prompt["text"]})
msgs = [{"role": "system", "content": prompt["system"]}] if prompt.get("system") else []
msgs.append({"role": "user", "content": parts iflen(parts) > 1else prompt["text"]})
return msgs
The body streams the reply, reports usage and caps output, reasoning included; the map and duel ran Qwen 4 at effort xhigh:
clients/qwen.pyPYTHON
body = {"model": self.model, "messages": messages, "stream": True,
"stream_options": {"include_usage": True}}
if effort isnotNone:
body["reasoning_effort"] = effort
if max_completion_tokens isnotNone:
body["max_completion_tokens"] = max_completion_tokens
The photographed Russian invoice from the showcase cost 2,147 image tokens, and Qwen 4 reasoned for 7,613 tokens before a 2,090-token answer:
Qwen 4 is not available on Hyperstack, as we tested it through early API access. To get our next model test as soon as it is published, subscribe below. You can start building with the Qwen family now, as two models from this test run on Hyperstack:
Its model card calls it an experimental preview of the Qwen4 architecture; it runs on Hyperstack AI Studio with image input. In our sealed jobs, it scored 15.5 points below Qwen 4 on dense screens and 31.2 below on 16 to 20 rules.
Deploy DeepSeek-V4.1-Flash on GPU Cloud for 1M-Context Inference
DeepSeek-V4.1-Flash-1017 is an updated release of ...
DeepSeek-V4.1-Flash-1017 is an updated release of DeepSeek-V4.1-Flash, a multimodal mixture-of-experts model with 552 billion backbone parameters that reads text and images, writes text and holds up to 1,048,576 tokens of context. Only 8 billion parameters are active for each prompt token and 16 billion for each generated token. The whole checkpoint is 510 GB, and once its Engram memory moves to host RAM, a DeepSeek-V4.1-Flash deployment fits on one node of eight 80 GB GPUs.
This guide deploys it on a single Hyperstack virtual machine with 8x NVIDIA H100-80G-PCIe-NVLink GPUs, using vLLM 0.31.0 and the NVIDIA H100 configuration from the vLLM recipe for DeepSeek-V4.1-Flash: tensor parallel 8, the Engram tables in pinned host memory, a 4,096-token batch budget and the full one-million-token context. The result is a private, OpenAI-compatible endpoint with thinking, a reasoning effort setting from 1 to 100, tool calling and image input, ready for an agent harness such as Claude Code.
Most of what lets the model fit on one machine comes from its design rather than from tuning. DeepSeek puts its global KV cache at 890 bytes per token, about a quarter of DeepSeek-V4-Flash's, and 196 billion of its parameters are Engram lookup tables that are read rather than computed, so they can sit in host memory. If you have followed our DeepSeek-V4-Pro multi-node Kubernetes guide, this is the opposite shape: one virtual machine, no cluster and no orchestration layer.
Inside DeepSeek-V4.1-Flash: 552B Parameters, 8B Active in Prefill
DeepSeek titles the release Pushing the Limits of KV Cache Compression, and almost every component serves that aim.
DeepSeek-V4.1-Flash-1017 at a glance
Six numbers that shape the deployment.
BACKBONE
552B parameters
Mixture of experts: 1 shared and 384 routed experts, 6 routed active per token
ACTIVE PER TOKEN
8B prefill, 16B decode
A causal encoder-decoder lets most prompt tokens skip the decoder
CONTEXT
1,048,576 tokens
YaRN scaling, factor 16, from a 65,536-token original window
GLOBAL KV CACHE
890 bytes per token
About a quarter of DeepSeek-V4-Flash's, stored in FP4
The 1017 Weights: Same Architecture, Stronger Scores
DeepSeek describes DeepSeek-V4.1-Flash-1017 as a minor update to the launch release. The vLLM recipe records that its config.json, tokenizer files and prompt encoding match the launch repository byte for byte, and that the index holds the same 96,085 tensors, so only the weights change and one command serves either checkpoint.
The gains are broad. Terminal-Bench 4.0 rises from 31.2 to 42.3 and HLE without tools from 36.8 to 42.6, and DeepSeek reports shorter outputs and task execution times.
From the launch weights to 1017
Every benchmark on the 1017 model card moves up. Rows are sorted by the size of the gain; the hollow dot is the launch checkpoint, the filled dot the 1017 weights.
Launch weights1017 weights
Source: the DeepSeek-V4.1-Flash-1017 model card. Terminal-Bench 4.0 uses the Claude Code harness and DeepSWE v1.1 the Mini-SWE-V2 harness, as the card states.
A Causal Encoder-Decoder That Nearly Halves Prefill
The 40 transformer layers are split into a 20-layer causal encoder and a 20-layer decoder. In a decoder-only model, every layer derives its keys and values from its own hidden states, so every prompt token must run through all 40 layers. Here the decoder global KV cache is projected from the final encoder hidden state instead, which lets most prompt tokens stop at the end of the encoder.
According to the technical report, this nearly halves prefill computation, and it is where the 8 billion and 16 billion figures come from: a prompt token runs the encoder, a generated token runs both halves. DeepSeek designed the split for agentic work, which the report describes as increasingly input-heavy, with frequent tool calls generating long prefills.
How far a token travels
Most prompt tokens stop at the encoder. Generated tokens run all 40 layers.
Drawn from section 2.2 of the technical report. The decoder still keeps a 128-token sliding window, so the last 128 prompt tokens also pass through it, a step DeepSeek calls Decoder SWA Bounded Replay.
Compressed Sparse Attention 2: Forty Layers, Four Global Caches
From layer 2 onwards, every layer combines a 128-token sliding window with a sparse view of the global context further back; layers 0 and 1 use the sliding window alone. Compressed Sparse Attention 2, or CSA2, decides where that global context comes from by giving each of those 38 layers one of three static modes:
Full layers compute their own global KV, score it with a lightweight indexer and keep the top 512 entries for each query.
Reindex layers reuse the global KV of the latest Full layer, but score it with their own indexer query and pick a fresh top 512.
Reuse layers take both the KV and the top 512 selection from an earlier layer and run attention directly.
Only four of the 40 layers compute a global cache at all: layers 2, 8, 14 and 20. The encoder stores one global entry for every two tokens, while the decoder keeps one per token. In the decoder, layer 20 also builds a candidate pool of 2,048 blocks of eight positions, and the four Reindex layers search only those 16,384 candidates, so their cost per query stays constant however long the context grows.
Forty layers, four global caches
Each square is one layer, coloured by how it obtains its global context.
Layer modes from section 4.2.1 of the technical report and the kv_source_layer_ids, index_source_layer_ids and compress_ratios fields in config.json.
890 Bytes of Global KV per Token
The saving has two sources. One is sharing caches across layers; the other is precision: DeepSeek trains the main KV cache to be stored in FP4, as E2M1 values with one E4M3 scale per 16 channels, while the sliding-window cache stays in FP8. Together they put the global KV footprint at 890 bytes per token, 3.9 times smaller than DeepSeek-V4-Flash, the model in our DeepSeek-V4 deployment guide, and 437 times smaller than DeepSeek-V1.
Global KV cache per token across DeepSeek generations
Bytes per token on a logarithmic scale. Each generation cuts the footprint by a large factor.
Plus a fixed 128-token sliding window per layer. The vLLM recipe notes that on this model the weights and the batch budget, not the cache, set the capacity limit.
For a broader view of where KV cache memory goes and how serving engines manage it, our guide to optimising the KV cache covers the techniques this design builds on.
Engram: 196B Parameters That Are Looked Up, Not Computed
Engram is the module that makes the memory plan work. At layers 1 and 14, the last two, three and four tokens at each position are hashed into two tables of roughly 384 million rows each, and the retrieved rows are gated into the residual stream. A mixture of experts adds capacity through conditional computation; Engram adds it through conditional memory, which the vLLM documentation describes as parameters that are never computed over, only looked up. The two tables hold 196.6 billion parameters, 183.1 GiB in FP8 or about 189 GiB with their block scales, more than a third of the checkpoint.
Because the lookup indices depend only on the input tokens, they are known before the forward pass reaches the layer. vLLM uses that to keep the tables in pinned host memory and read them over unified virtual addressing (UVA), prefetching on a side CUDA stream so the transfer overlaps the computation of the earlier layers. The GPU memory this frees goes to the KV cache.
Where an Engram lookup runs
Hashing and gating happen on the GPU. The tables stay in host memory, and only the rows a token needs cross the PCIe link.
Mechanism from the Engram page of the vLLM documentation and section 2.4.2 of the technical report. Table sizes from config.json: 384,006,168 and 384,016,682 rows.
DSpark: Five Draft Tokens per Round
DeepSeek-V4.1-Flash drops the multi-token prediction module of earlier DeepSeek models in favour of DSpark, a speculative decoding module trained after pre-training. Three transformer blocks, each with 128 routed experts and 3 active, attend over a 128-token window and compute draft logits for five positions in one pass. A Markov head models the dependencies between those drafts, and a confidence head predicts how likely each position is to be accepted.
The recipe keeps DSpark opt-in, behind one speculative decoding flag, and counts the drafter's experts, roughly 14B parameters, as an addition to the load when it is on. On NVIDIA GPUs, the same flag turns on adaptive verification, which vLLM leaves off by default. It uses the confidence head's predictions to decide how many drafts to check for each request, within a compute budget profiled at start-up.
How DSpark drafts
One pass drafts five tokens. The chance that a draft survives falls with each position, because every draft before it must be accepted too, and the scheduler chooses where to stop checking.
From section 2.4.3 of the technical report, the speculative decoding notes in the vLLM recipe and vLLM's adaptive verification page.
What the Published Scores Say
On the 1017 model card, DeepSeek-V4.1-Flash-1017 leads the other open models listed on every benchmark except HLE without tools, where Kimi K3 is 0.9 points ahead; our Kimi K3 deployment guide serves that model on 32 NVIDIA H100 GPUs. Against the closed models the picture is mixed: Opus 5 leads on six benchmarks and GPT-5.6 Sol on ZeroBench, while DeepSeek-V4.1-Flash-1017 leads on DeepSWE v1.1, Automation-Bench, Agents' Last Exam and Apex Bench.
DeepSeek-V4.1-Flash-1017 against open and closed models
Shading ranks each row: the deepest purple marks the leader on that benchmark.
Benchmark
DeepSeek 1017
Kimi K3
GLM-5.3
GPT-5.6 Sol
Opus 5
HLE w/o tools †
42.6
43.5
42.0
44.5
56.3
Terminal-Bench 4.0
42.3
12.6
37.9
39.9
51.8
DeepSWE v1.1
77.0
67.5
66.9
73.0
74.0
ProgramBench
29.1
17.5
19.0
23.0
37.0
NL2Repo-Bench
68.2
58.0
58.0
56.8
75.3
Automation-Bench
60.5
46.7
48.8
45.8
50.3
Agents' Last Exam
35.4
27.6
28.5
26.7
28.6
Apex Bench v1.1
72.1
47.8
56.6
54.3
65.8
Chartography, tools
83.0
68.1
n/a
79.9
84.0
BabyVision, tools
92.5
85.7
n/a
88.9
94.1
ZeroBench, tools
51.0
41.0
n/a
53.0
52.0
Source: the DeepSeek-V4.1-Flash-1017 model card. n/a marks a score the card does not publish. † The GLM-5.3 HLE figure is for the text-only subset.
The DeepSeek-V4.1-Flash Deployment Architecture on 8 NVIDIA H100 GPUs
The checkpoint is 510.3 GB across 48 safetensors shards, and each NVIDIA H100 PCIe card reports 81,559 MiB of memory. The vLLM recipe calls eight 80 GB cards the smallest NVIDIA node that serves this checkpoint, and only with a set of memory settings. Those settings define the DeepSeek-V4.1-Flash deployment architecture, and the largest of them moves the Engram tables off the GPUs.
What is inside the 1017 checkpoint
Five components, and where each one lives once the server is running.
Component
Parameters
Stored
Lives in
Routed and DSpark experts, MXFP4
557.2B
259.5 GiB
GPU memory, across the 8 cards
Engram tables, FP8
196.6B
183.1 GiB
Pinned host memory
Attention, dense projections and routers, FP8
7.4B
6.9 GiB
GPU memory, across the 8 cards
Embedding and LM head in BF16, norms in FP32
2.0B
3.9 GiB
GPU memory, across the 8 cards
UE8M0 block scales
23.6B
21.9 GiB
Beside the weights they scale
Total
475.3 GiB
510.3 GB on disk
Component sizes from the memory table in the vLLM recipe. DeepSeek's 552B backbone figure covers the routed experts, attention and embeddings; the Engram tables, the DSpark drafter and the scales sit outside it. The recipe counts the drafter's experts, roughly 14B parameters of the first row, as an addition to the load when DSpark is on.
Host memory takes the two Engram tables together with their block scales, which the recipe puts at 189 GiB. Tensor parallelism splits the remaining weights across the eight cards, with small parts such as the vision encoder and the norms copied to every card instead, and the recipe's NVIDIA H100 notes put the result at about 36 GiB of resident weights per card. vLLM manages 92 per cent of each card:
vLLM's share of each card
81,559 MiB × 0.92 ≈ 73.3 GiB
About 36 GiB of it holds resident weights and 8 GiB the indexer buffer, leaving the rest for the KV cache, activations and CUDA graphs.
Where the checkpoint lives on one node
Engram goes to host memory. The rest is split across the eight cards, with room left on every card for the KV cache.
Host memory1,440 GB
Engram tables and their scales, about 189 GiB, pinnedFree for the system and the loader
Each NVIDIA H100 PCIe x 8 cards81,559 MiB, about 79.6 GiB
Weights
KV cache and more
Resident weights, about 36 GiBIndexer buffer, 8 GiBKV cache, activations and CUDA graphs, about 29 GiBOutside the 0.92 budget, about 6.4 GiB
Ephemeral disk6,500 GB
Free
Checkpoint, 510.3 GB in 48 shardsFree
Shares calculated from the recipe's component sizes, the 81,559 MiB each card reports, and the 1,440 GB of RAM and 6,500 GB of ephemeral disk the flavour reference lists for this machine.
Why the Batch Budget Is 4,096 Tokens
The sparse-attention indexer allocates a logits buffer at start-up, sized by the number of tokens batched in one scheduler step and by the maximum context length, at two bytes per entry. At the full 1,048,576-token context, a budget of 8,192 tokens would make that buffer 16 GiB on every card. The recipe's NVIDIA H100 profile caps the budget at 4,096 tokens instead, which halves the buffer and keeps the whole context available for long agentic traces.
vLLM's chunked prefill still takes long prompts, in steps of up to 4,096 tokens.
The profile adds two environment variables that keep the KV pool from fragmenting around that buffer: VLLM_USE_V2_MODEL_RUNNER=1 and PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True.
Inside the Node: Four NVLink Pairs Over PCIe
The 8x NVIDIA H100-80G-PCIe-NVLink flavour bridges each card to one neighbour with NVLink, which Hyperstack rates at 600 GB/s bidirectional on its NVIDIA H100 PCIe page, and reaches the other six cards over PCIe Gen5 through the host bridge. Tensor parallel 8 spans all eight cards, so every all-reduce uses both kinds of link. Our guide to distributed inference with vLLM explains how tensor parallelism splits each layer across GPUs.
Eight NVIDIA H100 PCIe cards, four NVLink pairs
Each pair shares an NVLink bridge; pairs reach one another through the PCIe host bridge.
The topology nvidia-smi topo -m reports on this flavour. Step 4 prints the same matrix.
The Launch Settings, Flag by Flag
Every engine flag below comes from the command the vLLM recipe generates for NVIDIA H100, apart from the served name and the API key, which turn the server into a private endpoint.
Engine flags
What each flag does on this machine.
--tensor-parallel-size 8
Shards every layer across the eight cards, the smallest NVIDIA H100 configuration the recipe serves.
--engram-config '{"cpu_offload":true}'
Keeps both Engram tables in pinned host memory, read over UVA. It is vLLM's default, set explicitly as the recipe does.
--max-num-batched-tokens 4096
Sizes the indexer buffer at 8 GiB per card with the full context kept.
--gpu-memory-utilization 0.92
The share of each card vLLM manages for weights, buffers and KV cache.
--tokenizer-mode deepseek_v41
The repository ships no Jinja chat template; this mode renders prompts in DeepSeek's V4.1 format in Python.
--reasoning-parser deepseek_v41
Moves the think block into the response's reasoning field.
--tool-call-parser deepseek_v41
Turns the model's DSML tool blocks, DeepSeek's tag format for tool calls, into OpenAI tool_calls.
--enable-auto-tool-choice
Lets the model decide when to call a tool.
--mm-encoder-tp-mode data
Runs the 32-layer vision encoder data-parallel, with a full copy on each card; at hidden size 1,024, tensor parallel communication would cost more than it saves.
--served-model-name deepseek-v4.1-flash
A name without a slash, which Claude Code requires.
Switches on the image's CUDA 13.0 forward-compatibility libraries for the VM's R570 driver.
VLLM_ENGINE_READY_TIMEOUT_S=3600
Set by the recipe for every GPU type; gives the first load of 510 GB up to an hour to report ready.
VLLM_USE_V2_MODEL_RUNNER=1
Part of the NVIDIA H100 profile, for the memory layout around the indexer buffer.
PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
Part of the NVIDIA H100 profile, for the same memory layout.
HF_HUB_OFFLINE=1
The weights are already on disk, so vLLM loads the model without contacting the Hugging Face Hub.
Compatibility mode from the vLLM Docker documentation. The recipe's command builder also sets VLLM_USE_RUST_FRONTEND=1, which selects a Rust API server that vLLM describes as experimental; this deployment keeps vLLM's default Python server.
How to Deploy DeepSeek-V4.1-Flash on Hyperstack, Step by Step
The whole DeepSeek-V4.1-Flash deployment runs on one machine in eight steps. Start the 510 GB download as soon as the machine is active, and pull the container image while it runs.
1
Access Hyperstack Sign in to the console and activate billing.
2
Deploy the virtual machine 8x NVIDIA H100-80G-PCIe-NVLink, Ubuntu 24.04 with Docker.
3
Open port 8000 One inbound TCP rule, scoped to your own address.
4
Connect and check the GPUs Eight cards in four NVLink pairs.
5
Download the weights 48 shards to the ephemeral disk.
6
Pull the vLLM image vllm/vllm-openai:v0.31.0, pinned.
7
Launch vLLM The recipe's NVIDIA H100 command, plus an API key.
If you are new, create an account, activate billing and add credit. The getting started guide walks through a first deployment from start to finish.
Step 2: Deploy a New Virtual Machine
On the Virtual Machines page, click Deploy New Virtual Machine.
The Deploy New Virtual Machine button.
Then make six choices in the deployment form.
What to select, and why
The flavour and the image carry the deployment; the rest is access.
Field
Selection
Why
Flavour
8x NVIDIA H100-80G-PCIe-NVLink, API name n3-H100x8-NVLink
252 vCPUs, 1,440 GB of RAM, a 100 GB root disk and 6,500 GB of ephemeral storage, per the flavour reference. The RAM holds the Engram tables and the ephemeral disk holds the checkpoint.
Environment
One in CANADA-1
The region the flavour reference lists for this machine. An environment groups the machine with its keys and network.
OS image
Ubuntu Server 24.04 LTS R570 CUDA 12.8 with Docker
Driver, CUDA toolkit and Docker come installed, as the image reference describes, so the machine is ready for Docker as soon as you connect.
SSH key
Import an existing key or generate one
Generating one downloads the private key to your computer. The SSH key guide covers both routes.
SSH access
Enabled
Adds a firewall rule for TCP port 22.
Public IP
Assign Public IP
Reaches the machine over SSH and the endpoint over HTTP.
Each choice maps to a field on the Deploy New Virtual Machine page.
The flavour card for 8x NVIDIA H100-80G-PCIe-NVLink.
The OS image list. Choose Ubuntu Server 24.04 LTS R570 CUDA 12.8 with Docker.
Click Deploy. The machine is ready once its status shows ACTIVE, and billing starts from that state.
Driver and container. The OS image ships the NVIDIA R570 driver, and the vLLM 0.31.0 container carries NVIDIA's CUDA 13.0 forward-compatibility libraries, which VLLM_ENABLE_CUDA_COMPATIBILITY=1 switches on in Step 7. The vLLM Docker documentation lists R570 as a supported host driver for this mode on data centre GPUs such as the NVIDIA H100.
Step 3: Open Port 8000 for the Endpoint
Apart from the SSH rule from Step 2, a new virtual machine accepts no inbound traffic until a firewall rule allows it. Open the machine's details page, go to the Firewall tab and add one inbound rule:
Ether type: IPv4
Protocol: TCP
Port range: 8000
Remote IP prefix: your own public address followed by /32
The inbound rule on the Firewall tab. In the remote IP field, enter your own address followed by /32 rather than 0.0.0.0/0.
Two layers guard the endpoint. The API key from Step 7 protects every route under /v1, and the firewall rule decides who can reach the port at all. The vLLM security guide advises against relying on an API key alone, so keep the remote prefix as narrow as your clients allow.
Step 4: Connect and Check the GPUs
Terminal, your workstationSHELL
# From your workstation, once the virtual machine shows ACTIVEchmod600 ~/.ssh/[YOUR KEY]
ssh-i ~/.ssh/[YOUR KEY] ubuntu@[VM PUBLIC IP]
Once the Ubuntu welcome banner appears, confirm what the machine holds before installing anything.
Terminal, the virtual machineSHELL
# Eight cards and their memory, before anything is installednvidia-smi--query-gpu=index,name,memory.total --format=csv
# How the eight cards are wired to one anothernvidia-smi topo -m
Eight NVIDIA H100 PCIe cards at 81,559 MiB each, with NV12 between GPU0 and GPU1, GPU2 and GPU3, GPU4 and GPU5, and GPU6 and GPU7. Every other pair shows PHB, a path through the PCIe host bridge.
Step 5: Download the Weights to the Ephemeral Disk
The root disk is 100 GB, so the Hugging Face cache goes on the 6,500 GB ephemeral disk mounted at /ephemeral.
Terminal, the virtual machineSHELL
# The root disk is 100 GB and the checkpoint is 510 GB, so# the Hugging Face cache lives on the ephemeral disksudomkdir-p /ephemeral/hf
sudochown-R ubuntu:ubuntu /ephemeral/hf
# tmux outlives a dropped session; jq reads JSON responsessudoapt-get update -q&&sudoapt-get install -y-qtmuxjqpython3-mpip install -q--break-system-packages \
-U"huggingface_hub[hf_xet]"export PATH="$HOME/.local/bin:$PATH"
Terminal, the virtual machine: the downloadSHELL
# Start a named tmux session, then run the download inside ittmux new -s weights
export HF_HOME=/ephemeral/hf
hf download deepseek-ai/DeepSeek-V4.1-Flash-1017 --max-workers16
Detach from tmux with Ctrl+b then d, and reattach with tmux attach -t weights. The repository is public under the MIT licence, so the download needs no Hugging Face token. When the command returns, confirm that all 48 shards are present and none is partial:
Terminal, the virtual machineSHELL
# Count the shards and any partial files once the download returns
REPO=/ephemeral/hf/hub/models--deepseek-ai--DeepSeek-V4.1-Flash-1017
SHARDS=$(ls $REPO/snapshots/*/model-*-of-00048.safetensors|wc-l)
PARTIAL=$(find $REPO -name'*.incomplete'|wc-l)
echo"$SHARDS shards, $PARTIAL incomplete"
OutputOUTPUT
48 shards, 0 incomplete
Keep the checkpoint between sessions. Data on /ephemeral does not persist through hibernation, so copy the 510 GB to a shared storage volume, as the ephemeral storage guide describes.
Step 6: Pull the vLLM Image
In a second SSH session, pull the image while the weights download. DeepSeek-V4.1-Flash support arrived in vLLM 0.30.0, and the recipe sets vLLM 0.31.0 as its minimum, so pin that release rather than latest.
Terminal, the virtual machineSHELL
# In a second SSH session, while the weights downloaddocker pull vllm/vllm-openai:v0.31.0
Step 7: Launch vLLM
Create a key for the endpoint first. Clients send it as a bearer token.
Terminal, the virtual machineSHELL
# A random key for the endpoint, readable by your user onlyopenssl rand -hex32> ~/.vllm_key &&chmod600 ~/.vllm_key
export VLLM_KEY=$(cat ~/.vllm_key)
Then start the container. The engine flags are the recipe's NVIDIA H100 command, with the served name, the API key and CUDA compatibility added.
The first start reads 510 GB of weights from the ephemeral disk and pins about 189 GiB of Engram tables and scales in host memory before the API opens; VLLM_ENGINE_READY_TIMEOUT_S=3600, set by the recipe, gives that first load up to an hour.
What happens between docker run and the first request
Five stages, in order.
1
The container starts vLLM 0.31.0 reads the launch flags and environment variables.
2
Eight workers come up One per GPU, joined into a tensor parallel group of eight.
3
Weights load from /ephemeral Experts, attention and embeddings are sharded eight ways; the Engram tables are pinned in host memory.
4
Memory is sized The indexer reserves its 8 GiB buffer, and the KV cache takes what remains of the 0.92 share once activations and CUDA graphs are accounted for.
5
The API opens Port 8000 accepts requests and /health starts answering.
Stages of a vLLM start-up for this configuration.
Terminal, the virtual machineSHELL
# Stream the engine's start-up in one terminaldocker logs -f deepseek-v41-flash
# In another, poll the health route until it answersuntilcurl-sf http://localhost:8000/health; dosleep30; doneecho"vLLM is ready"
OutputOUTPUT
vLLM is ready
Step 8: Send the First Request
List the served model, then send the question the recipe uses as its own check, with thinking off. The correct answer is 323.
curl-s http://localhost:8000/v1/chat/completions \
-H"Content-Type: application/json" \
-H"Authorization: Bearer $VLLM_KEY" \
-d'{"model": "deepseek-v4.1-flash",
"chat_template_kwargs": {"thinking": false},
"messages": [{"role": "user", "content":
"What is 17*19? Return only the integer."}]}' \
|jq-r'.choices[0].message.content'
OutputOUTPUT
323
Setting thinking to false in chat_template_kwargs asks for a direct answer. Without it, the server renders the prompt in thinking mode at effort 75. From your workstation, the same request works against http://[VM PUBLIC IP]:8000 once the Step 3 rule is in place.
DeepSeek-V4.1-Flash Inference: Thinking, Effort, Tools and Images
Every DeepSeek-V4.1-Flash inference request follows the same path. The API server checks the key, vLLM's deepseek_v41 prompt encoder writes the conversation in DeepSeek's V4.1 format, the engine runs it across the eight GPUs, and the reasoning and tool-call parsers turn the raw output back into OpenAI fields.
What one request passes through
Six stages, from your client and back again.
The prompt encoder and parsers are vLLM's implementation of DeepSeek's encoding reference.
Connect a Python Client
The server speaks the OpenAI Chat Completions API, so the official OpenAI SDK works unchanged. DeepSeek recommends a temperature of 1.0 and a top_p of 1.0 for the 1017 checkpoint, as its model card lists.
Python, your workstationPYTHON
# pip install openai, then export VLLM_KEY with the Step 7 keyimport os
from openai import OpenAI
client = OpenAI(
base_url="http://[VM PUBLIC IP]:8000/v1",
api_key=os.environ["VLLM_KEY"],
)
MODEL = "deepseek-v4.1-flash"
Chat Mode for Direct Answers
With thinking off, the encoder closes the reasoning block before generation starts, so the reply is the answer and nothing else.
Python, your workstationPYTHON
ask = "Write 1,048,576 as a power of two. Expression only."
reply = client.chat.completions.create(
model=MODEL,
messages=[{"role": "user", "content": ask}],
max_tokens=16,
extra_body={"chat_template_kwargs": {"thinking": False}},
)
print(reply.choices[0].message.content)
OutputOUTPUT
2^20
Thinking Mode and the 1 to 100 Effort Dial
DeepSeek-V4.1-Flash exposes reasoning as a number rather than a handful of tiers. During reinforcement learning, DeepSeek trained the model at a set of effort levels on a scale from 1 to 100, penalising long reasoning less as the level rises, and the report notes that values between the trained levels give interpolated behaviour. In thinking mode, the encoder writes the value into the prompt as a Reasoning Effort line at the start of the conversation. DeepSeek's own API maps its low, high and max tiers to 50, 75 and 100, as section 5.1.4 of the technical report sets out.
On this server, a request that sets neither thinking key runs in thinking mode at effort 75, the default in DeepSeek's encoder and in vLLM 0.31.0. Set thinking explicitly on every request, and add reasoning_effort whenever thinking is on. Give thinking requests room in max_tokens, since the reasoning trace and the answer share one budget and the answer begins only once the trace closes.
One dial from 1 to 100
DeepSeek's API tiers sit at 50, 75 and 100. The report finds that efforts of 60 to 80 recover most of the maximum setting's accuracy.
Tier mapping from Table 2 of the technical report and the encoding reference; the 60 to 80 band from section 5.3.2 of the report.
Python, your workstationPYTHON
question = ("A 475 GiB checkpoint is served by 8 GPUs after ""189 GiB of it moves to host memory. How many GiB ""does each GPU hold? Answer with the number only.")
reply = client.chat.completions.create(
model=MODEL,
messages=[{"role": "user", "content": question}],
temperature=1.0, top_p=1.0, max_tokens=8192,
extra_body={"chat_template_kwargs": {
"thinking": True, "reasoning_effort": 60}},
)
msg = reply.choices[0].message
print("reasoning:", msg.reasoning)
print("answer:", msg.content)
OutputOUTPUT
reasoning: Of the 475 GiB, 189 GiB sits in host memory.
That leaves 475 - 189 = 286 GiB for the GPUs, and split
evenly across 8 GPUs that is 286 / 8 = 35.75 GiB each.
answer: 35.75
The reasoning arrives in the reasoning field and the answer in content. The deepseek_v41 reasoning parser makes that split, and the vLLM documentation notes that the field was called reasoning_content in older releases.
What effort 25 and effort 100 buy
Pass@1 at effort 25 and effort 100. The higher setting spends roughly 2.5 times the output tokens.
Source: section 5.3.2 of the technical report, which scores the launch weights. The reasoning line averages eight benchmarks, including GPQA Diamond, HLE, LiveCodeBench and MathArena Apex; DeepSWE v1.1 runs on mini-SWE and Terminal-Bench 2.1 on DeepSeek Harness in Minimal mode.
Efforts of 60 to 80 recover most of effort 100's accuracy at less than half its tokens, while the last step to 100 lengthens agent trajectories by 1.6 to 1.8 times for marginal gains. Effort therefore sets how many tokens each request spends, and so how much of the machine's capacity it uses, with no change to the server.
Tool Calling Through the DSML Parser
DeepSeek-V4.1-Flash writes tool calls as DSML tag blocks rather than JSON. vLLM handles both directions: the encoder wraps your tool messages in tool_result tags, and the deepseek_v41 parser turns DSML blocks into standard OpenAI tool_calls. With --enable-auto-tool-choice, the model decides for itself when to call a tool.
One tool call, two notations
The parser turns the DSML block the model writes into the OpenAI structure your client reads.
DSML format from DeepSeek's encoding reference; tool_calls follows the OpenAI schema.
The example below gives the model one tool that returns the hardware of a Hyperstack flavour, then asks a question it can only answer after calling it.
Python, your workstation: the first turnPYTHON
import json
FLAVOURS = {"n3-H100x8-NVLink": {
"gpus": 8, "vcpus": 252, "ram_gb": 1440,
"root_disk_gb": 100, "ephemeral_gb": 6500}}
tools = [{"type": "function", "function": {
"name": "get_flavour",
"description": "Hardware of a Hyperstack flavour, by API name.",
"parameters": {"type": "object", "required": ["name"],
"properties": {"name": {"type": "string"}}}}}]
effort = {"chat_template_kwargs": {"thinking": True,
"reasoning_effort": 40}}
messages = [{"role": "user", "content":
"Will a 510 GB checkpoint fit on the ephemeral disk ""of n3-H100x8-NVLink? Look the flavour up first."}]
reply = client.chat.completions.create(
model=MODEL, messages=messages, tools=tools, extra_body=effort)
call = reply.choices[0].message.tool_calls[0]
print(call.function.name, call.function.arguments)
OutputOUTPUT
get_flavour {"name": "n3-H100x8-NVLink"}
Python, your workstation: the tool result and the answerPYTHON
Yes. n3-H100x8-NVLink has 6,500 GB of ephemeral storage,
so a 510 GB checkpoint fits with about 5,990 GB to spare.
Passing the assistant turn back with its reasoning keeps the model's plan intact across the call. When a conversation declares tools, DeepSeek's encoder keeps the reasoning from every turn rather than dropping earlier traces, so the model can follow one plan through several calls.
Image Input
Images go in as image_url content parts, the format vLLM's multimodal input guide documents. vLLM fetches each image, runs the 32-layer vision encoder and places the visual tokens where the image sits in the prompt. Each image costs up to 1,024 tokens, as the vLLM recipe notes, and the 3 by 3 pixel-unshuffle supports inputs up to about 1,344 by 1,344 pixels. The request below asks the model to read DeepSeek's own KV cache chart from the DeepSeek-V4.1-Flash model card.
Python, your workstationPYTHON
chart = ("https://huggingface.co/deepseek-ai/DeepSeek-V4.1-Flash/""resolve/main/assets/dsv41_kv_cache.png")
question = ("Which model on this chart has the smallest KV cache ""per token, and how much smaller is it than the next?")
reply = client.chat.completions.create(
model=MODEL,
messages=[{"role": "user", "content": [
{"type": "image_url", "image_url": {"url": chart}},
{"type": "text", "text": question},
]}],
max_tokens=512,
extra_body={"chat_template_kwargs": {"thinking": False}},
)
print(reply.choices[0].message.content)
OutputOUTPUT
DeepSeek-V4.1-Flash has the smallest global KV cache per
token, at 890 bytes. The next smallest is DeepSeek-V4-Flash
at 3,514 bytes, so V4.1-Flash is about 3.9 times smaller.
Keep one text request and one image request in your deployment checks, since the vision encoder is a separate path through the model.
Connect an Agent Harness to DeepSeek-V4.1-Flash
DeepSeek scored DeepSeek-V4.1-Flash in eight harness configurations from six families, with the checkpoint and decoding settings held fixed, and reports that its agentic behaviour carries across them. You can therefore pick the harness that fits your own workflow.
The same model in eight harnesses
Resolved rate on DeepSWE v1.1 and Pass@1 on Terminal-Bench 2.1, at maximum effort. Switch between the two benchmarks.
Source: Table 4 of the technical report, which scores the launch weights. Eight samples per task on DeepSWE v1.1 and three on Terminal-Bench 2.1, a 1M-token context, a temperature of 1.0 and a top-p of 0.95.
vLLM serves the Anthropic Messages API beside the OpenAI one, so Claude Code can use this endpoint directly. Point it at the server and map every model tier to the served name:
Terminal, your workstationSHELL
# On your workstation, with Claude Code installedexport ANTHROPIC_BASE_URL="http://[VM PUBLIC IP]:8000"export ANTHROPIC_AUTH_TOKEN="[YOUR VLLM KEY]"export ANTHROPIC_API_KEY="[YOUR VLLM KEY]"export ANTHROPIC_DEFAULT_OPUS_MODEL="deepseek-v4.1-flash"export ANTHROPIC_DEFAULT_SONNET_MODEL="deepseek-v4.1-flash"export ANTHROPIC_DEFAULT_HAIKU_MODEL="deepseek-v4.1-flash"claude
As its environment variable reference states, Claude Code sends ANTHROPIC_AUTH_TOKEN as a bearer token, which the server's API key check accepts. Harnesses that speak the OpenAI API take http://[VM PUBLIC IP]:8000/v1 as the base URL and the same key.
Tuning DeepSeek-V4.1-Flash on vLLM
Turn On DSpark Drafting
To enable DSpark, add the recipe's speculative decoding flag as the last line of the launch command, with a backslash at the end of the line before it:
Addition to the Step 7 launch commandSHELL
# Append to the end of the Step 7 launch command--speculative-config'{"method": "dspark",
"num_speculative_tokens": 5,
"draft_sample_method": "probabilistic",
"rejection_sample_method": "block",
"enable_adaptive_verification": true}'
It drafts five tokens per round, the block size DSpark was trained on, and turns on adaptive verification on NVIDIA GPUs. How many drafts are accepted depends on how predictable your traffic is, so measure the acceptance rate on your own prompts before adopting it.
Serve Text Only
For text-only traffic, replace --mm-encoder-tp-mode data with the flag below. It skips the vision encoder and its aligner and frees that memory for the KV cache; the two flags cannot be used together.
Swap in the Step 7 launch commandSHELL
# In place of --mm-encoder-tp-mode data, for text-only traffic--language-model-only
Size the Context to the Workload
The indexer buffer grows with the context limit as well as the batch budget. A workload that never needs a million tokens can set --max-model-len lower, and the memory the buffer gives up goes to the KV cache.
Against 8 GiB at the full 1,048,576-token context.
DeepSeek-V4.1-Flash Deployment Cost
A DeepSeek-V4.1-Flash deployment on one machine comes down to one hourly GPU rate. Hyperstack lists NVIDIA H100 NVLink at $2.80 per GPU hour on demand and from $1.82 per GPU hour reserved on its GPU pricing page, and this machine carries eight cards. The public IP the endpoint needs is listed separately on the same page, at $0.00672043 per hour. Billing runs per minute, as the billing policies set out, and starts once the machine is ACTIVE, as the getting started guide notes.
The 8x NVIDIA H100-80G-PCIe-NVLink machine, priced
One machine carries the whole deployment, so these rows are the full GPU bill.
Pricing
Per GPU hour
Per hour
Per day
Per 730-hour month
On demand
$2.80
$22.40
$537.60
$16,352.00
Reserved, from
$1.82
$14.56
$349.44
$10,628.80
Per GPU rates from the Hyperstack GPU pricing page, multiplied by eight GPUs, then by 24 hours and by 730 hours. On demand, a minute costs about $0.37.
What a month of runtime costs
Drag the slider to the hours the machine runs. Billing is per minute, so a partial hour costs only the minutes used.
On-demand and reserved rates for eight NVIDIA H100 NVLink GPUs, from the pricing page.
Three Levers on the Bill
What moves the cost, and how
One lever is a commitment, one is a per-request setting and one is a habit.
Lever
Effect
Reserved pricing
From $1.82 against $2.80 per GPU hour, 35 per cent lower, for an endpoint that runs continuously.
Reasoning effort
Sets how many tokens each answer spends, and so the cost of each answer on a machine billed by the hour. DeepSeek finds most of the maximum accuracy between 60 and 80, at under half the tokens of 100.
Hibernation between sessions
This flavour supports hibernation, which bills only the root disk while the machine is paused. Keep a copy of the checkpoint on a shared storage volume, because /ephemeral does not persist through it. Shared storage is listed at $0.000096774 per GB per hour, about $0.05 per hour for the 510 GB checkpoint.
Why self-host a model that DeepSeek also serves as an API? The MIT licence lets you run the weights on a machine you control, so your prompts and every response stay inside your own environment. You set the context length and the parsers at launch and the effort on every request, and the machine costs the same per hour however many tokens it serves. For a primer on the serving engine itself, see what vLLM is and how it serves models.
Why Deploy DeepSeek-V4.1-Flash on Hyperstack?
Hyperstackis a cloud platform built for AI andmachine learningworkloads. Here is what a single-node DeepSeek-V4.1-Flash deployment needs from a provider, and how that maps onto the platform:
Eight NVIDIA H100 GPUs in One Machine The 8x NVIDIA H100-80G-PCIe-NVLink flavour serves the 1017 checkpoint with about 36 GiB of resident weights per card, and NVLink bridges each pair of cards at 600 GB/s bidirectional.
1,440 GB of Host Memory for Engram Room to pin both Engram tables and their scales, about 189 GiB, with most of the machine's memory still free, per the flavour reference.
6,500 GB of Ephemeral Storage The ephemeral disk holds the 510 GB checkpoint more than twelve times over, on the same machine as the GPUs that read it.
Docker-Ready Ubuntu Images Ubuntu Server 24.04 LTS R570 CUDA 12.8 with Docker goes from SSH to docker run with no driver work.
Firewall Rules per Machine One inbound firewall rule scopes the endpoint to your own address.
Run DeepSeek-V4.1-Flash on your own GPUs
Deploy DeepSeek-V4.1-Flash on 8x NVIDIA H100
One virtual machine, the vLLM recipe's NVIDIA H100 configuration and a private endpoint with thinking, tool calls, image input and the full one-million-token context, from $22.40 per hour on demand.
8x NVIDIA H100 80 GB1,048,576-token contextvLLM 0.31.0$22.40 per hour
Launch an NVIDIA H100 virtual machine on Hyperstack today.
FAQs
What is DeepSeek-V4.1-Flash-1017?
DeepSeek-V4.1-Flash-1017 is an updated release of DeepSeek-V4.1-Flash, a multimodal mixture-of-experts model with 552B backbone parameters. It activates 8B parameters per prompt token and 16B per generated token, holds 1,048,576 tokens of context and ships under the MIT licence.
What hardware do you need to deploy DeepSeek-V4.1-Flash?
DeepSeek-V4.1-Flash needs one node of eight 80 GB GPUs, the smallest NVIDIA configuration the vLLM recipe serves. Its 475 GiB checkpoint fits once the Engram tables and their scales, about 189 GiB, move to host memory, leaving about 36 GiB of resident weights on each NVIDIA H100.
How much does a DeepSeek-V4.1-Flash deployment cost on Hyperstack?
An 8x NVIDIA H100-80G-PCIe-NVLink machine costs $22.40 per hour on demand, or from $14.56 per hour reserved, billed per minute. The whole deployment runs on that one machine, so one hourly rate covers every GPU.
How do you control thinking on DeepSeek-V4.1-Flash?
Send chat_template_kwargs with thinking set to true or false and, when thinking is on, a reasoning_effort integer from 1 to 100 in the same object. With neither key set, vLLM 0.31.0 runs thinking mode at effort 75.
Does DeepSeek-V4.1-Flash support tool calling and images on vLLM?
Yes. With the deepseek_v41 tool parser and auto tool choice, the tag blocks the model writes for tool calls arrive as OpenAI tool_calls, and image_url content parts run through its 32-layer vision encoder at up to 1,024 tokens per image.