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).
Built by Egzakta AI Lab for local, sovereign deployment.
| 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 |
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.
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.
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.
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%).
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%) |
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.
kvark-flash-1.0-plan (kvark-flash-1.0-spark-plan on Spark); the router never picks it on its own.Apache 2.0 for the recipe and the code in this repository. The DeepSeek V4.1-Flash weights are under DeepSeek's MIT license.
@misc{kvarkflash2026,
title = {KVARK Flash 1.0},
author = {Egzakta AI Lab},
year = {2026},
url = {https://huggingface.co/Egzakta/Kvark-Flash-1.0}
}