KVARK Flash 1.0
A serving recipe for DeepSeek V4.1-Flash-1017. This repository contains no weights.
KVARK Flash is a small OpenAI-compatible proxy in front of an unchanged DeepSeek V4.1-Flash-1017. Per request, it sets how long the model may think and what it is told before it starts. On our public benchmark set it uses 30β50% fewer reasoning tokens than DeepSeek's default setting. Accuracy stays within 2.5 points on 4x H100 and within 3.5 points on 2x DGX Spark. The largest drops are HMMT on H100 (β2.4, borderline significant) and AIME on Spark (β3.3, not significant).
- Weights: the original deepseek-ai/DeepSeek-V4.1-Flash-1017. On 2x DGX Spark we used the 2.9 bpw EXL3 quant made by Mia-AiLab for the TensorFold engine; it is not ours.
- Every benchmark answer of both setups: dataset Egzakta/kvark-flash-1.0-evals.
Built by Egzakta AI Lab for local, sovereign deployment.
What the recipe does
| Reasoning effort per task type | lower effort for chat, math, science and code; higher for long planning |
| Router | picks a profile from the request's tools and text; rules only, no model call |
| Budget forcing for code | past 28,672 thinking tokens, the thinking is closed and the model is made to answer |
| Stop rule for document work | after three searches with no supporting page, the model answers NOT IN DOCUMENTS |
| Tool-cap guard | when the app allows no more tool calls, removes stray tool-call text and, if no answer is left, asks once for a final answer |
Profiles
Call the model kvark-flash-1.0 and the router picks a profile per request. To choose one yourself, call its name directly.
| Model name | Effort, H100 (SGLang) | Effort, Spark (TensorFold) | Thinking cap | Router picks it when |
|---|---|---|---|---|
kvark-flash-1.0-general | 0.3 | minimal | none | everything else: chat, math, science |
kvark-flash-1.0-code | 0.3 | minimal | 28,672 | a code tool (python, bash, edit...) or the request asks for code |
kvark-flash-1.0-docs | default | default | none | retrieval tools (search, read_page...) and no code tool; stop rule added |
kvark-flash-1.0-plan | 0.5 | low | none | never; ask for it by name |
On Spark the names carry a -spark suffix (kvark-flash-1.0-spark, kvark-flash-1.0-spark-plan, ...). A reasoning_effort you send yourself always wins over the profile. Any other model name passes through to DeepSeek untouched.
The router reads the tool list the app sends. An app that sends code tools always gets the code profile, even for a question that needs none. Apps that mix code, search and chat tools in one agent should call a profile by name.
Results
Both setups run on the same engine and machine at the same time, with thinking on, a 65,536 token cap, the same prompts and the same sampling (temperature 1.0, top_p 0.95, top_k 20, min_p 0). "DeepSeek" is the same engine with no reasoning_effort set, so it runs at the engine's default (high on TensorFold, Spark). Differences are KVARK Flash minus DeepSeek, computed before rounding, with 95% intervals from a paired bootstrap over questions (all seeds of a question kept together). Faster is DeepSeek's mean time per answer divided by KVARK Flash's, with both running at the same time. FRAMES answers are judged by two LLMs, GLM-5.3-Flash and MiMo-V2.6-Flash; when they disagree, a rule-based check decides.
What these benchmarks exercise. None of the benchmark requests carry tools, so the router routes on text alone. LiveCodeBench goes to the code profile (the 28,672 cap); the other six run the general profile (no cap). Both profiles use effort 0.3 on H100 and minimal on Spark. The stop rule and the tool-cap guard are not exercised here: FRAMES pastes the documents into the prompt and gives no search tool.
Benchmarks. In the images, "Raw" is DeepSeek and n counts answers (questions Γ seeds). GPQA Diamond: 198 questions Γ 4 seeds. AIME 2026: 30 problems Γ 4 seeds. HMMT February 2025 and 2026: 63 problems Γ 4 seeds. IFEval: 541 prompts, prompt-level strict. LiveCodeBench: release v6 (January to April 2025), newest 150 problems. MMLU-Pro: 980 questions, 70 per category, fixed seed. FRAMES: 824 questions, documents in the prompt ("oracle docs"), LLM judge.
4x H100 NVL, SGLang, FP8
Three groups of benchmarks ran in parallel with 8 requests each, so up to 24 requests in flight per setup.
The results are in the image at the top of this card.
HMMT is borderline: the interval ends at β0.4 here but reaches 0.0 with a different bootstrap seed, and a McNemar test gives p = 0.11. Read it as effort 0.3 costing up to about 2 points on hard competition math. For that load, call kvark-flash-1.0-plan or send your own reasoning_effort. GPQA Diamond and FRAMES lean slightly negative on both machines, inside the interval.
The 28,672 cap fired on 9 of 150 LiveCodeBench answers (6%). Without the cap, 16 DeepSeek answers thought longer than that.
2x DGX Spark, TensorFold, EXL3 2.9 bpw
2 requests in flight per setup. Same prompts, cap, sampling and judges as on H100.
No difference on Spark is significant. HMMT goes the other way from H100 (+1.6 here, β2.4 there) and AIME touches zero at the upper end, so read both as noise around a small effect on hard competition math. The cap fired on 5 of 150 LiveCodeBench answers (3%).
Speed
Seconds per answer on 4x H100, median and 95th percentile, from the benchmark run above. Both setups shared the machine with up to 24 requests in flight each, so these are times under load, not single-user latency.
| Benchmark | Flash p50 | DeepSeek p50 | Flash p95 | DeepSeek p95 |
|---|---|---|---|---|
| GPQA Diamond | 33 | 49 | 423 | 768 |
| AIME 2026 | 70 | 89 | 440 | 1,230 |
| HMMT | 104 | 122 | 764 | 1,066 |
| IFEval | 28 | 36 | 114 | 165 |
| LiveCodeBench | 48 | 79 | 799 | 1,485 |
| MMLU-Pro | 7 | 8 | 137 | 203 |
| FRAMES | 15 | 15 | 101 | 179 |
On average an answer arrives 1.4 to 1.7 times faster with KVARK Flash on H100, and 1.1 to 2.0 times faster on Spark. All Spark times are in the dataset.
Capacity on a mixed load (H100, earlier run on a held-out split). One batch of 263 tasks: LiveCodeBench Γ1, GPQA Diamond Γ1, AIME Γ2 and HMMT Γ2, run through each setup in turn. This run's answers are not in the dataset.
| Correct | Wall clock | Correct per hour | Tokens | |
|---|---|---|---|---|
| DeepSeek | 241 / 263 | 2,033 s | 427 | 2.52M |
| KVARK Flash | 242 / 263 | 1,270 s | 686 Γ1.6 | 1.53M (β39%) |
Other measurements (H100, held-out split)
- Agentic coding, LiveCodeBench Γ2 with a python sandbox tool (up to 16 calls per task): 90.8 vs 87.5 for DeepSeek, 5.9k vs 6.9k mean thinking tokens, 2.1 vs 2.5 tool calls per task.
- AA-Omniscience (public 600): index 21.2 for KVARK Flash vs 16.7 for DeepSeek, with fewer wrong answers (27.7% vs 32.2%).
- AA-LCR: 82.5 for KVARK Flash vs 86.0 for DeepSeek, not significant, with 58% fewer tokens.
Run it
1. Get the files. The hf command comes with pip install -U huggingface_hub.
hf download Egzakta/Kvark-Flash-1.0 --local-dir kvark-flash
cd kvark-flash
2. Start the proxy in front of your running DeepSeek V4.1-Flash-1017 server. Standard library only, no install.
The proxy sends requests under the model name in the profile file: serve DeepSeek as deepseek-v4.1-flash on SGLang (for example --served-model-name deepseek-v4.1-flash) and as DeepSeek-V4.1-Flash-1017 on TensorFold, or change upstream_model in the profile file. With any other name, requests can fail.
H100 (SGLang):
FLASH_UPSTREAM=http://localhost:30000 FLASH_PORT=8000 \
FLASH_ENCODING_DIR=/path/to/DeepSeek-V4.1-Flash-1017/encoding \
python3 proxy/flash_proxy.py
2x DGX Spark (TensorFold, with the 2x DGX Spark recipe):
FLASH_UPSTREAM=http://localhost:8890 FLASH_PORT=8000 \
FLASH_PROFILES=proxy/profiles_spark.json \
python3 proxy/flash_proxy.py
| Setting | Meaning |
|---|---|
FLASH_UPSTREAM |
address of your DeepSeek server |
FLASH_PORT |
port KVARK Flash listens on |
FLASH_ENCODING_DIR |
the encoding folder from the DeepSeek checkpoint, used for budget forcing on SGLang |
FLASH_PROFILES |
profile file; proxy/profiles.json by default |
FLASH_LOG |
request log, flash.jsonl in the folder you start from: one JSON line per request with the profile, effort and cap used |
FLASH_DEFAULT_MAX |
max_tokens when the request sets none; 65,536 by default |
3. Call it with any OpenAI client. Turn thinking on in the request, as in all our tests: the code cap only works when thinking is on.
from openai import OpenAI
client = OpenAI(base_url="http://localhost:8000/v1", api_key="local")
response = client.chat.completions.create(
model="kvark-flash-1.0", # on Spark: "kvark-flash-1.0-spark"; or a profile, e.g. "kvark-flash-1.0-plan"
messages=[{"role": "user", "content": "How many primes are there between 100 and 150?"}],
max_tokens=65536,
extra_body={"chat_template_kwargs": {"thinking": True}},
)
print(response.choices[0].message.content)
Endpoints: POST /v1/chat/completions (streaming and not), GET /v1/models, GET /flash/health. The API key is passed to the engine and never stored.
Tests: cd proxy && python -m pytest tests runs against a fake engine, no GPU needed.
Limitations
- Tuned and measured on DeepSeek V4.1-Flash-1017 only. A new checkpoint needs the benchmarks re-run.
- Lower effort can cost a few points on hard competition math: HMMT β2.4 on H100 (borderline) and AIME β3.3 on Spark (not significant). For that load, call
kvark-flash-1.0-plan(kvark-flash-1.0-spark-planon Spark); the router never picks it on its own. - Long multi-step planning is not shortened on purpose: cutting its thinking costs accuracy.
- The router is rule-based. A wrong guess means the model thinks longer or shorter than needed; the request is still answered.
- The public benchmarks run no tools, so the stop rule, the tool-cap guard and tool-based routing are not measured on them. The agentic coding run above is the only measurement here with a tool.
- The fixed-effort baseline (effort 0.3 on every request, without the router) was not run. On six of the seven benchmarks it would be the same request as KVARK Flash.
License
Apache 2.0 for the recipe and the code in this repository. The DeepSeek V4.1-Flash weights are under DeepSeek's MIT license.
Contact us
Citation
@misc{kvarkflash2026,
title = {KVARK Flash 1.0},
author = {Egzakta AI Lab},
year = {2026},
url = {https://huggingface.co/Egzakta/Kvark-Flash-1.0}
}
- Downloads last month
- 28