Retrieved article excerpt
Open article · Retrieved 2026-10-28T01:27:34.221722+00:00
# Delta Inference Engine
**DeepSeek-V4.1-Flash on one NVIDIA GPU, natively on Windows.**
Delta runs all 552 billion parameters of **DeepSeek-V4.1-Flash-1017** ( 2-bit experts) on one
consumer PC, natively on Windows. It serves an OpenAI-compatible API at `http://127.0.0.1:8080/v1` with up to 1M tokens
of context.
This is a Windows port of [Xolotl](https://github.com/Indras-Mirror/Xolotl), which is built on
[Strata](https://github.com/Niko1221/Strata). Upstream targets Linux; its README is
[README.xolotl.md](https://github.com/musicurgy/delta-inference-engine/blob/main/README.xolotl.md).
## Quick start
**Which download?** Just this repository: **Code > Download ZIP** (or `git clone`). You do not need any of the
`build-ds41-*.zip` files on the Releases page - `Start DeepSeek.bat` downloads the right engine for your CPU by
itself. (Only if you set it up by hand: almost every PC wants `build-ds41-portable.zip`; the two `compat` zips are for
CPUs from before 2013.)
1. Get this folder (**Code > Download ZIP**, or
`git clone -c core.longpaths=true https://github.com/musicurgy/delta-inference-engine C:\AI\Delta`) somewhere with
a short path, and check "What you need" below: an NVIDIA RTX card with 12 GB+ (24 GB is fastest), 128 GB+ of RAM,
~385 GB free on a fast NVMe drive (its speed matters - see below).
2. Double-click **`Start DeepSeek.bat`**. The first time, it sets up everything that is missing, step by step, and
asks before anything big:
- Python and its packages (no Python 3.10-3.12 on the PC: it offers to install python.org's Python 3.11 with
Windows' own winget, for your Windows user only),
- the engine: the prebuilt one for your CPU from the
[Releases page](https://github.com/musicurgy/delta-inference-engine/releases) (under 1 GB, no compiler needed) - or it builds
it, if you have Visual Studio Build Tools, the CUDA Toolkit and Git,
- the model files from Hugging Face (~375 GB of downloads, checked against their published SHA-256; it checks the
free space first; resumable - just start it again if it stops).
3. Then the server starts and the chat page opens in your browser. Apps use `http://127.0.0.1:8080/v1` (OpenAI) or
`/v1/messages` (Anthropic), any API key. (Another port: `DS41_PORT` in `ds41-paths.bat`.)
Every later start: double-click `Start DeepSeek.bat` again - it finds everything in place and starts the server
(ready in about a minute). To run another quant (see "Other quants" below), double-click **`Choose Model.bat`**.
Everything else in this folder is the engine's source, upstream's files and tools - you do not need to open them.
**Updating:** a git clone: `git pull` in this folder (or double-click `UPDATE.bat`, which does that). A ZIP copy:
download the new ZIP and unpack it over this folder, or next to it with `models\` moved across. Then double-click
`Start DeepSeek.bat`: if the new version needs a new engine or new Python packages, it gets them first. Your model
files stay as they are.
**Something wrong?** Double-click **`Start DeepSeek (debug).bat`** instead. It checks the PC and the install (a
PASS / FAIL list), starts DeepSeek in a second window with everything it prints saved, and when you close that window
it packs it all into `logs\debug-<time>.zip`. Attach that zip to an issue with a line on what went wrong. It holds no
prompts or answers, and your Windows user name is replaced by `<user>`.
## Speed
These numbers are from an RTX 3090 with an NVMe SSD, through the server:
| | 192 GB RAM | 128 GB RAM |
| --- | --- | --- |
| Writing (6 chats, up to 1,500 tokens each, thinking on) | **41 tok/s** | **33 tok/s** |
| Reading a long prompt (25-64k tokens) | **610 tok/s** | **410 tok/s** |
The 128 GB column is the same PC with the expert memory a 128 GB PC gets.
With less RAM, more of the model's experts are read from the SSD as they are needed. That is slower, most of all on
long prompts, but the output is the same.
On the 192 GB PC, a new 6k-token prompt takes about 18 s and a 25k-token prompt about 42 s. Writing is fastest on
maths and code (~48 and ~45 tok/s) and ~35 tok/s on plain prose; counting the prompt and the thinking, a client sees
~39 tok/s.
## Windows settings for speed
Optional, about 15% faster. `Start DeepSeek.bat` checks these at every start and names any that is off; they need
administrator rights, the BIOS or a restart, so it does not change them itself. Measured on the RTX 3090 PC: the first
three together +12% writing speed (21.7 -> 24.3 tok/s at the time), the RAM speed another +3%.
1. **Power plan: High performance.** Win+R, `powercfg.cpl`, select High performance (under "Show additional plans" if
it is hidden). It stops CPU core parking and the PCIe link's power saving.
2. **Hardware-accelerated GPU scheduling: on.** Settings > System > Display > Graphics settings, turn it on, restart.
3. **"Lock pages in memory" for your account**: 2 MB pages for the ~140 GB of experts in RAM. Win+R, `secpol.msc`,
Local Policies > User Rights Assignment > "Lock pages in memory" > Add User or Group, type your user name, Check
Names, OK; then sign out and in again. (Windows Home has no `secpol.msc`; the engine then uses normal pages.)
4. **The RAM at its rated speed.** Boards often run four large sticks below their rating: set XMP / EXPO, or the speed
by hand, in the BIOS (here four 48 GB DDR5 sticks went from 4000 to 5600 MT/s: +3%). Check stability afterwards.
5. Optional: NVIDIA Control Panel > Manage 3D settings > Power management mode > Prefer maximum performance.
While it writes, a busy browser or game on the same PC can slow the CPU side down a lot; the engine already runs above
normal priority.
## Agents, chats and tools
- **Conversation cache:** the server keeps up to 8 conversations in memory (about 20 MB per 10k tokens). An agent that
switches between conversations, or makes a side request between turns, resumes each one in a second or two instead
of reading its whole prompt again (measured: 16-18 s per switch before, 1-3 s now; a 9-turn session alternating two
~8k-token conversations: 95 s before, 49 s now).
- **Follow-up messages** only read what is new. In thinking mode, the next turn no longer re-reads the history. A
follow-up of a few hundred to 2,000 new tokens (a tool result, a pasted file) keeps most of the GPU's expert cache
instead of emptying and refilling it, which saves 0.6-0.9 s per turn.
- **Tool calls** (OpenAI `tools`, including a forced `tool_choice`: `"required"` or a named function) and **JSON
output** (`response_format` `json_object` / `json_schema`) work through the OpenAI-compatible API. Requests sent at
the same time are answered one after another.
## Privacy
- The server listens on this PC only (`127.0.0.1:8080`). To reach it from other devices, add `"host": "0.0.0.0"`
AND `"api_key": "<a long secret>"` to `tools/v41/serve/ds41-windows.json` (clients send the key as their API key;
without one, anyone on your network could use the model, and the server warns about it).
- Nothing from your prompts or answers is written to disk unless you turn it on: conversations live in memory and
are gone when the server stops. Opt-in only: the plain-text watch log (`STRATA_TEXT_LOG=<a file path>`), the
request monitor page (`"api_monitor": true` in `tools/v41/serve/ds41-windows.json`; memory only) and, in the
built-in chat page, "Keep chats in this browser" (Settings; off = the chat lives in the tab only).
## Quality
How often the top choice matches DeepSeek's own API, on the same prompts:
| | General | Code + maths |
| --- | --- | --- |
| Exact routing | 91.4% | 92.1% |
| Route bias 0.28 (the default) | 90.2% | 92.4% |
- Route bias prefers experts that are already on the GPU. It is roughly 20% faster. It follows the GPU's experts as
they change during an answer (`STRATA_BIAS_REFRESH=1` in the launcher), which made it both faster and closer to
DeepSeek's own model (at 0.3: 89.3% / 92.7% with the bias fixed at the start of each answer, 89.8-90.0% / 92.9% with
the refresh). The test moves by about 0.2 points between identical runs.
- For exact routing, set `--route-bias` and `--route-bias-file` to `0` in `tools/v41/serve/ds41-windows.json`.
## Other quants: ISTA-DASLab's GSQ-RCO and Unsloth
Besides the default, the engine runs the two other most-downloaded quant families of 1017. **`Choose Model.bat`** lists
the models in your model folder and the ones you can add, builds or downloads the one you pick and saves your choice
(`model-choice.txt`); the next start loads it.
- **ISTA-DASLab's GSQ-RCO** ([ISTA-DASLab/DeepSeek-V4.1-Flash-1017-GSQ-RCO-GGUF](https://huggingface.co/ISTA-DASLab/DeepSeek-V4.1-Flash-1017-GSQ-RCO-GGUF)):
IQ2\_XS, IQ2\_XXS and IQ1\_M. A script builds each one into the engine's layout: the default file's dense weights and
metadata with GSQ's routed experts, streamed from Hugging Face (every shard SHA-256-checked; 20-30 min at 100 MB/s).
They read their Engram tables from the default file, so keep it. By hand:
`.venv\Scripts\python tools\v41\gsq_stream_merge.py --ours models\DeepSeek-V4.1-Flash-1017-Q2.gguf --build IQ2_XS --out models\ds41-gsq-iq2_xs.gguf`
(`--build IQ2_XXS` or `IQ1_M` for the others), then put the file's name in `model-choice.txt`.
- **Unsloth** ([unsloth/DeepSeek-V4.1-Flash-1017-GGUF](https://huggingface.co/unsloth/DeepSeek-V4.1-Flash-1017-GGUF)):
UD-IQ1\_S to UD-Q8\_K\_XL, downloaded as they are into `models\unsloth\` (every file SHA-256-checked). They carry their
own Engram tables (IQ4\_NL up to UD-IQ3\_S - on UD-IQ1\_S as good as DeepSeek's exact ones: 89.3 vs 89.0% -, DeepSeek's
exact FP8 from UD-Q3\_K\_XL), so they need no other file. To install an Unsloth quant INSTEAD of the default: answer N
when `Start DeepSeek.bat` offers the default model's download, run `Choose Model.bat`, pick the download, then start
`Start DeepSeek.bat` again.
Measured here, exact routing, top-1 agreement with DeepSeek's own model (teacher-forced, every token):
| | download | general | code + maths | writing, 192 / 128 GB RAM | notes |
| --- | --- | --- | --- | --- | --- |
| default (ds4 Q2) | 366 GB | 91.5% | 93.0% | 41 / 33 tok/s | DeepSeek's exact Engram tables |
| GSQ IQ2\_XS | 159 GB + the default | 90.0% | 92.9% | 38 / 26 tok/s | answered our task questions as well as the default |
| GSQ IQ2\_XXS | 142 GB + the default | 87.8% | 89.5% | 41 / 32 tok/s | fewer knowledge questions right; long prompts slower |
| GSQ IQ1\_M | 125 GB + the default | 85.5% | - | 42 / 37.5 tok/s | long prompts slower (no fast prompt kernel for IQ1\_M) |
| Unsloth UD-IQ1\_S | 233 GB | 89.3% | 91.1% | 40 / **37.5** tok/s | the pick for 128 GB: IQ1\_M's speed, 4 points more agreement |
| Unsloth UD-IQ1\_M ... UD-Q8\_K\_XL | 250-508 GB | - | - | - | load and run (every expert type checked on real weights); not measured |
On 192 GB of RAM the default and UD-IQ1\_S write about as fast as anything, and the default agrees best with DeepSeek.
Speed falls once a model's experts (its file without the Engram table) outgrow the RAM (~150 GB of them fit at 192 GB):
the rest is read from the SSD on every token. So on 192 GB the Unsloth quants above UD-IQ2\_XXS (190 GB of experts) are
slower (how much: not measured yet) - in exchange UD-Q4\_K\_XL / Q8\_K\_XL keep DeepSeek's own MXFP4 experts. On
128 GB the smaller files write fastest (more of their experts fit in RAM): Unsloth UD-IQ1\_S and GSQ IQ1\_M 37.5 vs 33
tok/s for the default - UD-IQ1\_S at 2 points less agreement than the default, IQ1\_M at 6. UD-IQ1\_S also reads long
prompts faster than the default (a 16K-token prompt at ~655 vs ~580 tok/s) and loaded in 25 s vs ~60 s here. Checked
against ISTA's files as of 2026-10-25: the merged experts are byte-identical to theirs; their norms, router and router
bias are bit-identical to the default file's (GSQ-RCO only changes the routed experts). Unsloth's Engram hash constants
(token map, primes, multipliers)