Step 9 rows 1-2: upstream v0.1.45-poly.1 vs fork on the RTX 3090 pod

bench/unbiased/2026-10-17-3090pod-step9/: four arms (upstream and fork, Flash-Next
IQ3_XXS and Qwen3.6 UD-Q3_K_M), upstream's tools/strata_bench.py --runs 3 --long plus
the three-document sustained supplement, raw client output, server logs, provenance
(engine sha256, fork commit), the runner, the launch logs, and a README with the
comparison tables and the two client-compatibility gaps found on the way.

Flash-Next: fork faster on every workload (chat 103.1 vs 87.1 tok/s, sustained
119.1 vs 105.1, prefill 2065/2531/2616 vs 1924/2342/2393). Qwen3.6: decode within
the run-to-run range; 4K prefill 4.7 % faster; 16K prefill 2.3 % slower with
non-overlapping ranges, recorded as a finding to explain. Engines were built
separately in each tree, so a build difference is not excluded.

PLAN.md section 11 and the step table, docs/MODEL-FILES.md statuses updated.
Row 3 (pi wall time) pending.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Robert KarlandClaude Fable 5.1 committed 2026-10-17 23:41:13 -07:00
1 parent 96f4ef1fbb
commit 3c06abe654
54 files changed
+28078 -3

No files matched your search

+10 -1
View File
@@ -313,7 +313,7 @@ Expected diff shape: removals dominated by `setup.py`, `serve/`, translations an
| 6 | First end-to-end chat, both engines | Qwen3.6 UD-Q3_K_M from GGUF; Flash-Next IQ3_XXS from the pod's existing pack and MTP dir. Streaming and non-streaming, reasoning on and off, greedy output equal to upstream PolyStrata on the same ids (teacher-forced id comparison, not text) |
| 7 | Tool calls under pi | pi completes a multi-step coding task against each model. Test the request shapes pi sends: no `max_tokens`, `max_tokens` 32768, optional arguments first, `reasoning_content` on assistant messages, parallel calls, a client that disconnects mid-stream, a stream silent during a long prompt. Raw output logged on parse failure |
| 8 | Images | a screenshot through pi to Qwen3.6; projector width checked against the model |
| 9 | Measurements (§11) | tables under `bench/unbiased/` with commands, raw outputs, checksums of the model files |
| 9 | Measurements (§11) | tables under `bench/unbiased/` with commands, raw outputs, checksums of the model files | Rows 1-2 done 2026-10-18 (`bench/unbiased/2026-10-17-3090pod-step9/`); row 3 pending; one cell to explain (Qwen3.6 16K prefill 2.3 % slower). |
| 10 | `README.md`, `UPSTREAM.md` complete | every `src/`/`include/` hunk since the import appears in `UPSTREAM.md`; README has only numbers that have rows |
| 11 | **Correctness plan** (added 2026-10-17). An agent writes `docs/CORRECTNESS-PLAN.md`: how to check PolyStrata's engines against llama.cpp at the pinned commit for the kernels actually in use on our target (the expert MMQ paths for IQ3_XXS and the K-quants, the MTP draft layer, the Q8/int8 KV paths, the prompt path, `strata-poly`'s qwen35moe path), which of upstream's ~70 parity and bench programs cover them and what each compares against, the teacher-forced greedy id comparison against llama.cpp for Flash-Next and Qwen3.6 (same ids in, how many tokens, what divergence is tolerated and why), what a failure would mean for the fork, and the cost in machine time. Planning only: this step runs nothing on a GPU and changes no code | the document, with each proposed check naming the program or script, the reference it compares against and the pass criterion; your sign-off on which checks become a later step |
| 12 | **Correctness checks** (added 2026-10-17). Run the checks step 11 proposed and you signed off: upstream's parity programs that cover the kernels in use, and the teacher-forced greedy id comparison of each engine against llama.cpp at the pinned commit for Flash-Next IQ3_XXS and Qwen3.6 UD-Q3_K_M. Results, commands and raw outputs under `bench/unbiased/correctness/`; a divergence is a bug to find, in the engine or in llama.cpp, before any README claim beyond "same output as upstream PolyStrata" | every signed-off check has a result on disk with its pass criterion met, or an open finding with the first diverging token, the inputs that reproduce it and which side is wrong; `docs/MODEL-FILES.md` says per file whether it passed |
@@ -354,6 +354,15 @@ Pass: fork within noise of upstream (the run-to-run range) on decode and PP. A f
upstream on any row is a bug to find before the README claims anything. The llama.cpp rows already
recorded stay in the table as context, labelled with their different quant.
Rows 1 and 2 measured 2026-10-18 UTC on the RTX 3090 pod: `bench/unbiased/2026-10-17-3090pod-step9/README.md`.
Row 1 (Flash-Next): fork faster on every workload (chat decode 103.1 vs 87.1 tok/s, sustained 119.1 vs 105.1,
prefill 4K/16K/32K 2065/2531/2616 vs 1924/2342/2393). Row 2 (Qwen3.6 UD-Q3_K_M): decode within the
run-to-run range (chat 213.5 vs 220.8, sustained 200.0 vs 207.6, ranges overlap); prefill 4K 4.7 % faster,
prefill 16K 2.3 % slower with non-overlapping ranges (3486 vs 3570), which the pass rule counts as a finding
to explain. The engine binaries were built separately in the two trees (sha256 in each arm's provenance),
so an engine-build difference is not excluded. Two client-compatibility gaps found and fixed on the way
(`/health` fields, usage in streams; commits 453d3015, 96f4ef1f). Row 3 (pi wall time) pending.
## 12. Decisions, taken 2026-10-17
1. **Repository.** The fork continues the `UnbiasedStrata` repo (`~/Code/UnbiasedStrata`, remote
@@ -0,0 +1,85 @@
# Step 9: upstream PolyStrata v0.1.45-poly.1 vs UnbiasedStrata 2, RTX 3090 pod, 2026-10-18 UTC
PLAN.md section 11, rows 1 and 2. Same pod (RunPod RTX 3090 24 GB, driver 580.126.20, 31 CPU quota), same model
files (`docs/MODEL-FILES.md`), same engine arguments, same context, greedy, the same client: upstream's
`tools/strata_bench.py --runs 3 --long` (chat, 4K/16K/32K prompts, agent session) plus the three-document sustained
supplement of the 2026-10-17 upstream run (3 runs x 3 documents, 512 tokens each). Driver: `us2-step9-run.py` (copy
here), run from upstream's venv. Arms ran back to back, one server at a time, nothing else on the card.
| Arm | Front end | Engine | Server port | Started (UTC) |
| --- | --- | --- | --- | --- |
| upstream-flash-next | upstream `serve/server.py` (Python) | upstream `build/strata`, sha256 `4e7254ef…` | 18080 | 05:48:30 |
| fork-flash-next | `unbiased-strata` (fork 143ada2 = 453d3015 locally) | fork `build/bin/strata`, sha256 `62b91d67…` | 18090 | 06:29:25 |
| upstream-qwen36-q3km | upstream `serve/server.py` | upstream `build/strata-poly`, sha256 `c893c169…` | 18080 | 06:34:20 |
| fork-qwen36-q3km | `unbiased-strata` (fork 143ada2) | fork `build/bin/strata-poly`, sha256 `7ba58112…` | 18091 | 06:35:57 |
Both engines are built from the same v0.1.45-poly.1 sources, once in upstream's tree and once in the fork's tree; the
binaries differ (different build directories and times), so an engine-build difference is not excluded by this run.
## Row 1: Qwen3.8 Flash-Next IQ3_XXS, MTP spec 4, 64K context, int8 KV
Median of 3 runs (range). tok/s unless noted. 45 requests per arm, all successful, nothing skipped.
| Workload | upstream | fork | fork / upstream |
| --- | --- | --- | --- |
| chat decode (9 requests) | 87.1 (72.5 - 107.0) | 103.1 (94.3 - 139.3) | 1.18 |
| chat TTFT s | 0.406 (0.361 - 0.478) | 0.346 (0.297 - 0.373) | 0.85 |
| prefill 4K | 1923.9 (1835.2 - 1933.9) | 2064.7 (2058.3 - 2075.5) | 1.07 |
| prefill 16K | 2342.1 (2326.5 - 2347.6) | 2531.0 (2406.6 - 2531.9) | 1.08 |
| prefill 32K | 2392.9 (2388.9 - 2395.0) | 2616.0 (2600.4 - 2617.4) | 1.09 |
| agent turn decode (15 turns) | 110.6 (70.0 - 135.6) | 116.8 (106.6 - 154.2) | 1.06 |
| agent turn TTFT s | 2.003 (1.641 - 2.261) | 1.914 (1.579 - 2.055) | 0.96 |
| sustained decode, 512 tokens (9 requests) | 105.1 (92.9 - 115.5) | 119.1 (113.3 - 130.2) | 1.13 |
| sustained prompt | 1776.7 | 1929.0 | 1.09 |
| draft acceptance % | 64.3 | 66.8 | |
## Row 2: Qwen3.6-35B-A3B UD-Q3_K_M (unsloth MTP file), draft on, 32K context
42 requests per arm, all successful; the 32K prompt is skipped by the client on both arms (context is 32768).
| Workload | upstream | fork | fork / upstream |
| --- | --- | --- | --- |
| chat decode (9 requests) | 220.8 (198.5 - 271.1) | 213.5 (196.5 - 259.2) | 0.97 |
| chat TTFT s | 0.178 (0.175 - 0.184) | 0.110 (0.107 - 0.117) | 0.62 |
| prefill 4K | 3651.6 (3598.4 - 3655.0) | 3821.6 (3792.1 - 3831.6) | 1.05 |
| prefill 16K | 3569.7 (3567.6 - 3589.4) | 3486.3 (3483.0 - 3497.4) | 0.98 |
| agent turn decode (15 turns) | 194.0 (174.1 - 223.7) | 186.9 (169.4 - 202.8) | 0.96 |
| agent turn TTFT s | 1.127 (0.565 - 1.278) | 1.069 (0.518 - 1.198) | 0.95 |
| sustained decode, 512 tokens (9 requests) | 207.6 (198.5 - 225.7) | 200.0 (188.4 - 218.4) | 0.96 |
| sustained prompt | 3381.8 | 3480.6 | 1.03 |
| draft acceptance % | 80.4 | 80.0 | |
## Reading
- Row 1: the fork is faster than upstream on every workload, by 6 to 18 % on decode and 7 to 9 % on prefill; the
chat and sustained ranges do not overlap. The engine binaries differ, so this is not attributed to the front end
yet (PLAN.md section 11 asks only that the fork is not slower).
- Row 2: decode is within the run-to-run range on chat, agent and sustained (ranges overlap). Prefill 16K is 2.3 %
slower with non-overlapping ranges (3483 - 3497 vs 3568 - 3589); prefill 4K is 4.7 % faster. Per the plan's pass
rule this one cell is a finding to explain, not a pass. Candidates: engine build differences (see above), the
fork's own `expert-profile.txt` written during the run versus upstream's.
- Chat TTFT is lower on the fork on both models (0.85x and 0.62x).
## What went wrong on the way (kept for the record)
- `fork-flash-next.attempt1-health-mismatch/`: the first fork arm (fork 4c25aa6f) served fine at 18 s but upstream's
client never considered it ready (`/health` lacked `service: "strata"` and `loaded: true`); killed after the 1800 s
wait. Fixed by fork commit 453d3015 (`143ada2` on the pod). `step9-launch.log` is that first campaign.
- The fork streams no `usage` block unless asked (`stream_options.include_usage`, llama.cpp's behaviour), upstream
always sends one; the client takes `prompt_tokens` from it, so `prompt_tokens` is null in the fork rows (the token
counts in `timings` are present). The runner's summary step crashed on it once (`step9-launch-2.log`), was made
tolerant, and the fork-flash-next summary was regenerated from the recorded data (`US2_SUMMARIZE_ONLY=1`). Fork
commit 96f4ef1f always sends the usage chunk; it was built on the pod after the campaign, so it is not what was
measured here.
- `server-exit.json` is 1 for both fork arms: on SIGTERM the front end logs `E srv operator(): ; shutting down so the
service manager can restart` and exits non-zero (the engine child dies with the process group, the front end
reports an engine death with an empty message). Harmless here; a clean SIGTERM exit is a fix to make before the
systemd unit uses `Restart=on-failure`.
## Files
Per arm: `server.json` (the client's config), `server-command.json`, `provenance.json` (engine sha256, fork commit,
GPU, CPU quota), `health.json`, `server.log` (upstream arms also `engine.log`), `community/` (the client's own
report and `results.json`), `sustained.json`, `summary.json`, `complete.json`, `server-exit.json`. The Qwen3.6 arms
also have the `expert-profile.txt` the engine wrote. Launch logs: `step9-launch.log` (first campaign, upstream
Flash-Next and the failed fork attempt), `step9-launch-2.log` (fork Flash-Next), `step9-launch-3.log` (Qwen3.6 arms).
@@ -0,0 +1,9 @@
{
"arm": "fork-flash-next",
"engine_binary": "/opt/us2-build/build/bin/strata",
"engine_sha256": "62b91d67a03c03898e2801ab595fcc6dede03bed94994e6109d05ff38c4be22d",
"fork_commit": "4c25aa6f6a99d6cb9f0a350bf1141865c158f593",
"nvidia_smi": "NVIDIA GeForce RTX 3090, 580.126.20, 24576 MiB",
"cpu_quota": "3112500/100000",
"started_utc": "2026-10-18T05:54:20Z"
}
@@ -0,0 +1,42 @@
[
"/opt/us2-build/build/bin/unbiased-strata",
"--engine",
"/opt/us2-build/build/bin/strata",
"-m",
"/opt/us2-models/IQ3_XXS/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00001-of-00002.gguf",
"--host",
"127.0.0.1",
"--port",
"18090",
"--alias",
"qwen3.8-flash-next-iq3_xxs",
"--",
"--pack",
"/opt/us2-models/pack-iq3-xxs",
"--native",
"/opt/us2-models/IQ3_XXS/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00001-of-00002.gguf",
"--ple-gguf",
"/opt/us2-models/IQ3_XXS/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00002-of-00002.gguf",
"--expert-profile",
"/opt/us2-models/pack-iq3-xxs/expert-profile.bin",
"--expert-cache",
"auto",
"--prefill",
"auto",
"--spec",
"4",
"--spec-min-p",
"0.5",
"--mtp",
"/opt/us2-models/mtp",
"--max-context",
"65536",
"--kv",
"int8",
"--ple-io",
"ram",
"--pool-workers",
"15",
"--kv-resident",
"32768"
]
@@ -0,0 +1,35 @@
{
"exe": "/opt/us2-build/build/bin/unbiased-strata",
"engine": "/opt/us2-build/build/bin/strata",
"model_name": "qwen3.8-flash-next-iq3_xxs",
"args": [
"--pack",
"/opt/us2-models/pack-iq3-xxs",
"--native",
"/opt/us2-models/IQ3_XXS/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00001-of-00002.gguf",
"--ple-gguf",
"/opt/us2-models/IQ3_XXS/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00002-of-00002.gguf",
"--expert-profile",
"/opt/us2-models/pack-iq3-xxs/expert-profile.bin",
"--expert-cache",
"auto",
"--prefill",
"auto",
"--spec",
"4",
"--spec-min-p",
"0.5",
"--mtp",
"/opt/us2-models/mtp",
"--max-context",
"65536",
"--kv",
"int8",
"--ple-io",
"ram",
"--pool-workers",
"15",
"--kv-resident",
"32768"
]
}
@@ -0,0 +1,13 @@
[
"/opt/polystrata-v0.1.45-poly.1/.venv/bin/python",
"/opt/polystrata-v0.1.45-poly.1/tools/strata_bench.py",
"--url",
"http://127.0.0.1:18090",
"--config",
"/opt/us2-results/step9/2026-10-17-rtx3090/fork-flash-next/server.json",
"--runs",
"3",
"--long",
"--out",
"/opt/us2-results/step9/2026-10-17-rtx3090/fork-flash-next/community"
]
@@ -0,0 +1,61 @@
# Community benchmark on NVIDIA GeForce RTX 3090
Measured on 2026-10-18 with `tools/strata_bench.py` (suite 1, 3 runs per test, medians with ranges). Speeds are the engine's own timings; first-token times are measured by the client over HTTP. Speed only: no correctness check was run.
## Hardware and software
- GPU and VRAM: NVIDIA GeForce RTX 3090, 24 GiB VRAM
- CPU: AMD EPYC 7H12 64-Core Processor (? cores, 256 threads); installed RAM: 1007.6 GiB; storage: not measured
- OS: Linux 6.8.0-107-generic; GPU driver: 580.126.20; CUDA: 13.0
- PolyStrata: project 0.1.45, commit d0cd84dc; engine b11062-3cf03257f
- Background workloads and power limits: not recorded
## Model and configuration
- Model and quantization: qwen3.8-flash-next-iq3_xxs
- Context: 65536 tokens; parallel slots: 1
- Settings: the install's own configuration, unchanged; thinking off for the suite; temperature 0
```text
unbiased-strata --pack pack-iq3-xxs --native Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00001-of-00002.gguf --ple-gguf Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00002-of-00002.gguf --expert-profile expert-profile.bin --expert-cache auto --prefill auto --spec 4 --spec-min-p 0.5 --mtp mtp --max-context 65536 --kv int8 --ple-io ram --pool-workers 15 --kv-resident 32768
```
## Method
Run by `python tools/strata_bench.py --long` against the HTTP API of a PolyStrata server (already running); model loading is not timed. One warm-up chat and a 1K prompt are discarded first. Every prompt starts with a unique tag, so the conversation cache cannot help the fresh-prompt tests.
- short chat: the three questions of `tools/ab_engine.py`, up to 100 new tokens, 3 runs
- 4K / 16K prompts: generated word lists sized by a calibration request, 24 new tokens, 3 fresh prompts each
- agent session: system prompt and four tools, then 5 turns that each add about 1500 words of a project file and continue from the model's own earlier answers (the way agent clients resend a conversation), 64 new tokens per turn, 3 sessions; the cache numbers come from the answer's usage (`cached_tokens`) and timings (`prompt_n`)
- concurrency (when run): N requests sent at the same moment, total tokens over the wall time of the burst, latency over all requests
## Results
| Configuration | Actual prompt tokens | Reused tokens | Generated tokens | Runs | Prompt tok/s median and range | Decode tok/s median and range | TTFT seconds median and range |
| --- | ---: | ---: | ---: | ---: | --- | --- | --- |
| short chat | not measured | 0 | 100 (100-100) | 9 | not measured | 103.1 (94.3-139.3) | 0.35 (0.30-0.37) |
| 4K prompt, fresh | not measured | 0 (0-0) | 24 cap | 3 | 2064.7 (2058.3-2075.5) | not measured | 1.93 (1.93-1.95) |
| 16K prompt, fresh | not measured | 0 (0-0) | 24 cap | 3 | 2531.0 (2406.6-2531.9) | not measured | 6.30 (6.30-6.62) |
| 32K prompt, fresh | not measured | 0 (0-0) | 24 cap | 3 | 2616.0 (2600.4-2617.4) | not measured | 12.13 (12.13-12.21) |
| agent session, follow-up turns | not measured at the last turn | see below | up to 64 | 3 | see below | 116.8 (106.6-154.2) | 1.91 (1.58-2.06) |
Ranges are the lowest and highest of the runs; `Runs` counts requests that returned a token.
### Agent session (conversation cache)
Cache hit over the follow-up turns: 3253000.0 % (3246900.0-3254000.0); earlier-turn tokens read again per session: 0 (0-0) (earlier turns that the cache did not hold; the 14408 (14407-14408) new tokens of the files are read once); first turn (nothing cached) first token: 0.89 s (0.83-0.90).
| Turn (run 1) | Prompt tokens | Reused | Read | Prompt tok/s | First token (s) | Decode tok/s |
| ---: | ---: | ---: | ---: | ---: | ---: | ---: |
| 0 | None | 0 | 645 | 790.7716337341952 | 0.828 | 78.90880396798558 |
| 1 | None | 662 | 3556 | 1783.488686432496 | 2.009 | 109.23390620448588 |
| 2 | None | 4281 | 1598 | 1025.1120374326267 | 1.591 | 113.27919906212014 |
| 3 | None | 5872 | 3443 | 1697.4011472124512 | 2.055 | 108.76291559622705 |
| 4 | None | 9373 | 2922 | 1582.8270309155043 | 1.903 | 138.7945329563966 |
| 5 | None | 12352 | 2889 | 1560.5815151307265 | 1.92 | 123.79204508388385 |
Per-request data: `results.json`. Engine log lines from the start: `engine-log-excerpt.txt` (when this run started the server).
## Correctness and limitations
Not measured: this is a speed suite. The conversation uses the model's own replies, so token counts differ a little between runs. Machine details come from the server, `nvidia-smi`/`rocm-smi` and the OS; background load and power limits are not recorded. Total time of the suite: 117 s.
@@ -0,0 +1,933 @@
{
"schema": 1,
"tool": "tools/strata_bench.py",
"date": "2026-10-18",
"params": {
"runs": 3,
"think": false,
"clients": 0,
"long": true,
"started_server": false,
"command": "python tools/strata_bench.py --long"
},
"elapsed_s": 116.55190896987915,
"machine": {
"gpu": [
"NVIDIA GeForce RTX 3090"
],
"gpu_vram_mib": 24576,
"gpu_driver": "580.126.20",
"cuda": "13.0",
"cpu": "AMD EPYC 7H12 64-Core Processor",
"cpu_cores": null,
"cpu_threads": 256,
"ram_gib": 1007.6,
"os": "Linux 6.8.0-107-generic",
"python": "3.12.3",
"strata_version": "0.1.45",
"strata_commit": "d0cd84dc",
"engine_version": "b11062-3cf03257f",
"model": "qwen3.8-flash-next-iq3_xxs",
"quant": "IQ3",
"context": 65536,
"parallel_slots": 1,
"config": {
"exe": "unbiased-strata",
"engine": "strata",
"model_name": "qwen3.8-flash-next-iq3_xxs",
"args": [
"--pack",
"pack-iq3-xxs",
"--native",
"Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00001-of-00002.gguf",
"--ple-gguf",
"Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00002-of-00002.gguf",
"--expert-profile",
"expert-profile.bin",
"--expert-cache",
"auto",
"--prefill",
"auto",
"--spec",
"4",
"--spec-min-p",
"0.5",
"--mtp",
"mtp",
"--max-context",
"65536",
"--kv",
"int8",
"--ple-io",
"ram",
"--pool-workers",
"15",
"--kv-resident",
"32768"
]
},
"launch": "unbiased-strata --pack pack-iq3-xxs --native Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00001-of-00002.gguf --ple-gguf Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00002-of-00002.gguf --expert-profile expert-profile.bin --expert-cache auto --prefill auto --spec 4 --spec-min-p 0.5 --mtp mtp --max-context 65536 --kv int8 --ple-io ram --pool-workers 15 --kv-resident 32768",
"engine_info": {},
"vram_after": {}
},
"results": {
"chat": {
"requests": [
{
"ok": true,
"err": null,
"ttft_s": 0.373,
"total_s": 1.201,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 51,
"generated_tokens": 100,
"prompt_tps": 138.3448530289385,
"prompt_tps_source": "engine",
"decode_tps": 119.52162375558673,
"decode_tps_source": "engine",
"prompt_ms": 368.644,
"decode_ms": 828.302,
"drafts_offered": 87,
"drafts_accepted": 70,
"run": 0,
"prompt": 0
},
{
"ok": true,
"err": null,
"ttft_s": 0.353,
"total_s": 1.403,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 43,
"generated_tokens": 100,
"prompt_tps": 123.46281615812428,
"prompt_tps_source": "engine",
"decode_tps": 94.33261106950312,
"decode_tps_source": "engine",
"prompt_ms": 348.283,
"decode_ms": 1049.478,
"drafts_offered": 100,
"drafts_accepted": 50,
"run": 0,
"prompt": 1
},
{
"ok": true,
"err": null,
"ttft_s": 0.351,
"total_s": 1.393,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 46,
"generated_tokens": 100,
"prompt_tps": 132.87117273252457,
"prompt_tps_source": "engine",
"decode_tps": 95.02573853716034,
"decode_tps_source": "engine",
"prompt_ms": 346.2,
"decode_ms": 1041.823,
"drafts_offered": 100,
"drafts_accepted": 51,
"run": 0,
"prompt": 2
},
{
"ok": true,
"err": null,
"ttft_s": 0.347,
"total_s": 1.058,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 51,
"generated_tokens": 100,
"prompt_tps": 149.08880430778947,
"prompt_tps_source": "engine",
"decode_tps": 139.3041826432617,
"decode_tps_source": "engine",
"prompt_ms": 342.078,
"decode_ms": 710.675,
"drafts_offered": 87,
"drafts_accepted": 71,
"run": 1,
"prompt": 0
},
{
"ok": true,
"err": null,
"ttft_s": 0.307,
"total_s": 1.287,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 43,
"generated_tokens": 100,
"prompt_tps": 142.23433603027277,
"prompt_tps_source": "engine",
"decode_tps": 101.0688799730483,
"decode_tps_source": "engine",
"prompt_ms": 302.318,
"decode_ms": 979.53,
"drafts_offered": 106,
"drafts_accepted": 52,
"run": 1,
"prompt": 1
},
{
"ok": true,
"err": null,
"ttft_s": 0.322,
"total_s": 1.303,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 46,
"generated_tokens": 100,
"prompt_tps": 144.9494567546447,
"prompt_tps_source": "engine",
"decode_tps": 100.94233235925681,
"decode_tps_source": "engine",
"prompt_ms": 317.352,
"decode_ms": 980.758,
"drafts_offered": 97,
"drafts_accepted": 49,
"run": 1,
"prompt": 2
},
{
"ok": true,
"err": null,
"ttft_s": 0.346,
"total_s": 1.07,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 51,
"generated_tokens": 100,
"prompt_tps": 149.5811727163941,
"prompt_tps_source": "engine",
"decode_tps": 136.61824308939387,
"decode_tps_source": "engine",
"prompt_ms": 340.952,
"decode_ms": 724.647,
"drafts_offered": 85,
"drafts_accepted": 71,
"run": 2,
"prompt": 0
},
{
"ok": true,
"err": null,
"ttft_s": 0.297,
"total_s": 1.187,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 43,
"generated_tokens": 100,
"prompt_tps": 146.9497671017063,
"prompt_tps_source": "engine",
"decode_tps": 111.30649085487882,
"decode_tps_source": "engine",
"prompt_ms": 292.617,
"decode_ms": 889.436,
"drafts_offered": 95,
"drafts_accepted": 55,
"run": 2,
"prompt": 1
},
{
"ok": true,
"err": null,
"ttft_s": 0.314,
"total_s": 1.275,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 46,
"generated_tokens": 100,
"prompt_tps": 148.37895986349136,
"prompt_tps_source": "engine",
"decode_tps": 103.14659631860421,
"decode_tps_source": "engine",
"prompt_ms": 310.017,
"decode_ms": 959.799,
"drafts_offered": 100,
"drafts_accepted": 51,
"run": 2,
"prompt": 2
}
],
"decode_tps": {
"median": 103.147,
"min": 94.333,
"max": 139.304,
"n": 9
},
"ttft_s": {
"median": 0.346,
"min": 0.297,
"max": 0.373,
"n": 9
},
"generated_tokens": {
"median": 100,
"min": 100,
"max": 100,
"n": 9
},
"prompt_tokens": null
},
"prompts": {
"4K": {
"target_tokens": 4096,
"requests": [
{
"ok": true,
"err": null,
"ttft_s": 1.946,
"total_s": 2.188,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 3939,
"generated_tokens": 24,
"prompt_tps": 2058.3120482582467,
"prompt_tps_source": "engine",
"decode_tps": 95.02326004147973,
"decode_tps_source": "engine",
"prompt_ms": 1913.704,
"decode_ms": 242.046,
"drafts_offered": 21,
"drafts_accepted": 13,
"run": 0
},
{
"ok": true,
"err": null,
"ttft_s": 1.93,
"total_s": 2.199,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 3939,
"generated_tokens": 24,
"prompt_tps": 2075.4605636147894,
"prompt_tps_source": "engine",
"decode_tps": 85.68916441887845,
"decode_tps_source": "engine",
"prompt_ms": 1897.892,
"decode_ms": 268.412,
"drafts_offered": 20,
"drafts_accepted": 8,
"run": 1
},
{
"ok": true,
"err": null,
"ttft_s": 1.931,
"total_s": 2.14,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 3939,
"generated_tokens": 24,
"prompt_tps": 2064.671010215902,
"prompt_tps_source": "engine",
"decode_tps": 110.30751817676061,
"decode_tps_source": "engine",
"prompt_ms": 1907.81,
"decode_ms": 208.508,
"drafts_offered": 18,
"drafts_accepted": 12,
"run": 2
}
],
"prompt_tps": {
"median": 2064.671,
"min": 2058.312,
"max": 2075.461,
"n": 3
},
"ttft_s": {
"median": 1.931,
"min": 1.93,
"max": 1.946,
"n": 3
},
"prompt_tokens": null,
"reused_tokens": {
"median": 0,
"min": 0,
"max": 0,
"n": 3
}
},
"16K": {
"target_tokens": 16384,
"requests": [
{
"ok": true,
"err": null,
"ttft_s": 6.305,
"total_s": 6.545,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 15716,
"generated_tokens": 24,
"prompt_tps": 2531.044999809157,
"prompt_tps_source": "engine",
"decode_tps": 95.74277662377668,
"decode_tps_source": "engine",
"prompt_ms": 6209.293,
"decode_ms": 240.227,
"drafts_offered": 21,
"drafts_accepted": 12,
"run": 0
},
{
"ok": true,
"err": null,
"ttft_s": 6.621,
"total_s": 6.864,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 15716,
"generated_tokens": 24,
"prompt_tps": 2406.6065607132964,
"prompt_tps_source": "engine",
"decode_tps": 94.80470231323473,
"decode_tps_source": "engine",
"prompt_ms": 6530.357,
"decode_ms": 242.604,
"drafts_offered": 21,
"drafts_accepted": 12,
"run": 1
},
{
"ok": true,
"err": null,
"ttft_s": 6.298,
"total_s": 6.524,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 15716,
"generated_tokens": 24,
"prompt_tps": 2531.8866115620995,
"prompt_tps_source": "engine",
"decode_tps": 101.99104252583035,
"decode_tps_source": "engine",
"prompt_ms": 6207.229,
"decode_ms": 225.51,
"drafts_offered": 22,
"drafts_accepted": 11,
"run": 2
}
],
"prompt_tps": {
"median": 2531.045,
"min": 2406.607,
"max": 2531.887,
"n": 3
},
"ttft_s": {
"median": 6.305,
"min": 6.298,
"max": 6.621,
"n": 3
},
"prompt_tokens": null,
"reused_tokens": {
"median": 0,
"min": 0,
"max": 0,
"n": 3
}
},
"32K": {
"target_tokens": 32768,
"requests": [
{
"ok": true,
"err": null,
"ttft_s": 12.209,
"total_s": 12.483,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 31373,
"generated_tokens": 24,
"prompt_tps": 2600.4485738562457,
"prompt_tps_source": "engine",
"decode_tps": 84.36651749688211,
"decode_tps_source": "engine",
"prompt_ms": 12064.457,
"decode_ms": 272.62,
"drafts_offered": 13,
"drafts_accepted": 10,
"run": 0
},
{
"ok": true,
"err": null,
"ttft_s": 12.129,
"total_s": 12.4,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 31373,
"generated_tokens": 24,
"prompt_tps": 2617.3629448882957,
"prompt_tps_source": "engine",
"decode_tps": 85.3042952567103,
"decode_tps_source": "engine",
"prompt_ms": 11986.492,
"decode_ms": 269.623,
"drafts_offered": 20,
"drafts_accepted": 11,
"run": 1
},
{
"ok": true,
"err": null,
"ttft_s": 12.131,
"total_s": 12.372,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 31373,
"generated_tokens": 24,
"prompt_tps": 2615.9565931144803,
"prompt_tps_source": "engine",
"decode_tps": 95.68382735309413,
"decode_tps_source": "engine",
"prompt_ms": 11992.936,
"decode_ms": 240.375,
"drafts_offered": 14,
"drafts_accepted": 10,
"run": 2
}
],
"prompt_tps": {
"median": 2615.957,
"min": 2600.449,
"max": 2617.363,
"n": 3
},
"ttft_s": {
"median": 12.131,
"min": 12.129,
"max": 12.209,
"n": 3
},
"prompt_tokens": null,
"reused_tokens": {
"median": 0,
"min": 0,
"max": 0,
"n": 3
}
}
},
"agent": {
"sessions": [
[
{
"ok": true,
"err": null,
"ttft_s": 0.828,
"total_s": 1.006,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 645,
"generated_tokens": 14,
"prompt_tps": 790.7716337341952,
"prompt_tps_source": "engine",
"decode_tps": 78.90880396798558,
"decode_tps_source": "engine",
"prompt_ms": 815.659,
"decode_ms": 177.42,
"drafts_offered": 20,
"drafts_accepted": 10,
"run": 0,
"turn": 0
},
{
"ok": true,
"err": null,
"ttft_s": 2.009,
"total_s": 2.586,
"prompt_tokens": null,
"reused_tokens": 662,
"read_tokens": 3556,
"generated_tokens": 64,
"prompt_tps": 1783.488686432496,
"prompt_tps_source": "engine",
"decode_tps": 109.23390620448588,
"decode_tps_source": "engine",
"prompt_ms": 1993.845,
"decode_ms": 576.744,
"drafts_offered": 56,
"drafts_accepted": 44,
"run": 0,
"turn": 1
},
{
"ok": true,
"err": null,
"ttft_s": 1.591,
"total_s": 2.147,
"prompt_tokens": null,
"reused_tokens": 4281,
"read_tokens": 1598,
"generated_tokens": 64,
"prompt_tps": 1025.1120374326267,
"prompt_tps_source": "engine",
"decode_tps": 113.27919906212014,
"decode_tps_source": "engine",
"prompt_ms": 1558.854,
"decode_ms": 556.148,
"drafts_offered": 62,
"drafts_accepted": 43,
"run": 0,
"turn": 2
},
{
"ok": true,
"err": null,
"ttft_s": 2.055,
"total_s": 2.589,
"prompt_tokens": null,
"reused_tokens": 5872,
"read_tokens": 3443,
"generated_tokens": 58,
"prompt_tps": 1697.4011472124512,
"prompt_tps_source": "engine",
"decode_tps": 108.76291559622705,
"decode_tps_source": "engine",
"prompt_ms": 2028.395,
"decode_ms": 533.27,
"drafts_offered": 62,
"drafts_accepted": 35,
"run": 0,
"turn": 3
},
{
"ok": true,
"err": null,
"ttft_s": 1.903,
"total_s": 2.315,
"prompt_tokens": null,
"reused_tokens": 9373,
"read_tokens": 2922,
"generated_tokens": 57,
"prompt_tps": 1582.8270309155043,
"prompt_tps_source": "engine",
"decode_tps": 138.7945329563966,
"decode_tps_source": "engine",
"prompt_ms": 1846.064,
"decode_ms": 410.679,
"drafts_offered": 51,
"drafts_accepted": 40,
"run": 0,
"turn": 4
},
{
"ok": true,
"err": null,
"ttft_s": 1.92,
"total_s": 2.429,
"prompt_tokens": null,
"reused_tokens": 12352,
"read_tokens": 2889,
"generated_tokens": 64,
"prompt_tps": 1560.5815151307265,
"prompt_tps_source": "engine",
"decode_tps": 123.79204508388385,
"decode_tps_source": "engine",
"prompt_ms": 1851.233,
"decode_ms": 508.918,
"drafts_offered": 58,
"drafts_accepted": 44,
"run": 0,
"turn": 5
}
],
[
{
"ok": true,
"err": null,
"ttft_s": 0.903,
"total_s": 1.009,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 645,
"generated_tokens": 9,
"prompt_tps": 725.6934873228662,
"prompt_tps_source": "engine",
"decode_tps": 85.3209965492397,
"decode_tps_source": "engine",
"prompt_ms": 888.805,
"decode_ms": 105.484,
"drafts_offered": 12,
"drafts_accepted": 7,
"run": 1,
"turn": 0
},
{
"ok": true,
"err": null,
"ttft_s": 2.014,
"total_s": 2.56,
"prompt_tokens": null,
"reused_tokens": 657,
"read_tokens": 3556,
"generated_tokens": 64,
"prompt_tps": 1789.638916694724,
"prompt_tps_source": "engine",
"decode_tps": 115.47090133286412,
"decode_tps_source": "engine",
"prompt_ms": 1986.993,
"decode_ms": 545.592,
"drafts_offered": 64,
"drafts_accepted": 40,
"run": 1,
"turn": 1
},
{
"ok": true,
"err": null,
"ttft_s": 1.589,
"total_s": 2.138,
"prompt_tokens": null,
"reused_tokens": 4206,
"read_tokens": 1668,
"generated_tokens": 64,
"prompt_tps": 1074.042617856538,
"prompt_tps_source": "engine",
"decode_tps": 114.94882040615249,
"decode_tps_source": "engine",
"prompt_ms": 1553.011,
"decode_ms": 548.07,
"drafts_offered": 66,
"drafts_accepted": 39,
"run": 1,
"turn": 2
},
{
"ok": true,
"err": null,
"ttft_s": 2.009,
"total_s": 2.363,
"prompt_tokens": null,
"reused_tokens": 5938,
"read_tokens": 3372,
"generated_tokens": 43,
"prompt_tps": 1719.423004064508,
"prompt_tps_source": "engine",
"decode_tps": 122.03878562893966,
"decode_tps_source": "engine",
"prompt_ms": 1961.123,
"decode_ms": 352.347,
"drafts_offered": 47,
"drafts_accepted": 27,
"run": 1,
"turn": 3
},
{
"ok": true,
"err": null,
"ttft_s": 1.902,
"total_s": 2.198,
"prompt_tokens": null,
"reused_tokens": 9353,
"read_tokens": 2922,
"generated_tokens": 40,
"prompt_tps": 1586.234825725884,
"prompt_tps_source": "engine",
"decode_tps": 135.68060784912316,
"decode_tps_source": "engine",
"prompt_ms": 1842.098,
"decode_ms": 294.81,
"drafts_offered": 39,
"drafts_accepted": 27,
"run": 1,
"turn": 4
},
{
"ok": true,
"err": null,
"ttft_s": 1.914,
"total_s": 2.126,
"prompt_tokens": null,
"reused_tokens": 12315,
"read_tokens": 2889,
"generated_tokens": 24,
"prompt_tps": 1569.4024645431298,
"prompt_tps_source": "engine",
"decode_tps": 113.71712864250178,
"decode_tps_source": "engine",
"prompt_ms": 1840.828,
"decode_ms": 211.05,
"drafts_offered": 26,
"drafts_accepted": 14,
"run": 1,
"turn": 5
}
],
[
{
"ok": true,
"err": null,
"ttft_s": 0.893,
"total_s": 0.996,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 645,
"generated_tokens": 9,
"prompt_tps": 733.4262718976069,
"prompt_tps_source": "engine",
"decode_tps": 87.63473841030586,
"decode_tps_source": "engine",
"prompt_ms": 879.434,
"decode_ms": 102.699,
"drafts_offered": 12,
"drafts_accepted": 7,
"run": 2,
"turn": 0
},
{
"ok": true,
"err": null,
"ttft_s": 2.001,
"total_s": 2.437,
"prompt_tokens": null,
"reused_tokens": 657,
"read_tokens": 3556,
"generated_tokens": 64,
"prompt_tps": 1801.6155769830941,
"prompt_tps_source": "engine",
"decode_tps": 144.46327307915442,
"decode_tps_source": "engine",
"prompt_ms": 1973.784,
"decode_ms": 436.097,
"drafts_offered": 57,
"drafts_accepted": 47,
"run": 2,
"turn": 1
},
{
"ok": true,
"err": null,
"ttft_s": 1.579,
"total_s": 2.171,
"prompt_tokens": null,
"reused_tokens": 4206,
"read_tokens": 1668,
"generated_tokens": 64,
"prompt_tps": 1080.8660147342514,
"prompt_tps_source": "engine",
"decode_tps": 106.5658069230561,
"decode_tps_source": "engine",
"prompt_ms": 1543.207,
"decode_ms": 591.184,
"drafts_offered": 78,
"drafts_accepted": 36,
"run": 2,
"turn": 2
},
{
"ok": true,
"err": null,
"ttft_s": 2.013,
"total_s": 2.553,
"prompt_tokens": null,
"reused_tokens": 5937,
"read_tokens": 3373,
"generated_tokens": 64,
"prompt_tps": 1717.416939749368,
"prompt_tps_source": "engine",
"decode_tps": 116.8274125324289,
"decode_tps_source": "engine",
"prompt_ms": 1963.996,
"decode_ms": 539.257,
"drafts_offered": 67,
"drafts_accepted": 38,
"run": 2,
"turn": 3
},
{
"ok": true,
"err": null,
"ttft_s": 1.882,
"total_s": 2.272,
"prompt_tokens": null,
"reused_tokens": 9374,
"read_tokens": 2922,
"generated_tokens": 60,
"prompt_tps": 1604.5679116070885,
"prompt_tps_source": "engine",
"decode_tps": 154.2305438168975,
"decode_tps_source": "engine",
"prompt_ms": 1821.051,
"decode_ms": 389.028,
"drafts_offered": 50,
"drafts_accepted": 43,
"run": 2,
"turn": 4
},
{
"ok": true,
"err": null,
"ttft_s": 1.885,
"total_s": 2.383,
"prompt_tokens": null,
"reused_tokens": 12356,
"read_tokens": 2889,
"generated_tokens": 64,
"prompt_tps": 1591.9048141207302,
"prompt_tps_source": "engine",
"decode_tps": 126.67619754248177,
"decode_tps_source": "engine",
"prompt_ms": 1814.807,
"decode_ms": 497.331,
"drafts_offered": 61,
"drafts_accepted": 44,
"run": 2,
"turn": 5
}
]
],
"hit_pct": {
"median": 3253000.0,
"min": 3246900.0,
"max": 3254000.0,
"n": 3
},
"reread_tokens": {
"median": 0,
"min": 0,
"max": 0,
"n": 3
},
"new_tokens": {
"median": 14408,
"min": 14407,
"max": 14408,
"n": 3
},
"turn_ttft_s": {
"median": 1.914,
"min": 1.579,
"max": 2.055,
"n": 15
},
"last_turn_prompt_tokens": null,
"turn_decode_tps": {
"median": 116.827,
"min": 106.566,
"max": 154.231,
"n": 15
},
"first_turn_ttft_s": {
"median": 0.893,
"min": 0.828,
"max": 0.903,
"n": 3
}
},
"clients": {},
"skipped": {},
"failures": []
}
}
@@ -0,0 +1,5 @@
{
"complete": true,
"bench_seconds": 116.70975160598755,
"finished_utc": "2026-10-18T06:32:33Z"
}
@@ -0,0 +1,8 @@
{
"status": "ok",
"busy": false,
"service": "strata",
"loaded": true,
"model": "qwen3.8-flash-next-iq3_xxs",
"max_context": 65536
}
@@ -0,0 +1,9 @@
{
"arm": "fork-flash-next",
"engine_binary": "/opt/us2-build/build/bin/strata",
"engine_sha256": "62b91d67a03c03898e2801ab595fcc6dede03bed94994e6109d05ff38c4be22d",
"fork_commit": "143ada26fe968d27686cab50ad76c9c171eb748d",
"nvidia_smi": "NVIDIA GeForce RTX 3090, 580.126.20, 24576 MiB",
"cpu_quota": "3112500/100000",
"started_utc": "2026-10-18T06:29:25Z"
}
@@ -0,0 +1,42 @@
[
"/opt/us2-build/build/bin/unbiased-strata",
"--engine",
"/opt/us2-build/build/bin/strata",
"-m",
"/opt/us2-models/IQ3_XXS/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00001-of-00002.gguf",
"--host",
"127.0.0.1",
"--port",
"18090",
"--alias",
"qwen3.8-flash-next-iq3_xxs",
"--",
"--pack",
"/opt/us2-models/pack-iq3-xxs",
"--native",
"/opt/us2-models/IQ3_XXS/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00001-of-00002.gguf",
"--ple-gguf",
"/opt/us2-models/IQ3_XXS/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00002-of-00002.gguf",
"--expert-profile",
"/opt/us2-models/pack-iq3-xxs/expert-profile.bin",
"--expert-cache",
"auto",
"--prefill",
"auto",
"--spec",
"4",
"--spec-min-p",
"0.5",
"--mtp",
"/opt/us2-models/mtp",
"--max-context",
"65536",
"--kv",
"int8",
"--ple-io",
"ram",
"--pool-workers",
"15",
"--kv-resident",
"32768"
]
@@ -0,0 +1 @@
{"returncode": 1}
@@ -0,0 +1,35 @@
{
"exe": "/opt/us2-build/build/bin/unbiased-strata",
"engine": "/opt/us2-build/build/bin/strata",
"model_name": "qwen3.8-flash-next-iq3_xxs",
"args": [
"--pack",
"/opt/us2-models/pack-iq3-xxs",
"--native",
"/opt/us2-models/IQ3_XXS/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00001-of-00002.gguf",
"--ple-gguf",
"/opt/us2-models/IQ3_XXS/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00002-of-00002.gguf",
"--expert-profile",
"/opt/us2-models/pack-iq3-xxs/expert-profile.bin",
"--expert-cache",
"auto",
"--prefill",
"auto",
"--spec",
"4",
"--spec-min-p",
"0.5",
"--mtp",
"/opt/us2-models/mtp",
"--max-context",
"65536",
"--kv",
"int8",
"--ple-io",
"ram",
"--pool-workers",
"15",
"--kv-resident",
"32768"
]
}
@@ -0,0 +1,184 @@
{
"checks": {
"requests": 45,
"all_successful": true,
"skipped": {},
"failures": []
},
"sustained": {
"decode_tps": {
"median": 119.11607943527324,
"min": 113.31778965113644,
"max": 130.21188352891025,
"n": 9
},
"prompt_tps": {
"median": 1928.9791374505783,
"min": 1178.2302509227504,
"max": 2047.0140075286968,
"n": 9
},
"ttft_s": {
"median": 2.288,
"min": 1.424,
"max": 2.501,
"n": 9
},
"total_s": {
"median": 6.582,
"min": 5.349,
"max": 6.877,
"n": 9
},
"draft_acceptance_pct": 66.82312252964427
},
"chat": {
"median": 103.147,
"min": 94.333,
"max": 139.304,
"n": 9
},
"chat_ttft_s": {
"median": 0.346,
"min": 0.297,
"max": 0.373,
"n": 9
},
"prefill": {
"4K": {
"median": 2064.671,
"min": 2058.312,
"max": 2075.461,
"n": 3
},
"16K": {
"median": 2531.045,
"min": 2406.607,
"max": 2531.887,
"n": 3
},
"32K": {
"median": 2615.957,
"min": 2600.449,
"max": 2617.363,
"n": 3
}
},
"prefill_ttft_s": {
"4K": {
"median": 1.931,
"min": 1.93,
"max": 1.946,
"n": 3
},
"16K": {
"median": 6.305,
"min": 6.298,
"max": 6.621,
"n": 3
},
"32K": {
"median": 12.131,
"min": 12.129,
"max": 12.209,
"n": 3
}
},
"agent": {
"turn_decode_tps": {
"median": 116.827,
"min": 106.566,
"max": 154.231,
"n": 15
},
"turn_ttft_s": {
"median": 1.914,
"min": 1.579,
"max": 2.055,
"n": 15
}
},
"per_document": {
"docs/DETAILS.md": {
"prompt_tokens": null,
"decode_tps": {
"median": 120.25920447712545,
"min": 116.77731183655746,
"max": 122.04214968051706,
"n": 3
},
"prompt_tps": {
"median": 2043.810751545814,
"min": 2036.5390938449962,
"max": 2047.0140075286968,
"n": 3
},
"ttft_s": {
"median": 2.492,
"min": 2.489,
"max": 2.501,
"n": 3
},
"total_s": {
"median": 6.739,
"min": 6.679,
"max": 6.877,
"n": 3
}
},
"docs/HOW_IT_WORKS.md": {
"prompt_tokens": null,
"decode_tps": {
"median": 128.83212543761323,
"min": 118.68653260895064,
"max": 130.21188352891025,
"n": 3
},
"prompt_tps": {
"median": 1200.44365452987,
"min": 1178.2302509227504,
"max": 1201.8813411465069,
"n": 3
},
"ttft_s": {
"median": 1.425,
"min": 1.424,
"max": 1.452,
"n": 3
},
"total_s": {
"median": 5.392,
"min": 5.349,
"max": 5.758,
"n": 3
}
},
"docs/INSTALL.md": {
"prompt_tokens": null,
"decode_tps": {
"median": 118.78301110051645,
"min": 113.31778965113644,
"max": 119.11607943527324,
"n": 3
},
"prompt_tps": {
"median": 1928.9791374505783,
"min": 1903.929545021834,
"max": 1936.0449481410203,
"n": 3
},
"ttft_s": {
"median": 2.288,
"min": 2.28,
"max": 2.318,
"n": 3
},
"total_s": {
"median": 6.582,
"min": 6.579,
"max": 6.828,
"n": 3
}
}
}
}
@@ -0,0 +1,443 @@
[
{
"run": 0,
"source": "docs/HOW_IT_WORKS.md",
"messages": [
{
"role": "user",
"content": "Run identifier 0-0. Read the following project documentation and write a detailed technical explanation of its design, tradeoffs, and how someone would use it in practice.\n\n# How does PolyStrata work?\n\nModels like Qwen3.8-Flash-Next normally run on servers with hundreds of gigabytes of graphics memory. Your graphics\ncard has 12-24 GB. PolyStrata makes it fit by **sharing the work across your whole PC** - the same idea as a kitchen, where\nthe things you use all the time stay on the counter and the rest waits in the pantry. Back to the\n[README](../README.md#how-does-it-work).\n\n## Who does what\n\n<p align=\"center\"><img src=\"media/how-it-works.svg\" width=\"860\" alt=\"The model's 24,576 experts: the busiest on the graphics card, all of them in RAM, a lookup table on the SSD\"></p>\n\n- **The model is a team of 24,576 small specialists (\"experts\"),** and each word it writes needs only 10 of them.\n So it doesn't have to have all of them on the graphics card at once.\n- **Your graphics card** does the part of the work needed for every word, and keeps the few thousand experts that\n are asked most often. It keeps learning which ones those are while you use it.\n- **Your RAM** holds every expert. When a word needs one the card doesn't have, **your processor** works on it -\n at the same time as the graphics card, so neither waits for the other.\n- **Your SSD** holds a big lookup table; the model only reads a few small rows of it per word.\n\nThe same in technical terms:\n\n- **GPU (VRAM):** attention and DeltaNet mixers, the gated-residual weights, routers, shared experts, output head, the\n MTP draft layer, the KV cache (from 64K: only its most-read part, the rest streams from RAM), and an **expert\n cache** that fills the rest of VRAM with the most-used experts (it adapts to the conversation while you chat).\n More VRAM matters more than a faster GPU: every extra GB holds ~700 more experts, and every expert on the GPU is one\n the CPU does not have to compute.\n- **RAM:** all 24,576 experts, pinned. The CPU computes the experts that are not on the GPU **in place**, at the same\n time as the GPU works on the cached ones (AVX-512 / AVX2 kernels, ggml's for the i-quants). On a PC with little RAM\n and a big card, the [low-RAM mode](MODELS.md#a-big-graphics-card-and-little-ram) keeps in RAM only what the GPU does\n not hold.\n- **SSD:** the 28.8 GB n-gram table, read a few rows per token through the OS cache.\n\nThis works the same on NVIDIA (CUDA) and AMD (HIP) cards: the same engine, compiled for each.\n\n## Guess, then check\n\n<p align=\"center\"><img src=\"media/guess-and-check.svg\" width=\"860\" alt=\"A small helper guesses the next words; the big model checks them all at once and keeps the right ones\"></p>\n\n- **Guess, then check.** A small, fast helper built into the model guesses the next few words, and the big model\n checks all the guesses in one go. It keeps the ones it agrees with and writes the next word itself - so one step\n often produces several words. The helper only guesses - the big model decides every word - so you get the same\n quality answer, 1.6-1.8x sooner.\n- In technical terms: the model's own MTP layer drafts up to 3 tokens; one pass over all 48 layers checks them, 2.4-3.2\n tokens per pass on average. When the reply repeats the context (code edits, quoted text), **prompt lookup** drafts\n up to 5 tokens from the earlier copy, but only where its measured acceptance and cost say it pays: code edits 6-11%\n faster, other text unchanged. The drafts are checked like the MTP's, so the output is the same.\n\n## Reading long texts\n\n**Long texts are read in big pieces** (up to 8,192 tokens - pieces of words - at a time), which is why a long\ndocument or code base is read at over 1,000 tokens per second. The experts of the next layer stream to the GPU over\nPCIe while the current layer's attention runs. After the first message, PolyStrata keeps the conversation and reads only\nwhat is new, so follow-ups start in seconds.\n\n## More\n\nThe [details](DETAILS.md#how-it-works) explain every part and its numbers, and the\n[paper](paper/Strata-Paper.pdf) tells the whole story, with the measurements behind it.\n\n## Credits\n\n- PolyStrata is built on [Strata](https://github.com/Niko1221/Strata) by Niko1221 and its contributors. The Qwen\n engine, the installer, the server and the web app are that project's work. PolyStrata adds the engine for GLM 5.3\n Flash ([GLM.md](GLM.md)), whose file is from\n [neuralll](https://huggingface.co/neuralll/GLM-5.3-Flash-GSQ-RCO-3.0bit-Q4Kattn-GGUF).\n- Model: [Qwen3.8-Flash-Next](https://huggingface.co/Qwen/Qwen3.8-Flash-Next) by the Qwen team; compressed versions by\n [ISTA-DASLab](https://huggingface.co/ISTA-DASLab/Qwen3.8-Flash-Next-GSQ-RCO-GGUF);\n [Swift 1.5](https://huggingface.co/ukisai/Swift-1.5-Qwen3.8-Flash-Next-GSQ-RCO-GGUF) by UkisAI; the experimental\n [UD-Q4_K_XL](https://huggingface.co/unsloth/Line truncated
}
],
"response": {
"first": 1.4522951785475016,
"total": 5.757850904017687,
"text": "# PolyStrata: Technical Design, Tradeoffs, and Practical Usage\n\n## Executive Summary\n\nPolyStrata is an inference engine designed to run massive Mixture-of-Experts (MoE) models\u2014specifically targeting **Qwen3.8-Flash-Next** (and variants like GLM 5.3 Flash)\u2014on consumer hardware with limited VRAM (12\u201324 GB). It achieves this by **stratifying model weights across GPU VRAM, system RAM, and SSD**, leveraging the sparse nature of MoE architectures to minimize memory footprint while maximizing throughput through speculative decoding and parallel CPU/GPU execution.\n\n---\n\n## 1. Core Architecture: The \"Kitchen\" Analogy\n\n### The Problem\nQwen3.8-Flash-Next is a MoE model with **24,576 experts**. A standard dense model would require hundreds of GBs of VRAM. However, MoE models are **sparse**: for any given token, only a small subset of experts (e.g., 10 out of 24,576) are activated.\n\n### The Solution: Hierarchical Memory Stratification\nPolyStrata treats memory like a kitchen:\n- **Counter (GPU VRAM):** Frequently used items (hot experts, attention layers, KV cache).\n- **Pantry (System RAM):** All experts, pinned in memory for fast CPU access.\n- **Storage (SSD):** Large, rarely accessed lookup tables (n-gram tables).\n\nThis allows a 12\u201324 GB GPU to run a model that would otherwise require >100 GB VRAM.\n\n---\n\n## 2. Component Breakdown: Who Does What?\n\n### A. GPU (VRAM) \u2013 The Hot Path\nThe GPU handles the **dense, always-active components** and the **hottest experts**.\n\n**What lives on the GPU:**\n1. **Attention & DeltaNet Mixers:** Core transformer layers.\n2. **Gated-Residual Weights & Routers:** The logic that decides which experts to activate.\n3. **Shared Experts:** Experts used by nearly all tokens.\n4. **Output Head & MTP Draft Layer:** Final projection and speculative decoding helper.\n5. **KV Cache:** \n - For short contexts: Fully in VRAM.\n - For long contexts (>64K tokens): Only the most-read portion stays in VRAM; the rest streams from RAM.",
"usage": null,
"timings": {
"cache_n": 0,
"prompt_n": 1696,
"prompt_ms": 1439.447,
"prompt_per_token_ms": 0.8487305424528301,
"prompt_per_second": 1178.2302509227504,
"predicted_n": 512,
"predicted_ms": 4305.459,
"predicted_per_token_ms": 8.425555772994128,
"predicted_per_second": 118.68653260895064,
"draft_n": 456,
"draft_n_accepted": 305
},
"err": null,
"pieces": 512
},
"metrics": {
"ok": true,
"err": null,
"ttft_s": 1.452,
"total_s": 5.758,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 1696,
"generated_tokens": 512,
"prompt_tps": 1178.2302509227504,
"prompt_tps_source": "engine",
"decode_tps": 118.68653260895064,
"decode_tps_source": "engine",
"prompt_ms": 1439.447,
"decode_ms": 4305.459,
"drafts_offered": 456,
"drafts_accepted": 305
}
},
{
"run": 0,
"source": "docs/INSTALL.md",
"messages": [
{
"role": "user",
"content": "Run identifier 0-1. Read the following project documentation and write a detailed technical explanation of its design, tradeoffs, and how someone would use it in practice.\n\n# Installing PolyStrata\n\nEverything about installing, starting, updating and configuring PolyStrata, on Windows and Linux, with an NVIDIA or an\nAMD graphics card. The short version is in the [README](../README.md#install); an AI coding assistant can do all of\nthis for you with [AI_SETUP.md](AI_SETUP.md).\n\n> **On this page:** [What you need](#what-you-need) \u00b7 [Windows](#windows) \u00b7 [Linux](#linux) \u00b7\n> [AMD cards](#amd-cards) \u00b7 [Several cards](#two-or-three-cards) \u00b7 [Docker](#docker-linux) \u00b7\n> [Older CPUs](#older-cpus-experimental) \u00b7 [Updating](#updating) \u00b7 [Where things are stored](#where-things-are-stored) \u00b7\n> [Setup's questions](#setups-questions) \u00b7 [Tuning](#tuning-for-your-pc) \u00b7 [All options](#options-without-questions)\n\n## What you need\n\nThis is for Qwen3.8-Flash-Next. GLM 5.3 Flash needs Linux, one NVIDIA card and far more RAM:\n[GLM.md](GLM.md#what-you-need). The three smaller models (Qwen3.6-35B-A3B, Ornith 1.5, Gemma 4 26B-A4B) need Linux\nor Windows, one NVIDIA card and less of everything: [BACKENDS.md](BACKENDS.md#install).\n\n| | |\n| --- | --- |\n| **GPU** | **NVIDIA** RTX 20, 30, 40 or 50 series, **12 GB VRAM or more** (8 GB runs, slowly). Measured on an RTX 5070 and an RTX 3090; RTX 20 (Turing, since 0.1.27) was tested by a contributor on an RTX 2070. **AMD** Radeon RX 7900 XT / XTX, RX 9070 / 9070 XT and Radeon AI PRO R9700 (validated), RX 7800 XT / 7700 XT and RX 9060 XT (validated by their owners), RX 6800 / 6900 series (community-reported), with 12 GB of VRAM or more. See [AMD cards](#amd-cards). |\n| **RAM** | Enough for the size you pick ([which model](MODELS.md#pick-by-ram)); **64 GB** runs every size. A big GPU makes up for less RAM - the [low-RAM mode](MODELS.md#a-big-graphics-card-and-little-ram). |\n| **CPU** | x86-64 with AVX2 (any Intel/AMD desktop CPU from the last ~8 years). AVX-512 (Ryzen 7000/9000) is a bit faster. Older CPUs without AVX2 are experimental and slow: [Older CPUs](#older-cpus-experimental). |\n| **Disk** | ~70-80 GB free for the model, ~6 GB for the MTP layer (+1 GB with images). **Q2_0 on an AVX-512 CPU** also writes a one-time ~40 GB copy of its experts for the fast CPU kernel. On Linux with an AMD card, ROCm takes ~10 GB more when setup installs it. An NVMe SSD is strongly recommended: it makes the first start much faster. |\n| **OS** | Windows 10/11, or Linux (Ubuntu 22.04/24.04 and Debian 12/13 get everything installed automatically). |\n| **Driver** | **NVIDIA:** a current driver, version 580 or newer ([nvidia.com/drivers](https://www.nvidia.com/drivers) or the NVIDIA App). **AMD:** on Linux the kernel's amdgpu driver (no ROCm install needed); on Windows a current AMD Software: Adrenalin Edition driver ([amd.com/support](https://www.amd.com/en/support)). |\n\nThe driver is the only thing you install yourself. Everything else - Python, the engine, the model - is set up for\nyou the first time: Python 3.12 if you have none (for your user account, no admin), a private Python environment in\n`.venv/`, the PolyStrata engine, the model and the MTP draft layer. On NVIDIA it uses the ready-made engine for RTX\n20/30/40/50 and NVIDIA's CUDA libraries from pip (~0.4 GB); if no ready-made engine fits your PC, it offers to install\nthe build tools (Visual Studio Build Tools + CUDA Toolkit on Windows, `build-essential` + CUDA on Ubuntu) and compiles\nthe engine for your GPU (asks first; 20-40 minutes once). More: [details](DETAILS.md#before-you-start).\n\n## Windows\n\n1. [Download this project](https://github.com/VecSzn/PolyStrata/archive/refs/heads/main.zip) and unzip it (or\n `git clone` it).\n2. Double-click **`START-HERE.bat`**.\n3. Answer a few questions - or just press Enter each time for the recommended choice ([the questions](#setups-questions)).\n\nThen it downloads everything (the model is ~70 GB, so the first time takes a while - you can stop and it picks up\nwhere it left off) and **starts the model**. Your browser opens the PolyStrata app at `http://127.0.0.1:8080`.\n\n> **While the model starts, your PC can be slow or stop responding for 1-3 minutes** (longest the first time): PolyStrata\n> loads 35-55 GB into your RAM and locks part of it for the graphics card. That's normal - wait, and don't close the\n> window. The window tells you what it is doing.\n\n**Next time**, just double-click `START-HERE.bat` again: it starts right away (30-90 s to load the model), nothing is\ndownloaded twice. Close its window to stop the model. `SETUP.bat` (the same as `START-HERE.bat --setup`) installs\nanother model or changes the settings. Starting PolyStrata from Task Scheduler at logon needs two task settings, or the\nstart is 24x slower: [Running it at startup](DETAILS.md#running-it-at-startup-task-scheduler).\n\Line truncated
}
],
"response": {
"first": 2.3182232100516558,
"total": 6.828342035412788,
"text": "# PolyStrata: Technical Design, Tradeoffs, and Practical Usage\n\n## 1. Executive Summary\n\n**PolyStrata** is a specialized local inference engine designed to run large language models (LLMs), specifically optimized for the **Qwen3.8-Flash-Next** model, on consumer-grade hardware. Its core architectural innovation lies in its hybrid memory management strategy, which aggressively balances GPU VRAM and system RAM to enable the execution of massive models (70\u201380 GB) on GPUs with as little as 12 GB of VRAM.\n\nThe project prioritizes **accessibility** and **automation**. It abstracts away the complex dependency management typical of local LLMs (Python environments, CUDA/ROCm drivers, model quantization) behind a single entry point (`START-HERE.bat` or `setup.sh`) that handles installation, compilation, and configuration automatically.\n\n---\n\n## 2. Core Technical Design\n\n### 2.1. Hybrid Memory Architecture (The \"PolyStrata\" Concept)\nThe defining feature of PolyStrata is its approach to memory constraints. Standard local LLM runners often require either:\n1. **Full GPU Offload:** Requires VRAM \u2265 Model Size (impossible for 70GB models on consumer cards).\n2. **Full CPU Offload:** Slow, limited by system RAM bandwidth.\n\nPolyStrata employs a **hybrid expert routing strategy**:\n* **GPU VRAM:** Stores the \"hot\" experts and critical layers of the Mixture-of-Experts (MoE) model.\n* **System RAM:** Stores the remaining experts and weights.\n* **Dynamic Loading:** During inference, the engine dynamically swaps experts between RAM and VRAM based on the prompt's routing path.\n\n**Key Mechanism:**\n* **Page-Locked RAM:** The engine locks a portion of system RAM to prevent swapping to disk, ensuring faster access than standard virtual memory.\n* **Low-RAM Mode:** For systems with <64 GB RAM, PolyStrata maps experts from a pre-prepared \"pack\" on disk (NVMe SSD) rather than keeping them fully resident in RAM, trading latency for feasibility.\n\n### 2.2. Model Support & Quantization\nPolyStrata is not a general-purpose runner but is tuned for specific model families:\n* **Primary Target:** Qwen3.8-Flash-Next (70\u201380 GB).\n*",
"usage": null,
"timings": {
"cache_n": 0,
"prompt_n": 4370,
"prompt_ms": 2295.253,
"prompt_per_token_ms": 0.525229519450801,
"prompt_per_second": 1903.929545021834,
"predicted_n": 512,
"predicted_ms": 4509.442,
"predicted_per_token_ms": 8.824739726027397,
"predicted_per_second": 113.31778965113644,
"draft_n": 481,
"draft_n_accepted": 288
},
"err": null,
"pieces": 512
},
"metrics": {
"ok": true,
"err": null,
"ttft_s": 2.318,
"total_s": 6.828,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 4370,
"generated_tokens": 512,
"prompt_tps": 1903.929545021834,
"prompt_tps_source": "engine",
"decode_tps": 113.31778965113644,
"decode_tps_source": "engine",
"prompt_ms": 2295.253,
"decode_ms": 4509.442,
"drafts_offered": 481,
"drafts_accepted": 288
}
},
{
"run": 0,
"source": "docs/DETAILS.md",
"messages": [
{
"role": "user",
"content": "Run identifier 0-2. Read the following project documentation and write a detailed technical explanation of its design, tradeoffs, and how someone would use it in practice.\n\n# PolyStrata - the details\n\nThe technical side of PolyStrata: every measured number, the API, images, all settings and how the engine works.\nNew here? Start with the [README](../README.md); installing step by step is in [INSTALL.md](INSTALL.md), the models in\n[MODELS.md](MODELS.md), common problems in [TROUBLESHOOTING.md](TROUBLESHOOTING.md).\n\n> **On this page:** [Speed](#speed-measured) \u00b7 [Other GPUs](#other-gpus-estimated) \u00b7 [Which model?](#which-model) \u00b7\n> [Requirements](#before-you-start) \u00b7 [Windows](#windows) \u00b7 [Linux](#linux) \u00b7 [API](#using-it) \u00b7\n> [MCP tools](#tools-from-mcp-servers) \u00b7 [MCP server](#manage-strata-from-your-ai-assistant-mcp-server) \u00b7\n> [Images](#images-vision) \u00b7\n> [Troubleshooting](#troubleshooting) \u00b7 [How it works](#how-it-works)\n\n---\n\n## Speed (measured)\n\nRTX 5070 **12 GB**, Ryzen 5 7600 (6 cores), 64 GB DDR5-5200, Windows, engine 0.1.26 with the settings setup writes\n(`--prefill auto`, 8-bit KV above 4K, KV streaming from 64K). One code-agent prompt per length, 256 generated tokens,\nMTP speculative decoding on. \"262K\" is the model's full context window (a 259,943-token prompt). The IQ2_XS row was\nmeasured with Swift 1.5's IQ2_XS, which runs at the original's speed.\n\n**Engine 0.1.36 (#136), the same PC:** Q2_0's prompt experts run on fused int8 tensor-core kernels (RTX 30 and newer):\n4K 1,294 -> 1,570, 32K 2,170 -> 2,653, 128K 2,123 -> 2,468 tokens/s (+16-22%), as close to an FP16 reference as the\nprevious kernels (closer at 32K: teacher-forced KL 0.009 vs 0.012). The decode path's block selection and greedy\nargmax run on thread-block clusters (RTX 50, sm_90+; other cards keep the previous kernels; the same tokens): Q2_0 output at 4K 89 -> 93.5, at 128K\n64.5 -> 76.4 tokens/s. `STRATA_PF_FUSED=0` keeps the previous prompt kernels (byte-identical answers to 0.1.35);\n`STRATA_PF_FUSED=1` also runs the native IQ packs' fused kernels (opt-in: IQ2_XS prompts +12% at 4K, +3% at 32K, the\nIQ3 packs about even; on HIP they run on gfx11 and on gfx1200 / gfx1201, see AMD_HIP.md); `STRATA_QSA_CLUSTER=0` / `STRATA_ARGMAX_MULTI=0` turn the decode kernels off. The tables\nbelow are 0.1.26's.\n\n### Prompt processing (tokens/s)\n\n| Model | 1K | 4K | 32K | 64K | 128K | 262K |\n| --- | ---: | ---: | ---: | ---: | ---: | ---: |\n| **Q2_0** | 536 | 1,299 | 2,171 | 2,126 | 2,107 | 1,304\u2020 |\n| **IQ2_XS** | 534 | 1,256 | 2,092 | 1,754 | 1,752 | 1,181*\u2020 |\n| **IQ3_XXS** | 482 | 1,007 | 1,745 | 1,609 | 1,602 | - |\n| **IQ3_S** | 427 | 913 | 1,624 | 1,640 | 1,443 | - |\n| **Coder** | 656 | 1,583 | 2,177 | 2,236 | 2,208 | 1,034** |\n| **IQ3_S** (AMD RX 7900 XTX, gfx1100) | 760 | 1,275 | 1,641 | 1,594 | 1,494 | - |\n\nEngine 0.1.26; `bench/results/2026-09-29-speed-0126`. The AMD RX 7900 XTX row: engine 0.1.38 on a ROCm\n10.2 nightly with a tuned gfx1100 hipBLASLt-100500 table (upstream as [#755](https://github.com/Niko1221/Strata/pull/755)),\nthe median of 3 clean cells per tier\n(Ryzen 9 7900X, 96 GB; 1K-128K one-shot runs, 256 generated tokens,\ngreedy). At 32K-128K that is 8-28% faster than 0.1.22. \u2020 not measured\nagain: 0.1.22. \\* measured with images on (the image encoder's VRAM reserve leaves fewer experts cached). \\*\\* not\nmeasured again: 0.1.14.\n\n### Output (tokens/s)\n\n| Model | 1K | 4K | 32K | 64K | 128K | 262K |\n| --- | ---: | ---: | ---: | ---: | ---: | ---: |\n| **Q2_0** | 87.3 | 93.0 | 81.8 | 76.2 | 73.7 | 60.3\u2020 |\n| **IQ2_XS** | 79.6 | 78.6 | 76.3 | 63.7 | 62.7 | 52.8\u2020 |\n| **IQ3_XXS** | 61.9 | 61.6 | 58.5 | 57.2 | 49.0 | - |\n| **IQ3_S** | 52.4 | 53.3 | 48.3 | 46.3 | 45.5 | - |\n| **Coder** | 58.9 | 55.1 | 54.9 | 53.2 | 43.0 | 42.8\u2020 |\n| **IQ3_S** (AMD RX 7900 XTX, gfx1100) | 65.1 | 60.4 | 64.4 | 61.8 | 59.2 | - |\n\nEngine 0.1.26, the same runs. The AMD RX 7900 XTX row: engine 0.1.38 on a ROCm 10.2 nightly (tuned\ngfx1100 hipBLASLt-100500 table, upstream as [#755](https://github.com/Niko1221/Strata/pull/755)), median of 3 clean cells per tier (same box; decode is flat in\ncontext - the GDN linear attention is O(1) per token; 1K/4K prefill ran slightly under the 0.1.31\npackaged-ROCm numbers, 32K-128K ahead). \u2020 not measured again: 0.1.14.\n\nOutput speed depends on the text as well: speculative decoding runs faster when more of the drafted tokens are\naccepted, so a different answer to the same prompt moves it by several percent. Run back to back on the 4K prompt,\n0.1.14 writes 88.5 tokens/s and 0.1.12 85.7. The numbers before 0.1.13 (prompts about half as fast):\n[`bench/results/2026-09-24-final`](../bench/results/2026-09-24-final/matrix.md); these:\n[`bench/results/2026-09-28-speed-0114`](../bench/results/2026-09-28-speed-0114/README.md).\n\nIQ3_XXS and IQ3_S at 262K are not measLine truncated
}
],
"response": {
"first": 2.4919154793024063,
"total": 6.679194720461965,
"text": "# PolyStrata: Technical Design, Tradeoffs, and Practical Usage\n\n## 1. Executive Summary\n\n**PolyStrata** is a high-performance inference engine designed for running large Mixture-of-Experts (MoE) models on consumer-grade hardware (specifically NVIDIA RTX 30/50 series and AMD RDNA3/4 GPUs). Its core innovation lies in its sophisticated **expert caching and streaming architecture**, which allows massive models (with 23\u201350 GB of expert weights) to run on GPUs with limited VRAM (8\u201312 GB) by dynamically swapping experts between VRAM, system RAM, and disk.\n\nThe engine prioritizes **throughput** (tokens/second) and **context length** (up to 262K tokens) over absolute precision, utilizing aggressive quantization (IQ2_XS, Q2_0) and speculative decoding to achieve usable speeds on hardware that would otherwise be unable to host these models.\n\n---\n\n## 2. Core Architecture & How It Works\n\n### 2.1 The Expert Streaming Engine\nThe fundamental challenge of MoE models is that while only a small fraction of experts are active per token, the total weight size is enormous. PolyStrata solves this via a tiered memory hierarchy:\n\n1. **VRAM (GPU):** Holds the \"hot\" experts (most frequently used) and the KV cache.\n2. **System RAM:** Holds the full set of experts (pinned memory) or a large subset.\n3. **Disk (MMap):** In \"Low-RAM mode,\" experts are memory-mapped from disk, relying on the OS file cache.\n\n**Key Mechanism:** The engine uses an **adaptive tiering system** (`--adapt-swaps`) that monitors expert usage. Frequently accessed experts are promoted to VRAM, while cold experts are demoted to RAM or disk. This allows a 12 GB GPU to effectively \"see\" a 50 GB model.\n\n### 2.2 KV Cache Management\nHandling long contexts (128K\u2013262K tokens) requires massive Key-Value (KV) cache memory. PolyStrata offers several strategies:\n\n* **KV Streaming (`--kv-streaming`):** At contexts >64K, the KV cache is stored in system RAM, with only the active window resident in VRAM (`--kv-resident`). This frees up VRAM for more experts.\n * ",
"usage": null,
"timings": {
"cache_n": 0,
"prompt_n": 5048,
"prompt_ms": 2469.896,
"prompt_per_token_ms": 0.48928209191759114,
"prompt_per_second": 2043.810751545814,
"predicted_n": 512,
"predicted_ms": 4187.078,
"predicted_per_token_ms": 8.193890410958906,
"predicted_per_second": 122.04214968051706,
"draft_n": 444,
"draft_n_accepted": 301
},
"err": null,
"pieces": 512
},
"metrics": {
"ok": true,
"err": null,
"ttft_s": 2.492,
"total_s": 6.679,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 5048,
"generated_tokens": 512,
"prompt_tps": 2043.810751545814,
"prompt_tps_source": "engine",
"decode_tps": 122.04214968051706,
"decode_tps_source": "engine",
"prompt_ms": 2469.896,
"decode_ms": 4187.078,
"drafts_offered": 444,
"drafts_accepted": 301
}
},
{
"run": 1,
"source": "docs/HOW_IT_WORKS.md",
"messages": [
{
"role": "user",
"content": "Run identifier 1-0. Read the following project documentation and write a detailed technical explanation of its design, tradeoffs, and how someone would use it in practice.\n\n# How does PolyStrata work?\n\nModels like Qwen3.8-Flash-Next normally run on servers with hundreds of gigabytes of graphics memory. Your graphics\ncard has 12-24 GB. PolyStrata makes it fit by **sharing the work across your whole PC** - the same idea as a kitchen, where\nthe things you use all the time stay on the counter and the rest waits in the pantry. Back to the\n[README](../README.md#how-does-it-work).\n\n## Who does what\n\n<p align=\"center\"><img src=\"media/how-it-works.svg\" width=\"860\" alt=\"The model's 24,576 experts: the busiest on the graphics card, all of them in RAM, a lookup table on the SSD\"></p>\n\n- **The model is a team of 24,576 small specialists (\"experts\"),** and each word it writes needs only 10 of them.\n So it doesn't have to have all of them on the graphics card at once.\n- **Your graphics card** does the part of the work needed for every word, and keeps the few thousand experts that\n are asked most often. It keeps learning which ones those are while you use it.\n- **Your RAM** holds every expert. When a word needs one the card doesn't have, **your processor** works on it -\n at the same time as the graphics card, so neither waits for the other.\n- **Your SSD** holds a big lookup table; the model only reads a few small rows of it per word.\n\nThe same in technical terms:\n\n- **GPU (VRAM):** attention and DeltaNet mixers, the gated-residual weights, routers, shared experts, output head, the\n MTP draft layer, the KV cache (from 64K: only its most-read part, the rest streams from RAM), and an **expert\n cache** that fills the rest of VRAM with the most-used experts (it adapts to the conversation while you chat).\n More VRAM matters more than a faster GPU: every extra GB holds ~700 more experts, and every expert on the GPU is one\n the CPU does not have to compute.\n- **RAM:** all 24,576 experts, pinned. The CPU computes the experts that are not on the GPU **in place**, at the same\n time as the GPU works on the cached ones (AVX-512 / AVX2 kernels, ggml's for the i-quants). On a PC with little RAM\n and a big card, the [low-RAM mode](MODELS.md#a-big-graphics-card-and-little-ram) keeps in RAM only what the GPU does\n not hold.\n- **SSD:** the 28.8 GB n-gram table, read a few rows per token through the OS cache.\n\nThis works the same on NVIDIA (CUDA) and AMD (HIP) cards: the same engine, compiled for each.\n\n## Guess, then check\n\n<p align=\"center\"><img src=\"media/guess-and-check.svg\" width=\"860\" alt=\"A small helper guesses the next words; the big model checks them all at once and keeps the right ones\"></p>\n\n- **Guess, then check.** A small, fast helper built into the model guesses the next few words, and the big model\n checks all the guesses in one go. It keeps the ones it agrees with and writes the next word itself - so one step\n often produces several words. The helper only guesses - the big model decides every word - so you get the same\n quality answer, 1.6-1.8x sooner.\n- In technical terms: the model's own MTP layer drafts up to 3 tokens; one pass over all 48 layers checks them, 2.4-3.2\n tokens per pass on average. When the reply repeats the context (code edits, quoted text), **prompt lookup** drafts\n up to 5 tokens from the earlier copy, but only where its measured acceptance and cost say it pays: code edits 6-11%\n faster, other text unchanged. The drafts are checked like the MTP's, so the output is the same.\n\n## Reading long texts\n\n**Long texts are read in big pieces** (up to 8,192 tokens - pieces of words - at a time), which is why a long\ndocument or code base is read at over 1,000 tokens per second. The experts of the next layer stream to the GPU over\nPCIe while the current layer's attention runs. After the first message, PolyStrata keeps the conversation and reads only\nwhat is new, so follow-ups start in seconds.\n\n## More\n\nThe [details](DETAILS.md#how-it-works) explain every part and its numbers, and the\n[paper](paper/Strata-Paper.pdf) tells the whole story, with the measurements behind it.\n\n## Credits\n\n- PolyStrata is built on [Strata](https://github.com/Niko1221/Strata) by Niko1221 and its contributors. The Qwen\n engine, the installer, the server and the web app are that project's work. PolyStrata adds the engine for GLM 5.3\n Flash ([GLM.md](GLM.md)), whose file is from\n [neuralll](https://huggingface.co/neuralll/GLM-5.3-Flash-GSQ-RCO-3.0bit-Q4Kattn-GGUF).\n- Model: [Qwen3.8-Flash-Next](https://huggingface.co/Qwen/Qwen3.8-Flash-Next) by the Qwen team; compressed versions by\n [ISTA-DASLab](https://huggingface.co/ISTA-DASLab/Qwen3.8-Flash-Next-GSQ-RCO-GGUF);\n [Swift 1.5](https://huggingface.co/ukisai/Swift-1.5-Qwen3.8-Flash-Next-GSQ-RCO-GGUF) by UkisAI; the experimental\n [UD-Q4_K_XL](https://huggingface.co/unsloth/Line truncated
}
],
"response": {
"first": 1.4247603733092546,
"total": 5.391626071184874,
"text": "# PolyStrata: Technical Design, Tradeoffs, and Practical Usage\n\n## Executive Summary\n\nPolyStrata is an inference engine designed to run massive Mixture-of-Experts (MoE) models\u2014specifically **Qwen3.8-Flash-Next** (and GLM 5.3 Flash)\u2014on consumer hardware with limited VRAM (12\u201324 GB). It achieves this by **stratifying model weights across GPU VRAM, system RAM, and SSD**, leveraging the sparse nature of MoE architectures to avoid loading all 24,576 experts into VRAM simultaneously. It further accelerates inference via **Multi-Token Prediction (MTP) speculative decoding** and **prompt lookup** for repetitive contexts.\n\n---\n\n## 1. Core Architecture: The \"Kitchen\" Analogy\n\n### The Problem\nQwen3.8-Flash-Next is a MoE model with **24,576 experts**. A standard dense model would require hundreds of GBs of VRAM. A consumer GPU (e.g., RTX 4090 with 24 GB) cannot hold the entire model.\n\n### The Solution: Hierarchical Storage\nPolyStrata treats the model like a kitchen:\n- **Counter (GPU VRAM):** Frequently used items (hot experts, attention layers, KV cache).\n- **Pantry (System RAM):** All experts, pinned in memory.\n- **Storage Room (SSD):** A large n-gram lookup table for speculative decoding.\n\n### Component Breakdown\n\n| Component | Role | Technical Details |\n|-----------|------|-------------------|\n| **GPU (VRAM)** | Fast compute for hot paths | Stores: Attention/DeltaNet mixers, gated-residual weights, routers, shared experts, output head, MTP draft layer, KV cache (partial), and an **adaptive expert cache**. |\n| **RAM** | Full expert storage | Holds all 24,576 experts pinned in memory. CPU computes experts not cached on GPU using AVX-512/AVX2 kernels (via ggml). |\n| **SSD** | Speculative decoding support | Stores a 28.8 GB n-gram table. Only small rows are read per token via OS cache. |\n\n### Key Insight: MoE Sparsity\nEach token only activates **10 out of 24,576 experts**. PolyStrata exploits this by:\n",
"usage": null,
"timings": {
"cache_n": 0,
"prompt_n": 1696,
"prompt_ms": 1411.121,
"prompt_per_token_ms": 0.832028891509434,
"prompt_per_second": 1201.8813411465069,
"predicted_n": 512,
"predicted_ms": 3966.402,
"predicted_per_token_ms": 7.762039138943249,
"predicted_per_second": 128.83212543761323,
"draft_n": 433,
"draft_n_accepted": 317
},
"err": null,
"pieces": 512
},
"metrics": {
"ok": true,
"err": null,
"ttft_s": 1.425,
"total_s": 5.392,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 1696,
"generated_tokens": 512,
"prompt_tps": 1201.8813411465069,
"prompt_tps_source": "engine",
"decode_tps": 128.83212543761323,
"decode_tps_source": "engine",
"prompt_ms": 1411.121,
"decode_ms": 3966.402,
"drafts_offered": 433,
"drafts_accepted": 317
}
},
{
"run": 1,
"source": "docs/INSTALL.md",
"messages": [
{
"role": "user",
"content": "Run identifier 1-1. Read the following project documentation and write a detailed technical explanation of its design, tradeoffs, and how someone would use it in practice.\n\n# Installing PolyStrata\n\nEverything about installing, starting, updating and configuring PolyStrata, on Windows and Linux, with an NVIDIA or an\nAMD graphics card. The short version is in the [README](../README.md#install); an AI coding assistant can do all of\nthis for you with [AI_SETUP.md](AI_SETUP.md).\n\n> **On this page:** [What you need](#what-you-need) \u00b7 [Windows](#windows) \u00b7 [Linux](#linux) \u00b7\n> [AMD cards](#amd-cards) \u00b7 [Several cards](#two-or-three-cards) \u00b7 [Docker](#docker-linux) \u00b7\n> [Older CPUs](#older-cpus-experimental) \u00b7 [Updating](#updating) \u00b7 [Where things are stored](#where-things-are-stored) \u00b7\n> [Setup's questions](#setups-questions) \u00b7 [Tuning](#tuning-for-your-pc) \u00b7 [All options](#options-without-questions)\n\n## What you need\n\nThis is for Qwen3.8-Flash-Next. GLM 5.3 Flash needs Linux, one NVIDIA card and far more RAM:\n[GLM.md](GLM.md#what-you-need). The three smaller models (Qwen3.6-35B-A3B, Ornith 1.5, Gemma 4 26B-A4B) need Linux\nor Windows, one NVIDIA card and less of everything: [BACKENDS.md](BACKENDS.md#install).\n\n| | |\n| --- | --- |\n| **GPU** | **NVIDIA** RTX 20, 30, 40 or 50 series, **12 GB VRAM or more** (8 GB runs, slowly). Measured on an RTX 5070 and an RTX 3090; RTX 20 (Turing, since 0.1.27) was tested by a contributor on an RTX 2070. **AMD** Radeon RX 7900 XT / XTX, RX 9070 / 9070 XT and Radeon AI PRO R9700 (validated), RX 7800 XT / 7700 XT and RX 9060 XT (validated by their owners), RX 6800 / 6900 series (community-reported), with 12 GB of VRAM or more. See [AMD cards](#amd-cards). |\n| **RAM** | Enough for the size you pick ([which model](MODELS.md#pick-by-ram)); **64 GB** runs every size. A big GPU makes up for less RAM - the [low-RAM mode](MODELS.md#a-big-graphics-card-and-little-ram). |\n| **CPU** | x86-64 with AVX2 (any Intel/AMD desktop CPU from the last ~8 years). AVX-512 (Ryzen 7000/9000) is a bit faster. Older CPUs without AVX2 are experimental and slow: [Older CPUs](#older-cpus-experimental). |\n| **Disk** | ~70-80 GB free for the model, ~6 GB for the MTP layer (+1 GB with images). **Q2_0 on an AVX-512 CPU** also writes a one-time ~40 GB copy of its experts for the fast CPU kernel. On Linux with an AMD card, ROCm takes ~10 GB more when setup installs it. An NVMe SSD is strongly recommended: it makes the first start much faster. |\n| **OS** | Windows 10/11, or Linux (Ubuntu 22.04/24.04 and Debian 12/13 get everything installed automatically). |\n| **Driver** | **NVIDIA:** a current driver, version 580 or newer ([nvidia.com/drivers](https://www.nvidia.com/drivers) or the NVIDIA App). **AMD:** on Linux the kernel's amdgpu driver (no ROCm install needed); on Windows a current AMD Software: Adrenalin Edition driver ([amd.com/support](https://www.amd.com/en/support)). |\n\nThe driver is the only thing you install yourself. Everything else - Python, the engine, the model - is set up for\nyou the first time: Python 3.12 if you have none (for your user account, no admin), a private Python environment in\n`.venv/`, the PolyStrata engine, the model and the MTP draft layer. On NVIDIA it uses the ready-made engine for RTX\n20/30/40/50 and NVIDIA's CUDA libraries from pip (~0.4 GB); if no ready-made engine fits your PC, it offers to install\nthe build tools (Visual Studio Build Tools + CUDA Toolkit on Windows, `build-essential` + CUDA on Ubuntu) and compiles\nthe engine for your GPU (asks first; 20-40 minutes once). More: [details](DETAILS.md#before-you-start).\n\n## Windows\n\n1. [Download this project](https://github.com/VecSzn/PolyStrata/archive/refs/heads/main.zip) and unzip it (or\n `git clone` it).\n2. Double-click **`START-HERE.bat`**.\n3. Answer a few questions - or just press Enter each time for the recommended choice ([the questions](#setups-questions)).\n\nThen it downloads everything (the model is ~70 GB, so the first time takes a while - you can stop and it picks up\nwhere it left off) and **starts the model**. Your browser opens the PolyStrata app at `http://127.0.0.1:8080`.\n\n> **While the model starts, your PC can be slow or stop responding for 1-3 minutes** (longest the first time): PolyStrata\n> loads 35-55 GB into your RAM and locks part of it for the graphics card. That's normal - wait, and don't close the\n> window. The window tells you what it is doing.\n\n**Next time**, just double-click `START-HERE.bat` again: it starts right away (30-90 s to load the model), nothing is\ndownloaded twice. Close its window to stop the model. `SETUP.bat` (the same as `START-HERE.bat --setup`) installs\nanother model or changes the settings. Starting PolyStrata from Task Scheduler at logon needs two task settings, or the\nstart is 24x slower: [Running it at startup](DETAILS.md#running-it-at-startup-task-scheduler).\n\Line truncated
}
],
"response": {
"first": 2.2882438134402037,
"total": 6.578796703368425,
"text": "# PolyStrata: Technical Design, Tradeoffs, and Practical Usage\n\n## 1. Executive Summary\n\n**PolyStrata** is a specialized local inference engine designed to run large language models (LLMs), specifically optimized for the **Qwen3.8-Flash-Next** model, on consumer-grade hardware. Its core architectural innovation lies in its hybrid memory management strategy, which aggressively balances GPU VRAM and system RAM to enable the execution of massive models (70\u201380 GB) on GPUs with as little as 12 GB of VRAM.\n\nThe project prioritizes **accessibility** and **automation**. It abstracts away the complex dependencies of Python environments, CUDA/ROCm drivers, and model quantization formats, providing a \"one-click\" experience for Windows and Linux users. It supports both NVIDIA (CUDA) and AMD (HIP/ROCm) backends, with specific optimizations for multi-GPU setups and older CPU architectures.\n\n---\n\n## 2. Core Design & Architecture\n\n### 2.1. Hybrid Memory Management (The \"PolyStrata\" Concept)\nThe defining feature of PolyStrata is its approach to memory constraints. Standard LLM inference requires the entire model weights to fit into VRAM. PolyStrata circumvents this by:\n1. **Expert Offloading:** It likely utilizes a Mixture-of-Experts (MoE) architecture or a similar sparse activation pattern where only a subset of the model's parameters (experts) are active per token.\n2. **RAM-to-VRAM Streaming:** It loads 35\u201355 GB of model data into system RAM and \"locks\" or maps specific portions into the GPU's VRAM. This allows a 12 GB GPU to run a model that would otherwise require 40+ GB of VRAM.\n3. **Low-RAM Mode:** For systems with limited RAM, it can map experts from disk (NVMe SSD) via the OS file cache, trading latency for memory capacity.\n\n### 2.2. Backend Abstraction\nPolyStrata abstracts the underlying compute backend:\n* **NVIDIA (CUDA):** Uses pre-compiled engines for RTX 20/30/40/50 series. If a pre-compiled engine isn't available, it can compile a custom engine using Visual Studio Build Tools (Windows) or `build-essential` (Linux).\n* **AMD (HIP/ROCm):** Uses",
"usage": null,
"timings": {
"cache_n": 0,
"prompt_n": 4370,
"prompt_ms": 2265.447,
"prompt_per_token_ms": 0.5184089244851259,
"prompt_per_second": 1928.9791374505783,
"predicted_n": 512,
"predicted_ms": 4289.933,
"predicted_per_token_ms": 8.395172211350294,
"predicted_per_second": 119.11607943527324,
"draft_n": 444,
"draft_n_accepted": 294
},
"err": null,
"pieces": 512
},
"metrics": {
"ok": true,
"err": null,
"ttft_s": 2.288,
"total_s": 6.579,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 4370,
"generated_tokens": 512,
"prompt_tps": 1928.9791374505783,
"prompt_tps_source": "engine",
"decode_tps": 119.11607943527324,
"decode_tps_source": "engine",
"prompt_ms": 2265.447,
"decode_ms": 4289.933,
"drafts_offered": 444,
"drafts_accepted": 294
}
},
{
"run": 1,
"source": "docs/DETAILS.md",
"messages": [
{
"role": "user",
"content": "Run identifier 1-2. Read the following project documentation and write a detailed technical explanation of its design, tradeoffs, and how someone would use it in practice.\n\n# PolyStrata - the details\n\nThe technical side of PolyStrata: every measured number, the API, images, all settings and how the engine works.\nNew here? Start with the [README](../README.md); installing step by step is in [INSTALL.md](INSTALL.md), the models in\n[MODELS.md](MODELS.md), common problems in [TROUBLESHOOTING.md](TROUBLESHOOTING.md).\n\n> **On this page:** [Speed](#speed-measured) \u00b7 [Other GPUs](#other-gpus-estimated) \u00b7 [Which model?](#which-model) \u00b7\n> [Requirements](#before-you-start) \u00b7 [Windows](#windows) \u00b7 [Linux](#linux) \u00b7 [API](#using-it) \u00b7\n> [MCP tools](#tools-from-mcp-servers) \u00b7 [MCP server](#manage-strata-from-your-ai-assistant-mcp-server) \u00b7\n> [Images](#images-vision) \u00b7\n> [Troubleshooting](#troubleshooting) \u00b7 [How it works](#how-it-works)\n\n---\n\n## Speed (measured)\n\nRTX 5070 **12 GB**, Ryzen 5 7600 (6 cores), 64 GB DDR5-5200, Windows, engine 0.1.26 with the settings setup writes\n(`--prefill auto`, 8-bit KV above 4K, KV streaming from 64K). One code-agent prompt per length, 256 generated tokens,\nMTP speculative decoding on. \"262K\" is the model's full context window (a 259,943-token prompt). The IQ2_XS row was\nmeasured with Swift 1.5's IQ2_XS, which runs at the original's speed.\n\n**Engine 0.1.36 (#136), the same PC:** Q2_0's prompt experts run on fused int8 tensor-core kernels (RTX 30 and newer):\n4K 1,294 -> 1,570, 32K 2,170 -> 2,653, 128K 2,123 -> 2,468 tokens/s (+16-22%), as close to an FP16 reference as the\nprevious kernels (closer at 32K: teacher-forced KL 0.009 vs 0.012). The decode path's block selection and greedy\nargmax run on thread-block clusters (RTX 50, sm_90+; other cards keep the previous kernels; the same tokens): Q2_0 output at 4K 89 -> 93.5, at 128K\n64.5 -> 76.4 tokens/s. `STRATA_PF_FUSED=0` keeps the previous prompt kernels (byte-identical answers to 0.1.35);\n`STRATA_PF_FUSED=1` also runs the native IQ packs' fused kernels (opt-in: IQ2_XS prompts +12% at 4K, +3% at 32K, the\nIQ3 packs about even; on HIP they run on gfx11 and on gfx1200 / gfx1201, see AMD_HIP.md); `STRATA_QSA_CLUSTER=0` / `STRATA_ARGMAX_MULTI=0` turn the decode kernels off. The tables\nbelow are 0.1.26's.\n\n### Prompt processing (tokens/s)\n\n| Model | 1K | 4K | 32K | 64K | 128K | 262K |\n| --- | ---: | ---: | ---: | ---: | ---: | ---: |\n| **Q2_0** | 536 | 1,299 | 2,171 | 2,126 | 2,107 | 1,304\u2020 |\n| **IQ2_XS** | 534 | 1,256 | 2,092 | 1,754 | 1,752 | 1,181*\u2020 |\n| **IQ3_XXS** | 482 | 1,007 | 1,745 | 1,609 | 1,602 | - |\n| **IQ3_S** | 427 | 913 | 1,624 | 1,640 | 1,443 | - |\n| **Coder** | 656 | 1,583 | 2,177 | 2,236 | 2,208 | 1,034** |\n| **IQ3_S** (AMD RX 7900 XTX, gfx1100) | 760 | 1,275 | 1,641 | 1,594 | 1,494 | - |\n\nEngine 0.1.26; `bench/results/2026-09-29-speed-0126`. The AMD RX 7900 XTX row: engine 0.1.38 on a ROCm\n10.2 nightly with a tuned gfx1100 hipBLASLt-100500 table (upstream as [#755](https://github.com/Niko1221/Strata/pull/755)),\nthe median of 3 clean cells per tier\n(Ryzen 9 7900X, 96 GB; 1K-128K one-shot runs, 256 generated tokens,\ngreedy). At 32K-128K that is 8-28% faster than 0.1.22. \u2020 not measured\nagain: 0.1.22. \\* measured with images on (the image encoder's VRAM reserve leaves fewer experts cached). \\*\\* not\nmeasured again: 0.1.14.\n\n### Output (tokens/s)\n\n| Model | 1K | 4K | 32K | 64K | 128K | 262K |\n| --- | ---: | ---: | ---: | ---: | ---: | ---: |\n| **Q2_0** | 87.3 | 93.0 | 81.8 | 76.2 | 73.7 | 60.3\u2020 |\n| **IQ2_XS** | 79.6 | 78.6 | 76.3 | 63.7 | 62.7 | 52.8\u2020 |\n| **IQ3_XXS** | 61.9 | 61.6 | 58.5 | 57.2 | 49.0 | - |\n| **IQ3_S** | 52.4 | 53.3 | 48.3 | 46.3 | 45.5 | - |\n| **Coder** | 58.9 | 55.1 | 54.9 | 53.2 | 43.0 | 42.8\u2020 |\n| **IQ3_S** (AMD RX 7900 XTX, gfx1100) | 65.1 | 60.4 | 64.4 | 61.8 | 59.2 | - |\n\nEngine 0.1.26, the same runs. The AMD RX 7900 XTX row: engine 0.1.38 on a ROCm 10.2 nightly (tuned\ngfx1100 hipBLASLt-100500 table, upstream as [#755](https://github.com/Niko1221/Strata/pull/755)), median of 3 clean cells per tier (same box; decode is flat in\ncontext - the GDN linear attention is O(1) per token; 1K/4K prefill ran slightly under the 0.1.31\npackaged-ROCm numbers, 32K-128K ahead). \u2020 not measured again: 0.1.14.\n\nOutput speed depends on the text as well: speculative decoding runs faster when more of the drafted tokens are\naccepted, so a different answer to the same prompt moves it by several percent. Run back to back on the 4K prompt,\n0.1.14 writes 88.5 tokens/s and 0.1.12 85.7. The numbers before 0.1.13 (prompts about half as fast):\n[`bench/results/2026-09-24-final`](../bench/results/2026-09-24-final/matrix.md); these:\n[`bench/results/2026-09-28-speed-0114`](../bench/results/2026-09-28-speed-0114/README.md).\n\nIQ3_XXS and IQ3_S at 262K are not measLine truncated
}
],
"response": {
"first": 2.4888660479336977,
"total": 6.738605448976159,
"text": "# PolyStrata: Technical Design, Tradeoffs, and Practical Usage\n\n## 1. Executive Summary\n\n**PolyStrata** is a high-performance inference engine designed for running large Mixture-of-Experts (MoE) models on consumer-grade hardware (specifically NVIDIA RTX 30/50 series and AMD RDNA3/4 GPUs). Its core innovation lies in its sophisticated **expert caching and streaming architecture**, which allows massive models (with 23\u201350 GB of expert weights) to run on GPUs with limited VRAM (8\u201312 GB) by dynamically swapping experts between VRAM, system RAM, and disk.\n\nThe engine prioritizes **throughput** (tokens/second) and **context length** (up to 262K tokens) over absolute precision, utilizing aggressive quantization (IQ2_XS, Q2_0) and speculative decoding to achieve usable speeds on hardware that would otherwise be unable to host these models.\n\n---\n\n## 2. Core Architecture & How It Works\n\n### 2.1 The Expert Streaming Engine\nThe fundamental challenge of MoE models is that while only a small fraction of experts are active per token, the total weight size is enormous. PolyStrata solves this via a tiered memory hierarchy:\n\n1. **VRAM (GPU):** Holds the \"hot\" experts (most frequently used) and the KV cache.\n2. **System RAM:** Holds the full set of experts (pinned memory) or a large subset.\n3. **Disk (MMap):** In \"Low-RAM mode,\" experts are memory-mapped from disk, relying on the OS file cache.\n\n**Key Mechanism: KV Streaming (`--kv-resident`)**\nInstead of keeping the entire Key-Value (KV) cache in VRAM, PolyStrata keeps only a resident portion in VRAM (`--kv-resident 32768`) and streams the rest from RAM. This frees up VRAM for more experts.\n* **Tradeoff:** Slight latency increase due to PCIe transfers, but massive gain in expert capacity.\n* **Impact:** On an RTX 5070 (12 GB), this allows Q2_0 models to run at 262K context with 62.6 tokens/s output, compared to 50.9 tokens/s without streaming.\n\n### 2.2 Quantization Strategy\nPolyStrata relies heavily on",
"usage": null,
"timings": {
"cache_n": 0,
"prompt_n": 5048,
"prompt_ms": 2466.031,
"prompt_per_token_ms": 0.48851644215530904,
"prompt_per_second": 2047.0140075286968,
"predicted_n": 512,
"predicted_ms": 4249.155,
"predicted_per_token_ms": 8.31537181996086,
"predicted_per_second": 120.25920447712545,
"draft_n": 454,
"draft_n_accepted": 298
},
"err": null,
"pieces": 512
},
"metrics": {
"ok": true,
"err": null,
"ttft_s": 2.489,
"total_s": 6.739,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 5048,
"generated_tokens": 512,
"prompt_tps": 2047.0140075286968,
"prompt_tps_source": "engine",
"decode_tps": 120.25920447712545,
"decode_tps_source": "engine",
"prompt_ms": 2466.031,
"decode_ms": 4249.155,
"drafts_offered": 454,
"drafts_accepted": 298
}
},
{
"run": 2,
"source": "docs/HOW_IT_WORKS.md",
"messages": [
{
"role": "user",
"content": "Run identifier 2-0. Read the following project documentation and write a detailed technical explanation of its design, tradeoffs, and how someone would use it in practice.\n\n# How does PolyStrata work?\n\nModels like Qwen3.8-Flash-Next normally run on servers with hundreds of gigabytes of graphics memory. Your graphics\ncard has 12-24 GB. PolyStrata makes it fit by **sharing the work across your whole PC** - the same idea as a kitchen, where\nthe things you use all the time stay on the counter and the rest waits in the pantry. Back to the\n[README](../README.md#how-does-it-work).\n\n## Who does what\n\n<p align=\"center\"><img src=\"media/how-it-works.svg\" width=\"860\" alt=\"The model's 24,576 experts: the busiest on the graphics card, all of them in RAM, a lookup table on the SSD\"></p>\n\n- **The model is a team of 24,576 small specialists (\"experts\"),** and each word it writes needs only 10 of them.\n So it doesn't have to have all of them on the graphics card at once.\n- **Your graphics card** does the part of the work needed for every word, and keeps the few thousand experts that\n are asked most often. It keeps learning which ones those are while you use it.\n- **Your RAM** holds every expert. When a word needs one the card doesn't have, **your processor** works on it -\n at the same time as the graphics card, so neither waits for the other.\n- **Your SSD** holds a big lookup table; the model only reads a few small rows of it per word.\n\nThe same in technical terms:\n\n- **GPU (VRAM):** attention and DeltaNet mixers, the gated-residual weights, routers, shared experts, output head, the\n MTP draft layer, the KV cache (from 64K: only its most-read part, the rest streams from RAM), and an **expert\n cache** that fills the rest of VRAM with the most-used experts (it adapts to the conversation while you chat).\n More VRAM matters more than a faster GPU: every extra GB holds ~700 more experts, and every expert on the GPU is one\n the CPU does not have to compute.\n- **RAM:** all 24,576 experts, pinned. The CPU computes the experts that are not on the GPU **in place**, at the same\n time as the GPU works on the cached ones (AVX-512 / AVX2 kernels, ggml's for the i-quants). On a PC with little RAM\n and a big card, the [low-RAM mode](MODELS.md#a-big-graphics-card-and-little-ram) keeps in RAM only what the GPU does\n not hold.\n- **SSD:** the 28.8 GB n-gram table, read a few rows per token through the OS cache.\n\nThis works the same on NVIDIA (CUDA) and AMD (HIP) cards: the same engine, compiled for each.\n\n## Guess, then check\n\n<p align=\"center\"><img src=\"media/guess-and-check.svg\" width=\"860\" alt=\"A small helper guesses the next words; the big model checks them all at once and keeps the right ones\"></p>\n\n- **Guess, then check.** A small, fast helper built into the model guesses the next few words, and the big model\n checks all the guesses in one go. It keeps the ones it agrees with and writes the next word itself - so one step\n often produces several words. The helper only guesses - the big model decides every word - so you get the same\n quality answer, 1.6-1.8x sooner.\n- In technical terms: the model's own MTP layer drafts up to 3 tokens; one pass over all 48 layers checks them, 2.4-3.2\n tokens per pass on average. When the reply repeats the context (code edits, quoted text), **prompt lookup** drafts\n up to 5 tokens from the earlier copy, but only where its measured acceptance and cost say it pays: code edits 6-11%\n faster, other text unchanged. The drafts are checked like the MTP's, so the output is the same.\n\n## Reading long texts\n\n**Long texts are read in big pieces** (up to 8,192 tokens - pieces of words - at a time), which is why a long\ndocument or code base is read at over 1,000 tokens per second. The experts of the next layer stream to the GPU over\nPCIe while the current layer's attention runs. After the first message, PolyStrata keeps the conversation and reads only\nwhat is new, so follow-ups start in seconds.\n\n## More\n\nThe [details](DETAILS.md#how-it-works) explain every part and its numbers, and the\n[paper](paper/Strata-Paper.pdf) tells the whole story, with the measurements behind it.\n\n## Credits\n\n- PolyStrata is built on [Strata](https://github.com/Niko1221/Strata) by Niko1221 and its contributors. The Qwen\n engine, the installer, the server and the web app are that project's work. PolyStrata adds the engine for GLM 5.3\n Flash ([GLM.md](GLM.md)), whose file is from\n [neuralll](https://huggingface.co/neuralll/GLM-5.3-Flash-GSQ-RCO-3.0bit-Q4Kattn-GGUF).\n- Model: [Qwen3.8-Flash-Next](https://huggingface.co/Qwen/Qwen3.8-Flash-Next) by the Qwen team; compressed versions by\n [ISTA-DASLab](https://huggingface.co/ISTA-DASLab/Qwen3.8-Flash-Next-GSQ-RCO-GGUF);\n [Swift 1.5](https://huggingface.co/ukisai/Swift-1.5-Qwen3.8-Flash-Next-GSQ-RCO-GGUF) by UkisAI; the experimental\n [UD-Q4_K_XL](https://huggingface.co/unsloth/Line truncated
}
],
"response": {
"first": 1.4242745153605938,
"total": 5.348992163315415,
"text": "# PolyStrata: Technical Design, Tradeoffs, and Practical Usage\n\n## Executive Summary\n\nPolyStrata is an inference engine designed to run massive Mixture-of-Experts (MoE) models\u2014specifically **Qwen3.8-Flash-Next** (and GLM 5.3 Flash)\u2014on consumer hardware with limited VRAM (12\u201324 GB). It achieves this by **heterogeneous memory tiering**, distributing model weights across GPU VRAM, system RAM, and SSD, while leveraging **speculative decoding** and **parallel CPU/GPU execution** to maintain high throughput.\n\nThe core insight is that MoE models are sparse: only a small fraction of experts are active per token. PolyStrata exploits this sparsity by keeping frequently used experts on the GPU and streaming rarely used ones from RAM/SSD, overlapping computation to hide latency.\n\n---\n\n## 1. Architectural Design\n\n### 1.1 The Model: A Sparse MoE Team\n\nQwen3.8-Flash-Next is not a monolithic transformer. It is a **Mixture-of-Experts (MoE)** model with:\n- **24,576 experts** (small specialized feed-forward networks).\n- **Sparse activation**: Each token activates only **~10 experts** out of 24,576.\n- **Shared components**: Attention layers, DeltaNet mixers, routers, shared experts, and output heads are dense and always active.\n\nThis sparsity is the foundation of PolyStrata\u2019s design. Instead of loading all 24,576 experts into VRAM (which would require hundreds of GB), PolyStrata treats experts as a **cacheable resource**.\n\n### 1.2 Memory Tiering: The \"Kitchen\" Analogy\n\nPolyStrata implements a three-tier memory hierarchy:\n\n| Tier | Storage | Contents | Role |\n|------|---------|----------|------|\n| **GPU (VRAM)** | Fast, expensive | Dense layers (attention, routers, shared experts), KV cache, **expert cache** | Primary compute engine. Holds the most frequently accessed experts. |\n| **RAM (System)** | Medium speed, large capacity | **All 24,576 experts** (pinned) | Secondary compute engine. CPU computes experts not cached on GPU. |\n| **SSD** | Slow, massive capacity | **28.8 GB n-gram lookup",
"usage": null,
"timings": {
"cache_n": 0,
"prompt_n": 1696,
"prompt_ms": 1412.811,
"prompt_per_token_ms": 0.8330253537735849,
"prompt_per_second": 1200.44365452987,
"predicted_n": 512,
"predicted_ms": 3924.373,
"predicted_per_token_ms": 7.67979060665362,
"predicted_per_second": 130.21188352891025,
"draft_n": 440,
"draft_n_accepted": 319
},
"err": null,
"pieces": 512
},
"metrics": {
"ok": true,
"err": null,
"ttft_s": 1.424,
"total_s": 5.349,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 1696,
"generated_tokens": 512,
"prompt_tps": 1200.44365452987,
"prompt_tps_source": "engine",
"decode_tps": 130.21188352891025,
"decode_tps_source": "engine",
"prompt_ms": 1412.811,
"decode_ms": 3924.373,
"drafts_offered": 440,
"drafts_accepted": 319
}
},
{
"run": 2,
"source": "docs/INSTALL.md",
"messages": [
{
"role": "user",
"content": "Run identifier 2-1. Read the following project documentation and write a detailed technical explanation of its design, tradeoffs, and how someone would use it in practice.\n\n# Installing PolyStrata\n\nEverything about installing, starting, updating and configuring PolyStrata, on Windows and Linux, with an NVIDIA or an\nAMD graphics card. The short version is in the [README](../README.md#install); an AI coding assistant can do all of\nthis for you with [AI_SETUP.md](AI_SETUP.md).\n\n> **On this page:** [What you need](#what-you-need) \u00b7 [Windows](#windows) \u00b7 [Linux](#linux) \u00b7\n> [AMD cards](#amd-cards) \u00b7 [Several cards](#two-or-three-cards) \u00b7 [Docker](#docker-linux) \u00b7\n> [Older CPUs](#older-cpus-experimental) \u00b7 [Updating](#updating) \u00b7 [Where things are stored](#where-things-are-stored) \u00b7\n> [Setup's questions](#setups-questions) \u00b7 [Tuning](#tuning-for-your-pc) \u00b7 [All options](#options-without-questions)\n\n## What you need\n\nThis is for Qwen3.8-Flash-Next. GLM 5.3 Flash needs Linux, one NVIDIA card and far more RAM:\n[GLM.md](GLM.md#what-you-need). The three smaller models (Qwen3.6-35B-A3B, Ornith 1.5, Gemma 4 26B-A4B) need Linux\nor Windows, one NVIDIA card and less of everything: [BACKENDS.md](BACKENDS.md#install).\n\n| | |\n| --- | --- |\n| **GPU** | **NVIDIA** RTX 20, 30, 40 or 50 series, **12 GB VRAM or more** (8 GB runs, slowly). Measured on an RTX 5070 and an RTX 3090; RTX 20 (Turing, since 0.1.27) was tested by a contributor on an RTX 2070. **AMD** Radeon RX 7900 XT / XTX, RX 9070 / 9070 XT and Radeon AI PRO R9700 (validated), RX 7800 XT / 7700 XT and RX 9060 XT (validated by their owners), RX 6800 / 6900 series (community-reported), with 12 GB of VRAM or more. See [AMD cards](#amd-cards). |\n| **RAM** | Enough for the size you pick ([which model](MODELS.md#pick-by-ram)); **64 GB** runs every size. A big GPU makes up for less RAM - the [low-RAM mode](MODELS.md#a-big-graphics-card-and-little-ram). |\n| **CPU** | x86-64 with AVX2 (any Intel/AMD desktop CPU from the last ~8 years). AVX-512 (Ryzen 7000/9000) is a bit faster. Older CPUs without AVX2 are experimental and slow: [Older CPUs](#older-cpus-experimental). |\n| **Disk** | ~70-80 GB free for the model, ~6 GB for the MTP layer (+1 GB with images). **Q2_0 on an AVX-512 CPU** also writes a one-time ~40 GB copy of its experts for the fast CPU kernel. On Linux with an AMD card, ROCm takes ~10 GB more when setup installs it. An NVMe SSD is strongly recommended: it makes the first start much faster. |\n| **OS** | Windows 10/11, or Linux (Ubuntu 22.04/24.04 and Debian 12/13 get everything installed automatically). |\n| **Driver** | **NVIDIA:** a current driver, version 580 or newer ([nvidia.com/drivers](https://www.nvidia.com/drivers) or the NVIDIA App). **AMD:** on Linux the kernel's amdgpu driver (no ROCm install needed); on Windows a current AMD Software: Adrenalin Edition driver ([amd.com/support](https://www.amd.com/en/support)). |\n\nThe driver is the only thing you install yourself. Everything else - Python, the engine, the model - is set up for\nyou the first time: Python 3.12 if you have none (for your user account, no admin), a private Python environment in\n`.venv/`, the PolyStrata engine, the model and the MTP draft layer. On NVIDIA it uses the ready-made engine for RTX\n20/30/40/50 and NVIDIA's CUDA libraries from pip (~0.4 GB); if no ready-made engine fits your PC, it offers to install\nthe build tools (Visual Studio Build Tools + CUDA Toolkit on Windows, `build-essential` + CUDA on Ubuntu) and compiles\nthe engine for your GPU (asks first; 20-40 minutes once). More: [details](DETAILS.md#before-you-start).\n\n## Windows\n\n1. [Download this project](https://github.com/VecSzn/PolyStrata/archive/refs/heads/main.zip) and unzip it (or\n `git clone` it).\n2. Double-click **`START-HERE.bat`**.\n3. Answer a few questions - or just press Enter each time for the recommended choice ([the questions](#setups-questions)).\n\nThen it downloads everything (the model is ~70 GB, so the first time takes a while - you can stop and it picks up\nwhere it left off) and **starts the model**. Your browser opens the PolyStrata app at `http://127.0.0.1:8080`.\n\n> **While the model starts, your PC can be slow or stop responding for 1-3 minutes** (longest the first time): PolyStrata\n> loads 35-55 GB into your RAM and locks part of it for the graphics card. That's normal - wait, and don't close the\n> window. The window tells you what it is doing.\n\n**Next time**, just double-click `START-HERE.bat` again: it starts right away (30-90 s to load the model), nothing is\ndownloaded twice. Close its window to stop the model. `SETUP.bat` (the same as `START-HERE.bat --setup`) installs\nanother model or changes the settings. Starting PolyStrata from Task Scheduler at logon needs two task settings, or the\nstart is 24x slower: [Running it at startup](DETAILS.md#running-it-at-startup-task-scheduler).\n\Line truncated
}
],
"response": {
"first": 2.2798871099948883,
"total": 6.582283739000559,
"text": "# PolyStrata: Technical Design, Tradeoffs, and Practical Usage\n\n## 1. Executive Summary\n\n**PolyStrata** is a specialized local inference engine designed to run large language models (LLMs), specifically optimized for the **Qwen3.8-Flash-Next** model, on consumer-grade hardware. Its core architectural innovation lies in its hybrid memory management strategy, which aggressively balances GPU VRAM and system RAM to enable the execution of massive models (70\u201380 GB) on GPUs with as little as 12 GB of VRAM.\n\nThe project prioritizes **accessibility** and **automation**. It abstracts away the complex dependencies of Python environments, CUDA/ROCm drivers, and model quantization formats, providing a \"one-click\" experience for Windows and Linux users. It supports both NVIDIA (CUDA) and AMD (HIP/ROCm) backends, with specific optimizations for multi-GPU setups and older CPU architectures.\n\n---\n\n## 2. Core Design & Architecture\n\n### 2.1. Hybrid Memory Management (The \"PolyStrata\" Concept)\nThe defining feature of PolyStrata is its approach to memory constraints. Standard LLM inference requires the entire model weights to fit into VRAM. PolyStrata circumvents this by:\n1. **Expert Offloading:** It likely utilizes a Mixture-of-Experts (MoE) architecture or a similar sparse activation pattern where only a subset of the model's parameters (experts) are active per token.\n2. **RAM-VRAM Swapping:** It loads 35\u201355 GB of model data into system RAM and \"locks\" a portion of it for the GPU. This suggests a mechanism where inactive experts reside in system RAM (or are streamed from disk) and are swapped into VRAM only when needed for computation.\n3. **Low-RAM Mode:** For systems with limited RAM, it can map experts from a \"pack\" (disk) instead of keeping them fully resident in RAM, trading speed for memory footprint.\n\n### 2.2. Backend Abstraction\nPolyStrata abstracts the underlying compute backend:\n* **NVIDIA (CUDA):** Uses pre-compiled engines for RTX 20/30/40/50 series. It leverages NVIDIA's CUDA libraries via pip. If a pre-compiled engine isn't available, it can compile a custom engine using Visual Studio Build Tools (Windows) or `build-essential",
"usage": null,
"timings": {
"cache_n": 0,
"prompt_n": 4370,
"prompt_ms": 2257.179,
"prompt_per_token_ms": 0.516516933638444,
"prompt_per_second": 1936.0449481410203,
"predicted_n": 512,
"predicted_ms": 4301.962,
"predicted_per_token_ms": 8.418712328767125,
"predicted_per_second": 118.78301110051645,
"draft_n": 444,
"draft_n_accepted": 292
},
"err": null,
"pieces": 512
},
"metrics": {
"ok": true,
"err": null,
"ttft_s": 2.28,
"total_s": 6.582,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 4370,
"generated_tokens": 512,
"prompt_tps": 1936.0449481410203,
"prompt_tps_source": "engine",
"decode_tps": 118.78301110051645,
"decode_tps_source": "engine",
"prompt_ms": 2257.179,
"decode_ms": 4301.962,
"drafts_offered": 444,
"drafts_accepted": 292
}
},
{
"run": 2,
"source": "docs/DETAILS.md",
"messages": [
{
"role": "user",
"content": "Run identifier 2-2. Read the following project documentation and write a detailed technical explanation of its design, tradeoffs, and how someone would use it in practice.\n\n# PolyStrata - the details\n\nThe technical side of PolyStrata: every measured number, the API, images, all settings and how the engine works.\nNew here? Start with the [README](../README.md); installing step by step is in [INSTALL.md](INSTALL.md), the models in\n[MODELS.md](MODELS.md), common problems in [TROUBLESHOOTING.md](TROUBLESHOOTING.md).\n\n> **On this page:** [Speed](#speed-measured) \u00b7 [Other GPUs](#other-gpus-estimated) \u00b7 [Which model?](#which-model) \u00b7\n> [Requirements](#before-you-start) \u00b7 [Windows](#windows) \u00b7 [Linux](#linux) \u00b7 [API](#using-it) \u00b7\n> [MCP tools](#tools-from-mcp-servers) \u00b7 [MCP server](#manage-strata-from-your-ai-assistant-mcp-server) \u00b7\n> [Images](#images-vision) \u00b7\n> [Troubleshooting](#troubleshooting) \u00b7 [How it works](#how-it-works)\n\n---\n\n## Speed (measured)\n\nRTX 5070 **12 GB**, Ryzen 5 7600 (6 cores), 64 GB DDR5-5200, Windows, engine 0.1.26 with the settings setup writes\n(`--prefill auto`, 8-bit KV above 4K, KV streaming from 64K). One code-agent prompt per length, 256 generated tokens,\nMTP speculative decoding on. \"262K\" is the model's full context window (a 259,943-token prompt). The IQ2_XS row was\nmeasured with Swift 1.5's IQ2_XS, which runs at the original's speed.\n\n**Engine 0.1.36 (#136), the same PC:** Q2_0's prompt experts run on fused int8 tensor-core kernels (RTX 30 and newer):\n4K 1,294 -> 1,570, 32K 2,170 -> 2,653, 128K 2,123 -> 2,468 tokens/s (+16-22%), as close to an FP16 reference as the\nprevious kernels (closer at 32K: teacher-forced KL 0.009 vs 0.012). The decode path's block selection and greedy\nargmax run on thread-block clusters (RTX 50, sm_90+; other cards keep the previous kernels; the same tokens): Q2_0 output at 4K 89 -> 93.5, at 128K\n64.5 -> 76.4 tokens/s. `STRATA_PF_FUSED=0` keeps the previous prompt kernels (byte-identical answers to 0.1.35);\n`STRATA_PF_FUSED=1` also runs the native IQ packs' fused kernels (opt-in: IQ2_XS prompts +12% at 4K, +3% at 32K, the\nIQ3 packs about even; on HIP they run on gfx11 and on gfx1200 / gfx1201, see AMD_HIP.md); `STRATA_QSA_CLUSTER=0` / `STRATA_ARGMAX_MULTI=0` turn the decode kernels off. The tables\nbelow are 0.1.26's.\n\n### Prompt processing (tokens/s)\n\n| Model | 1K | 4K | 32K | 64K | 128K | 262K |\n| --- | ---: | ---: | ---: | ---: | ---: | ---: |\n| **Q2_0** | 536 | 1,299 | 2,171 | 2,126 | 2,107 | 1,304\u2020 |\n| **IQ2_XS** | 534 | 1,256 | 2,092 | 1,754 | 1,752 | 1,181*\u2020 |\n| **IQ3_XXS** | 482 | 1,007 | 1,745 | 1,609 | 1,602 | - |\n| **IQ3_S** | 427 | 913 | 1,624 | 1,640 | 1,443 | - |\n| **Coder** | 656 | 1,583 | 2,177 | 2,236 | 2,208 | 1,034** |\n| **IQ3_S** (AMD RX 7900 XTX, gfx1100) | 760 | 1,275 | 1,641 | 1,594 | 1,494 | - |\n\nEngine 0.1.26; `bench/results/2026-09-29-speed-0126`. The AMD RX 7900 XTX row: engine 0.1.38 on a ROCm\n10.2 nightly with a tuned gfx1100 hipBLASLt-100500 table (upstream as [#755](https://github.com/Niko1221/Strata/pull/755)),\nthe median of 3 clean cells per tier\n(Ryzen 9 7900X, 96 GB; 1K-128K one-shot runs, 256 generated tokens,\ngreedy). At 32K-128K that is 8-28% faster than 0.1.22. \u2020 not measured\nagain: 0.1.22. \\* measured with images on (the image encoder's VRAM reserve leaves fewer experts cached). \\*\\* not\nmeasured again: 0.1.14.\n\n### Output (tokens/s)\n\n| Model | 1K | 4K | 32K | 64K | 128K | 262K |\n| --- | ---: | ---: | ---: | ---: | ---: | ---: |\n| **Q2_0** | 87.3 | 93.0 | 81.8 | 76.2 | 73.7 | 60.3\u2020 |\n| **IQ2_XS** | 79.6 | 78.6 | 76.3 | 63.7 | 62.7 | 52.8\u2020 |\n| **IQ3_XXS** | 61.9 | 61.6 | 58.5 | 57.2 | 49.0 | - |\n| **IQ3_S** | 52.4 | 53.3 | 48.3 | 46.3 | 45.5 | - |\n| **Coder** | 58.9 | 55.1 | 54.9 | 53.2 | 43.0 | 42.8\u2020 |\n| **IQ3_S** (AMD RX 7900 XTX, gfx1100) | 65.1 | 60.4 | 64.4 | 61.8 | 59.2 | - |\n\nEngine 0.1.26, the same runs. The AMD RX 7900 XTX row: engine 0.1.38 on a ROCm 10.2 nightly (tuned\ngfx1100 hipBLASLt-100500 table, upstream as [#755](https://github.com/Niko1221/Strata/pull/755)), median of 3 clean cells per tier (same box; decode is flat in\ncontext - the GDN linear attention is O(1) per token; 1K/4K prefill ran slightly under the 0.1.31\npackaged-ROCm numbers, 32K-128K ahead). \u2020 not measured again: 0.1.14.\n\nOutput speed depends on the text as well: speculative decoding runs faster when more of the drafted tokens are\naccepted, so a different answer to the same prompt moves it by several percent. Run back to back on the 4K prompt,\n0.1.14 writes 88.5 tokens/s and 0.1.12 85.7. The numbers before 0.1.13 (prompts about half as fast):\n[`bench/results/2026-09-24-final`](../bench/results/2026-09-24-final/matrix.md); these:\n[`bench/results/2026-09-28-speed-0114`](../bench/results/2026-09-28-speed-0114/README.md).\n\nIQ3_XXS and IQ3_S at 262K are not measLine truncated
}
],
"response": {
"first": 2.500783983618021,
"total": 6.877007979899645,
"text": "# PolyStrata: Technical Design, Tradeoffs, and Practical Usage\n\n## Executive Summary\n\nPolyStrata is a high-performance inference engine designed for **Mixture-of-Experts (MoE)** Large Language Models (LLMs), specifically optimized for consumer-grade hardware (RTX 30/50 series, AMD RDNA3/4) and constrained memory environments (12GB\u201364GB VRAM/RAM). Its core innovation lies in a hybrid memory management system that dynamically balances **Expert weights** (the model parameters) and **KV Cache** (context memory) across VRAM, RAM, and Disk, combined with aggressive speculative decoding and quantization strategies.\n\nThe engine prioritizes **throughput** (tokens/sec) and **context length** over absolute precision, utilizing advanced quantization (IQ2_XS, Q2_0) and speculative decoding (MTP) to achieve usable speeds on models that would otherwise be too large or slow for local hardware.\n\n---\n\n## 1. Core Architecture & How It Works\n\n### 1.1 The MoE Challenge\nStandard LLMs store all weights in VRAM. MoE models (like Mixtral, DeepSeek, or specialized PolyStrata models) have a small \"shared\" attention layer and a large set of \"expert\" layers. Only a subset of experts is active per token.\n* **Problem:** Storing all experts in VRAM is impossible for large models on consumer GPUs.\n* **PolyStrata Solution:** A **Tiered Memory System**.\n 1. **VRAM:** Holds the most frequently accessed experts and the active KV cache slice.\n 2. **RAM:** Holds the full set of experts (pinned or memory-mapped) and overflow KV cache.\n 3. **Disk:** Used in \"Low-RAM mode\" via memory-mapped files (`mmap`) for experts when RAM is insufficient.\n\n### 1.2 KV Cache Streaming & Management\nThe KV cache (Key-Value pairs for attention) grows linearly with context length. PolyStrata decouples KV storage from expert storage.\n* **Standard Mode:** KV cache resides in VRAM.\n* **Streaming Mode (`--kv-streaming`):** For contexts >64K, the KV cache is stored in **RAM**, and only the \"active window\" (e.g., last 32K tokens) is copied to VRAM. This",
"usage": null,
"timings": {
"cache_n": 0,
"prompt_n": 5048,
"prompt_ms": 2478.715,
"prompt_per_token_ms": 0.49102912044374014,
"prompt_per_second": 2036.5390938449962,
"predicted_n": 512,
"predicted_ms": 4375.85,
"predicted_per_token_ms": 8.563307240704502,
"predicted_per_second": 116.77731183655746,
"draft_n": 452,
"draft_n_accepted": 291
},
"err": null,
"pieces": 512
},
"metrics": {
"ok": true,
"err": null,
"ttft_s": 2.501,
"total_s": 6.877,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 5048,
"generated_tokens": 512,
"prompt_tps": 2036.5390938449962,
"prompt_tps_source": "engine",
"decode_tps": 116.77731183655746,
"decode_tps_source": "engine",
"prompt_ms": 2478.715,
"decode_ms": 4375.85,
"drafts_offered": 452,
"drafts_accepted": 291
}
}
]
@@ -0,0 +1,13 @@
[
"/opt/polystrata-v0.1.45-poly.1/.venv/bin/python",
"/opt/polystrata-v0.1.45-poly.1/tools/strata_bench.py",
"--url",
"http://127.0.0.1:18091",
"--config",
"/opt/us2-results/step9/2026-10-17-rtx3090/fork-qwen36-q3km/server.json",
"--runs",
"3",
"--long",
"--out",
"/opt/us2-results/step9/2026-10-17-rtx3090/fork-qwen36-q3km/community"
]
@@ -0,0 +1,64 @@
# Community benchmark on NVIDIA GeForce RTX 3090
Measured on 2026-10-18 with `tools/strata_bench.py` (suite 1, 3 runs per test, medians with ranges). Speeds are the engine's own timings; first-token times are measured by the client over HTTP. Speed only: no correctness check was run.
## Hardware and software
- GPU and VRAM: NVIDIA GeForce RTX 3090, 24 GiB VRAM
- CPU: AMD EPYC 7H12 64-Core Processor (? cores, 256 threads); installed RAM: 1007.6 GiB; storage: not measured
- OS: Linux 6.8.0-107-generic; GPU driver: 580.126.20; CUDA: 13.0
- PolyStrata: project 0.1.45, commit d0cd84dc; engine b11062-3cf03257f
- Background workloads and power limits: not recorded
## Model and configuration
- Model and quantization: qwen3.6-35b-a3b-ud-q3_k_m
- Context: 32768 tokens; parallel slots: 1
- Settings: the install's own configuration, unchanged; thinking off for the suite; temperature 0
```text
unbiased-strata --model Qwen3.6-35B-A3B-UD-Q3_K_M.gguf --max-context 32768 --expert-profile expert-profile.txt --tail-skip 6
```
## Method
Run by `python tools/strata_bench.py --long` against the HTTP API of a PolyStrata server (already running); model loading is not timed. One warm-up chat and a 1K prompt are discarded first. Every prompt starts with a unique tag, so the conversation cache cannot help the fresh-prompt tests.
- short chat: the three questions of `tools/ab_engine.py`, up to 100 new tokens, 3 runs
- 4K / 16K prompts: generated word lists sized by a calibration request, 24 new tokens, 3 fresh prompts each
- agent session: system prompt and four tools, then 5 turns that each add about 1500 words of a project file and continue from the model's own earlier answers (the way agent clients resend a conversation), 64 new tokens per turn, 3 sessions; the cache numbers come from the answer's usage (`cached_tokens`) and timings (`prompt_n`)
- concurrency (when run): N requests sent at the same moment, total tokens over the wall time of the burst, latency over all requests
## Results
| Configuration | Actual prompt tokens | Reused tokens | Generated tokens | Runs | Prompt tok/s median and range | Decode tok/s median and range | TTFT seconds median and range |
| --- | ---: | ---: | ---: | ---: | --- | --- | --- |
| short chat | not measured | 0 | 100 (100-100) | 9 | not measured | 213.5 (196.5-259.2) | 0.11 (0.11-0.12) |
| 4K prompt, fresh | not measured | 0 (0-0) | 24 cap | 3 | 3821.6 (3792.1-3831.6) | not measured | 1.06 (1.06-1.07) |
| 16K prompt, fresh | not measured | 0 (0-0) | 24 cap | 3 | 3486.3 (3482.9-3497.4) | not measured | 4.61 (4.57-4.61) |
| agent session, follow-up turns | not measured at the last turn | see below | up to 64 | 3 | see below | 186.9 (169.4-202.8) | 1.07 (0.52-1.20) |
Ranges are the lowest and highest of the runs; `Runs` counts requests that returned a token.
### Agent session (conversation cache)
Cache hit over the follow-up turns: 3254100.0 % (3253300.0-3258000.0); earlier-turn tokens read again per session: 0 (0-0) (earlier turns that the cache did not hold; the 14339 (14339-14339) new tokens of the files are read once); first turn (nothing cached) first token: 0.28 s (0.28-0.29).
| Turn (run 1) | Prompt tokens | Reused | Read | Prompt tok/s | First token (s) | Decode tok/s |
| ---: | ---: | ---: | ---: | ---: | ---: | ---: |
| 0 | None | 0 | 645 | 2343.2987106407563 | 0.285 | 200.12007204322592 |
| 1 | None | 663 | 3559 | 3214.3276464691166 | 1.127 | 177.32750717674534 |
| 2 | None | 4275 | 1597 | 3283.393676229011 | 0.523 | 193.90111735518875 |
| 3 | None | 5928 | 3372 | 2946.8904275875084 | 1.182 | 181.11055450657008 |
| 4 | None | 9347 | 2922 | 3027.449078865981 | 1.028 | 194.72337825970752 |
| 5 | None | 12320 | 2889 | 2871.538176349618 | 1.052 | 171.04320062552944 |
### Skipped and failed
- skipped 32K: the context is 32768 tokens
Per-request data: `results.json`. Engine log lines from the start: `engine-log-excerpt.txt` (when this run started the server).
## Correctness and limitations
Not measured: this is a speed suite. The conversation uses the model's own replies, so token counts differ a little between runs. Machine details come from the server, `nvidia-smi`/`rocm-smi` and the OS; background load and power limits are not recorded. Total time of the suite: 45 s.
@@ -0,0 +1,834 @@
{
"schema": 1,
"tool": "tools/strata_bench.py",
"date": "2026-10-18",
"params": {
"runs": 3,
"think": false,
"clients": 0,
"long": true,
"started_server": false,
"command": "python tools/strata_bench.py --long"
},
"elapsed_s": 44.598809242248535,
"machine": {
"gpu": [
"NVIDIA GeForce RTX 3090"
],
"gpu_vram_mib": 24576,
"gpu_driver": "580.126.20",
"cuda": "13.0",
"cpu": "AMD EPYC 7H12 64-Core Processor",
"cpu_cores": null,
"cpu_threads": 256,
"ram_gib": 1007.6,
"os": "Linux 6.8.0-107-generic",
"python": "3.12.3",
"strata_version": "0.1.45",
"strata_commit": "d0cd84dc",
"engine_version": "b11062-3cf03257f",
"model": "qwen3.6-35b-a3b-ud-q3_k_m",
"quant": "UD-Q3_K_M",
"context": 32768,
"parallel_slots": 1,
"config": {
"exe": "unbiased-strata",
"engine": "strata-poly",
"model_name": "qwen3.6-35b-a3b-ud-q3_k_m",
"args": [
"--model",
"Qwen3.6-35B-A3B-UD-Q3_K_M.gguf",
"--max-context",
"32768",
"--expert-profile",
"expert-profile.txt",
"--tail-skip",
"6"
]
},
"launch": "unbiased-strata --model Qwen3.6-35B-A3B-UD-Q3_K_M.gguf --max-context 32768 --expert-profile expert-profile.txt --tail-skip 6",
"engine_info": {},
"vram_after": {}
},
"results": {
"chat": {
"requests": [
{
"ok": true,
"err": null,
"ttft_s": 0.117,
"total_s": 0.517,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 51,
"generated_tokens": 100,
"prompt_tps": 455.7681480620917,
"prompt_tps_source": "engine",
"decode_tps": 247.63991655285238,
"decode_tps_source": "engine",
"prompt_ms": 111.899,
"decode_ms": 399.774,
"drafts_offered": 70,
"drafts_accepted": 65,
"run": 0,
"prompt": 0
},
{
"ok": true,
"err": null,
"ttft_s": 0.112,
"total_s": 0.614,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 43,
"generated_tokens": 100,
"prompt_tps": 400.1042131904124,
"prompt_tps_source": "engine",
"decode_tps": 197.2964408917799,
"decode_tps_source": "engine",
"prompt_ms": 107.472,
"decode_ms": 501.783,
"drafts_offered": 73,
"drafts_accepted": 52,
"run": 0,
"prompt": 1
},
{
"ok": true,
"err": null,
"ttft_s": 0.107,
"total_s": 0.573,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 46,
"generated_tokens": 100,
"prompt_tps": 444.7968438763078,
"prompt_tps_source": "engine",
"decode_tps": 212.396215485615,
"decode_tps_source": "engine",
"prompt_ms": 103.418,
"decode_ms": 466.11,
"drafts_offered": 73,
"drafts_accepted": 58,
"run": 0,
"prompt": 2
},
{
"ok": true,
"err": null,
"ttft_s": 0.114,
"total_s": 0.495,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 51,
"generated_tokens": 100,
"prompt_tps": 468.69830533397055,
"prompt_tps_source": "engine",
"decode_tps": 259.2152324296584,
"decode_tps_source": "engine",
"prompt_ms": 108.812,
"decode_ms": 381.922,
"drafts_offered": 81,
"drafts_accepted": 72,
"run": 1,
"prompt": 0
},
{
"ok": true,
"err": null,
"ttft_s": 0.11,
"total_s": 0.611,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 43,
"generated_tokens": 100,
"prompt_tps": 407.1738348199913,
"prompt_tps_source": "engine",
"decode_tps": 197.40187232684966,
"decode_tps_source": "engine",
"prompt_ms": 105.606,
"decode_ms": 501.515,
"drafts_offered": 75,
"drafts_accepted": 52,
"run": 1,
"prompt": 1
},
{
"ok": true,
"err": null,
"ttft_s": 0.108,
"total_s": 0.571,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 46,
"generated_tokens": 100,
"prompt_tps": 445.01199597554375,
"prompt_tps_source": "engine",
"decode_tps": 213.49596406366925,
"decode_tps_source": "engine",
"prompt_ms": 103.368,
"decode_ms": 463.709,
"drafts_offered": 70,
"drafts_accepted": 56,
"run": 1,
"prompt": 2
},
{
"ok": true,
"err": null,
"ttft_s": 0.11,
"total_s": 0.494,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 51,
"generated_tokens": 100,
"prompt_tps": 484.6572712845318,
"prompt_tps_source": "engine",
"decode_tps": 257.19630052998025,
"decode_tps_source": "engine",
"prompt_ms": 105.229,
"decode_ms": 384.92,
"drafts_offered": 81,
"drafts_accepted": 72,
"run": 2,
"prompt": 0
},
{
"ok": true,
"err": null,
"ttft_s": 0.108,
"total_s": 0.611,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 43,
"generated_tokens": 100,
"prompt_tps": 417.2731683648714,
"prompt_tps_source": "engine",
"decode_tps": 196.54400203293997,
"decode_tps_source": "engine",
"prompt_ms": 103.05,
"decode_ms": 503.704,
"drafts_offered": 67,
"drafts_accepted": 49,
"run": 2,
"prompt": 1
},
{
"ok": true,
"err": null,
"ttft_s": 0.107,
"total_s": 0.555,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 46,
"generated_tokens": 100,
"prompt_tps": 444.71084127690017,
"prompt_tps_source": "engine",
"decode_tps": 221.2137259765245,
"decode_tps_source": "engine",
"prompt_ms": 103.438,
"decode_ms": 447.531,
"drafts_offered": 68,
"drafts_accepted": 58,
"run": 2,
"prompt": 2
}
],
"decode_tps": {
"median": 213.496,
"min": 196.544,
"max": 259.215,
"n": 9
},
"ttft_s": {
"median": 0.11,
"min": 0.107,
"max": 0.117,
"n": 9
},
"generated_tokens": {
"median": 100,
"min": 100,
"max": 100,
"n": 9
},
"prompt_tokens": null
},
"prompts": {
"4K": {
"target_tokens": 4096,
"requests": [
{
"ok": true,
"err": null,
"ttft_s": 1.073,
"total_s": 1.242,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 3939,
"generated_tokens": 24,
"prompt_tps": 3792.145378088158,
"prompt_tps_source": "engine",
"decode_tps": 136.10997686130395,
"decode_tps_source": "engine",
"prompt_ms": 1038.726,
"decode_ms": 168.981,
"drafts_offered": 15,
"drafts_accepted": 8,
"run": 0
},
{
"ok": true,
"err": null,
"ttft_s": 1.056,
"total_s": 1.215,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 3939,
"generated_tokens": 24,
"prompt_tps": 3831.5704283304703,
"prompt_tps_source": "engine",
"decode_tps": 144.43879249169478,
"decode_tps_source": "engine",
"prompt_ms": 1028.038,
"decode_ms": 159.237,
"drafts_offered": 17,
"drafts_accepted": 8,
"run": 1
},
{
"ok": true,
"err": null,
"ttft_s": 1.064,
"total_s": 1.218,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 3939,
"generated_tokens": 24,
"prompt_tps": 3821.6338042380457,
"prompt_tps_source": "engine",
"decode_tps": 150.3611937371294,
"decode_tps_source": "engine",
"prompt_ms": 1030.711,
"decode_ms": 152.965,
"drafts_offered": 18,
"drafts_accepted": 8,
"run": 2
}
],
"prompt_tps": {
"median": 3821.634,
"min": 3792.145,
"max": 3831.57,
"n": 3
},
"ttft_s": {
"median": 1.064,
"min": 1.056,
"max": 1.073,
"n": 3
},
"prompt_tokens": null,
"reused_tokens": {
"median": 0,
"min": 0,
"max": 0,
"n": 3
}
},
"16K": {
"target_tokens": 16384,
"requests": [
{
"ok": true,
"err": null,
"ttft_s": 4.572,
"total_s": 4.732,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 15716,
"generated_tokens": 24,
"prompt_tps": 3497.353952203571,
"prompt_tps_source": "engine",
"decode_tps": 144.20153104408178,
"decode_tps_source": "engine",
"prompt_ms": 4493.683,
"decode_ms": 159.499,
"drafts_offered": 17,
"drafts_accepted": 13,
"run": 0
},
{
"ok": true,
"err": null,
"ttft_s": 4.611,
"total_s": 4.755,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 15716,
"generated_tokens": 24,
"prompt_tps": 3482.949922954471,
"prompt_tps_source": "engine",
"decode_tps": 160.09800782392003,
"decode_tps_source": "engine",
"prompt_ms": 4512.267,
"decode_ms": 143.662,
"drafts_offered": 15,
"drafts_accepted": 12,
"run": 1
},
{
"ok": true,
"err": null,
"ttft_s": 4.607,
"total_s": 4.754,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 15716,
"generated_tokens": 24,
"prompt_tps": 3486.289980532145,
"prompt_tps_source": "engine",
"decode_tps": 157.22625541746987,
"decode_tps_source": "engine",
"prompt_ms": 4507.944,
"decode_ms": 146.286,
"drafts_offered": 15,
"drafts_accepted": 12,
"run": 2
}
],
"prompt_tps": {
"median": 3486.29,
"min": 3482.95,
"max": 3497.354,
"n": 3
},
"ttft_s": {
"median": 4.607,
"min": 4.572,
"max": 4.611,
"n": 3
},
"prompt_tokens": null,
"reused_tokens": {
"median": 0,
"min": 0,
"max": 0,
"n": 3
}
}
},
"agent": {
"sessions": [
[
{
"ok": true,
"err": null,
"ttft_s": 0.285,
"total_s": 0.375,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 645,
"generated_tokens": 18,
"prompt_tps": 2343.2987106407563,
"prompt_tps_source": "engine",
"decode_tps": 200.12007204322592,
"decode_tps_source": "engine",
"prompt_ms": 275.253,
"decode_ms": 89.946,
"drafts_offered": 12,
"drafts_accepted": 9,
"run": 0,
"turn": 0
},
{
"ok": true,
"err": null,
"ttft_s": 1.127,
"total_s": 1.426,
"prompt_tokens": null,
"reused_tokens": 663,
"read_tokens": 3559,
"generated_tokens": 53,
"prompt_tps": 3214.3276464691166,
"prompt_tps_source": "engine",
"decode_tps": 177.32750717674534,
"decode_tps_source": "engine",
"prompt_ms": 1107.23,
"decode_ms": 298.882,
"drafts_offered": 36,
"drafts_accepted": 27,
"run": 0,
"turn": 1
},
{
"ok": true,
"err": null,
"ttft_s": 0.523,
"total_s": 0.812,
"prompt_tokens": null,
"reused_tokens": 4275,
"read_tokens": 1597,
"generated_tokens": 56,
"prompt_tps": 3283.393676229011,
"prompt_tps_source": "engine",
"decode_tps": 193.90111735518875,
"decode_tps_source": "engine",
"prompt_ms": 486.387,
"decode_ms": 288.807,
"drafts_offered": 35,
"drafts_accepted": 28,
"run": 0,
"turn": 2
},
{
"ok": true,
"err": null,
"ttft_s": 1.182,
"total_s": 1.442,
"prompt_tokens": null,
"reused_tokens": 5928,
"read_tokens": 3372,
"generated_tokens": 47,
"prompt_tps": 2946.8904275875084,
"prompt_tps_source": "engine",
"decode_tps": 181.11055450657008,
"decode_tps_source": "engine",
"prompt_ms": 1144.257,
"decode_ms": 259.51,
"drafts_offered": 34,
"drafts_accepted": 25,
"run": 0,
"turn": 3
},
{
"ok": true,
"err": null,
"ttft_s": 1.028,
"total_s": 1.291,
"prompt_tokens": null,
"reused_tokens": 9347,
"read_tokens": 2922,
"generated_tokens": 51,
"prompt_tps": 3027.449078865981,
"prompt_tps_source": "engine",
"decode_tps": 194.72337825970752,
"decode_tps_source": "engine",
"prompt_ms": 965.169,
"decode_ms": 261.91,
"drafts_offered": 33,
"drafts_accepted": 30,
"run": 0,
"turn": 4
},
{
"ok": true,
"err": null,
"ttft_s": 1.052,
"total_s": 1.422,
"prompt_tokens": null,
"reused_tokens": 12320,
"read_tokens": 2889,
"generated_tokens": 64,
"prompt_tps": 2871.538176349618,
"prompt_tps_source": "engine",
"decode_tps": 171.04320062552944,
"decode_tps_source": "engine",
"prompt_ms": 1006.081,
"decode_ms": 368.328,
"drafts_offered": 48,
"drafts_accepted": 36,
"run": 0,
"turn": 5
}
],
[
{
"ok": true,
"err": null,
"ttft_s": 0.286,
"total_s": 0.433,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 645,
"generated_tokens": 30,
"prompt_tps": 2363.8062778296962,
"prompt_tps_source": "engine",
"decode_tps": 203.2699356989437,
"decode_tps_source": "engine",
"prompt_ms": 272.865,
"decode_ms": 147.587,
"drafts_offered": 24,
"drafts_accepted": 17,
"run": 1,
"turn": 0
},
{
"ok": true,
"err": null,
"ttft_s": 1.115,
"total_s": 1.371,
"prompt_tokens": null,
"reused_tokens": 675,
"read_tokens": 3559,
"generated_tokens": 46,
"prompt_tps": 3269.5259784462996,
"prompt_tps_source": "engine",
"decode_tps": 179.3889855162893,
"decode_tps_source": "engine",
"prompt_ms": 1088.537,
"decode_ms": 256.426,
"drafts_offered": 41,
"drafts_accepted": 25,
"run": 1,
"turn": 1
},
{
"ok": true,
"err": null,
"ttft_s": 0.519,
"total_s": 0.81,
"prompt_tokens": null,
"reused_tokens": 4280,
"read_tokens": 1597,
"generated_tokens": 53,
"prompt_tps": 3308.3086815654497,
"prompt_tps_source": "engine",
"decode_tps": 182.62133982041084,
"decode_tps_source": "engine",
"prompt_ms": 482.724,
"decode_ms": 290.218,
"drafts_offered": 42,
"drafts_accepted": 28,
"run": 1,
"turn": 2
},
{
"ok": true,
"err": null,
"ttft_s": 1.198,
"total_s": 1.406,
"prompt_tokens": null,
"reused_tokens": 5930,
"read_tokens": 3372,
"generated_tokens": 41,
"prompt_tps": 2937.7863622938776,
"prompt_tps_source": "engine",
"decode_tps": 197.7752694085072,
"decode_tps_source": "engine",
"prompt_ms": 1147.803,
"decode_ms": 207.306,
"drafts_offered": 28,
"drafts_accepted": 24,
"run": 1,
"turn": 3
},
{
"ok": true,
"err": null,
"ttft_s": 1.014,
"total_s": 1.252,
"prompt_tokens": null,
"reused_tokens": 9343,
"read_tokens": 2922,
"generated_tokens": 48,
"prompt_tps": 2994.0242472928776,
"prompt_tps_source": "engine",
"decode_tps": 202.8414709387334,
"decode_tps_source": "engine",
"prompt_ms": 975.944,
"decode_ms": 236.638,
"drafts_offered": 33,
"drafts_accepted": 30,
"run": 1,
"turn": 4
},
{
"ok": true,
"err": null,
"ttft_s": 1.069,
"total_s": 1.407,
"prompt_tokens": null,
"reused_tokens": 12313,
"read_tokens": 2889,
"generated_tokens": 64,
"prompt_tps": 2864.5908216090693,
"prompt_tps_source": "engine",
"decode_tps": 186.8598936381621,
"decode_tps_source": "engine",
"prompt_ms": 1008.521,
"decode_ms": 337.151,
"drafts_offered": 49,
"drafts_accepted": 40,
"run": 1,
"turn": 5
}
],
[
{
"ok": true,
"err": null,
"ttft_s": 0.284,
"total_s": 0.446,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 645,
"generated_tokens": 32,
"prompt_tps": 2378.5027601694824,
"prompt_tps_source": "engine",
"decode_tps": 197.43823885090947,
"decode_tps_source": "engine",
"prompt_ms": 271.179,
"decode_ms": 162.076,
"drafts_offered": 18,
"drafts_accepted": 14,
"run": 2,
"turn": 0
},
{
"ok": true,
"err": null,
"ttft_s": 1.109,
"total_s": 1.357,
"prompt_tokens": null,
"reused_tokens": 677,
"read_tokens": 3559,
"generated_tokens": 47,
"prompt_tps": 3287.2678638393145,
"prompt_tps_source": "engine",
"decode_tps": 189.64383274220947,
"decode_tps_source": "engine",
"prompt_ms": 1082.662,
"decode_ms": 247.833,
"drafts_offered": 29,
"drafts_accepted": 22,
"run": 2,
"turn": 1
},
{
"ok": true,
"err": null,
"ttft_s": 0.518,
"total_s": 0.799,
"prompt_tokens": null,
"reused_tokens": 4283,
"read_tokens": 1597,
"generated_tokens": 56,
"prompt_tps": 3313.3330013776163,
"prompt_tps_source": "engine",
"decode_tps": 199.32656097613062,
"decode_tps_source": "engine",
"prompt_ms": 481.992,
"decode_ms": 280.946,
"drafts_offered": 38,
"drafts_accepted": 31,
"run": 2,
"turn": 2
},
{
"ok": true,
"err": null,
"ttft_s": 1.196,
"total_s": 1.458,
"prompt_tokens": null,
"reused_tokens": 5936,
"read_tokens": 3372,
"generated_tokens": 48,
"prompt_tps": 2937.8657085205077,
"prompt_tps_source": "engine",
"decode_tps": 183.46519894507512,
"decode_tps_source": "engine",
"prompt_ms": 1147.772,
"decode_ms": 261.63,
"drafts_offered": 31,
"drafts_accepted": 25,
"run": 2,
"turn": 3
},
{
"ok": true,
"err": null,
"ttft_s": 1.026,
"total_s": 1.284,
"prompt_tokens": null,
"reused_tokens": 9356,
"read_tokens": 2922,
"generated_tokens": 50,
"prompt_tps": 3034.283667101075,
"prompt_tps_source": "engine",
"decode_tps": 194.96749891793039,
"decode_tps_source": "engine",
"prompt_ms": 962.995,
"decode_ms": 256.453,
"drafts_offered": 39,
"drafts_accepted": 32,
"run": 2,
"turn": 4
},
{
"ok": true,
"err": null,
"ttft_s": 1.072,
"total_s": 1.422,
"prompt_tokens": null,
"reused_tokens": 12328,
"read_tokens": 2889,
"generated_tokens": 59,
"prompt_tps": 2892.2248306862152,
"prompt_tps_source": "engine",
"decode_tps": 169.36551086666344,
"decode_tps_source": "engine",
"prompt_ms": 998.885,
"decode_ms": 348.359,
"drafts_offered": 40,
"drafts_accepted": 31,
"run": 2,
"turn": 5
}
]
],
"hit_pct": {
"median": 3254100.0,
"min": 3253300.0,
"max": 3258000.0,
"n": 3
},
"reread_tokens": {
"median": 0,
"min": 0,
"max": 0,
"n": 3
},
"new_tokens": {
"median": 14339,
"min": 14339,
"max": 14339,
"n": 3
},
"turn_ttft_s": {
"median": 1.069,
"min": 0.518,
"max": 1.198,
"n": 15
},
"last_turn_prompt_tokens": null,
"turn_decode_tps": {
"median": 186.86,
"min": 169.366,
"max": 202.841,
"n": 15
},
"first_turn_ttft_s": {
"median": 0.285,
"min": 0.284,
"max": 0.286,
"n": 3
}
},
"clients": {},
"skipped": {
"32K": "the context is 32768 tokens"
},
"failures": []
}
}
@@ -0,0 +1,5 @@
{
"complete": true,
"bench_seconds": 44.7689471244812,
"finished_utc": "2026-10-18T06:37:21Z"
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,8 @@
{
"status": "ok",
"busy": false,
"service": "strata",
"loaded": true,
"model": "qwen3.6-35b-a3b-ud-q3_k_m",
"max_context": 32768
}
@@ -0,0 +1,9 @@
{
"arm": "fork-qwen36-q3km",
"engine_binary": "/opt/us2-build/build/bin/strata-poly",
"engine_sha256": "7ba58112d0b9b73d48e10e2f04186dd5412a888e1fc82de80ec399de6ee9fd92",
"fork_commit": "143ada26fe968d27686cab50ad76c9c171eb748d",
"nvidia_smi": "NVIDIA GeForce RTX 3090, 580.126.20, 24576 MiB",
"cpu_quota": "3112500/100000",
"started_utc": "2026-10-18T06:35:57Z"
}
@@ -0,0 +1,22 @@
[
"/opt/us2-build/build/bin/unbiased-strata",
"--engine",
"/opt/us2-build/build/bin/strata-poly",
"-m",
"/opt/us2-models/qwen36-mtp/Qwen3.6-35B-A3B-UD-Q3_K_M.gguf",
"--host",
"127.0.0.1",
"--port",
"18091",
"--alias",
"qwen3.6-35b-a3b-ud-q3_k_m",
"--",
"--model",
"/opt/us2-models/qwen36-mtp/Qwen3.6-35B-A3B-UD-Q3_K_M.gguf",
"--max-context",
"32768",
"--expert-profile",
"/opt/us2-results/step9/2026-10-17-rtx3090/fork-qwen36-q3km/expert-profile.txt",
"--tail-skip",
"6"
]
@@ -0,0 +1 @@
{"returncode": 1}
@@ -0,0 +1,15 @@
{
"exe": "/opt/us2-build/build/bin/unbiased-strata",
"engine": "/opt/us2-build/build/bin/strata-poly",
"model_name": "qwen3.6-35b-a3b-ud-q3_k_m",
"args": [
"--model",
"/opt/us2-models/qwen36-mtp/Qwen3.6-35B-A3B-UD-Q3_K_M.gguf",
"--max-context",
"32768",
"--expert-profile",
"/opt/us2-results/step9/2026-10-17-rtx3090/fork-qwen36-q3km/expert-profile.txt",
"--tail-skip",
"6"
]
}
@@ -0,0 +1,174 @@
{
"checks": {
"requests": 42,
"all_successful": true,
"skipped": {
"32K": "the context is 32768 tokens"
},
"failures": []
},
"sustained": {
"decode_tps": {
"median": 200.04086940658718,
"min": 188.40828185289035,
"max": 218.4481375906923,
"n": 9
},
"prompt_tps": {
"median": 3480.571323437466,
"min": 3237.6854367152764,
"max": 3579.3625075958635,
"n": 9
},
"ttft_s": {
"median": 1.28,
"min": 0.502,
"max": 1.499,
"n": 9
},
"total_s": {
"median": 3.929,
"min": 2.85,
"max": 4.148,
"n": 9
},
"draft_acceptance_pct": 79.95057151683658
},
"chat": {
"median": 213.496,
"min": 196.544,
"max": 259.215,
"n": 9
},
"chat_ttft_s": {
"median": 0.11,
"min": 0.107,
"max": 0.117,
"n": 9
},
"prefill": {
"4K": {
"median": 3821.634,
"min": 3792.145,
"max": 3831.57,
"n": 3
},
"16K": {
"median": 3486.29,
"min": 3482.95,
"max": 3497.354,
"n": 3
}
},
"prefill_ttft_s": {
"4K": {
"median": 1.064,
"min": 1.056,
"max": 1.073,
"n": 3
},
"16K": {
"median": 4.607,
"min": 4.572,
"max": 4.611,
"n": 3
}
},
"agent": {
"turn_decode_tps": {
"median": 186.86,
"min": 169.366,
"max": 202.841,
"n": 15
},
"turn_ttft_s": {
"median": 1.069,
"min": 0.518,
"max": 1.198,
"n": 15
}
},
"per_document": {
"docs/DETAILS.md": {
"prompt_tokens": null,
"decode_tps": {
"median": 198.46779753177523,
"min": 188.40828185289035,
"max": 200.04086940658718,
"n": 3
},
"prompt_tps": {
"median": 3573.327179584466,
"min": 3562.408125790833,
"max": 3579.3625075958635,
"n": 3
},
"ttft_s": {
"median": 1.437,
"min": 1.435,
"max": 1.499,
"n": 3
},
"total_s": {
"median": 4.076,
"min": 3.992,
"max": 4.148,
"n": 3
}
},
"docs/HOW_IT_WORKS.md": {
"prompt_tokens": null,
"decode_tps": {
"median": 217.67865944024638,
"min": 207.85572616085997,
"max": 218.4481375906923,
"n": 3
},
"prompt_tps": {
"median": 3435.6673317870136,
"min": 3237.6854367152764,
"max": 3462.376259857871,
"n": 3
},
"ttft_s": {
"median": 0.506,
"min": 0.502,
"max": 0.537,
"n": 3
},
"total_s": {
"median": 2.877,
"min": 2.85,
"max": 2.965,
"n": 3
}
},
"docs/INSTALL.md": {
"prompt_tokens": null,
"decode_tps": {
"median": 193.09702691039465,
"min": 192.30566590446887,
"max": 202.56179224771049,
"n": 3
},
"prompt_tps": {
"median": 3480.571323437466,
"min": 3474.900404742404,
"max": 3483.8761111332565,
"n": 3
},
"ttft_s": {
"median": 1.28,
"min": 1.278,
"max": 1.284,
"n": 3
},
"total_s": {
"median": 3.929,
"min": 3.807,
"max": 3.938,
"n": 3
}
}
}
}
@@ -0,0 +1,443 @@
[
{
"run": 0,
"source": "docs/HOW_IT_WORKS.md",
"messages": [
{
"role": "user",
"content": "Run identifier 0-0. Read the following project documentation and write a detailed technical explanation of its design, tradeoffs, and how someone would use it in practice.\n\n# How does PolyStrata work?\n\nModels like Qwen3.8-Flash-Next normally run on servers with hundreds of gigabytes of graphics memory. Your graphics\ncard has 12-24 GB. PolyStrata makes it fit by **sharing the work across your whole PC** - the same idea as a kitchen, where\nthe things you use all the time stay on the counter and the rest waits in the pantry. Back to the\n[README](../README.md#how-does-it-work).\n\n## Who does what\n\n<p align=\"center\"><img src=\"media/how-it-works.svg\" width=\"860\" alt=\"The model's 24,576 experts: the busiest on the graphics card, all of them in RAM, a lookup table on the SSD\"></p>\n\n- **The model is a team of 24,576 small specialists (\"experts\"),** and each word it writes needs only 10 of them.\n So it doesn't have to have all of them on the graphics card at once.\n- **Your graphics card** does the part of the work needed for every word, and keeps the few thousand experts that\n are asked most often. It keeps learning which ones those are while you use it.\n- **Your RAM** holds every expert. When a word needs one the card doesn't have, **your processor** works on it -\n at the same time as the graphics card, so neither waits for the other.\n- **Your SSD** holds a big lookup table; the model only reads a few small rows of it per word.\n\nThe same in technical terms:\n\n- **GPU (VRAM):** attention and DeltaNet mixers, the gated-residual weights, routers, shared experts, output head, the\n MTP draft layer, the KV cache (from 64K: only its most-read part, the rest streams from RAM), and an **expert\n cache** that fills the rest of VRAM with the most-used experts (it adapts to the conversation while you chat).\n More VRAM matters more than a faster GPU: every extra GB holds ~700 more experts, and every expert on the GPU is one\n the CPU does not have to compute.\n- **RAM:** all 24,576 experts, pinned. The CPU computes the experts that are not on the GPU **in place**, at the same\n time as the GPU works on the cached ones (AVX-512 / AVX2 kernels, ggml's for the i-quants). On a PC with little RAM\n and a big card, the [low-RAM mode](MODELS.md#a-big-graphics-card-and-little-ram) keeps in RAM only what the GPU does\n not hold.\n- **SSD:** the 28.8 GB n-gram table, read a few rows per token through the OS cache.\n\nThis works the same on NVIDIA (CUDA) and AMD (HIP) cards: the same engine, compiled for each.\n\n## Guess, then check\n\n<p align=\"center\"><img src=\"media/guess-and-check.svg\" width=\"860\" alt=\"A small helper guesses the next words; the big model checks them all at once and keeps the right ones\"></p>\n\n- **Guess, then check.** A small, fast helper built into the model guesses the next few words, and the big model\n checks all the guesses in one go. It keeps the ones it agrees with and writes the next word itself - so one step\n often produces several words. The helper only guesses - the big model decides every word - so you get the same\n quality answer, 1.6-1.8x sooner.\n- In technical terms: the model's own MTP layer drafts up to 3 tokens; one pass over all 48 layers checks them, 2.4-3.2\n tokens per pass on average. When the reply repeats the context (code edits, quoted text), **prompt lookup** drafts\n up to 5 tokens from the earlier copy, but only where its measured acceptance and cost say it pays: code edits 6-11%\n faster, other text unchanged. The drafts are checked like the MTP's, so the output is the same.\n\n## Reading long texts\n\n**Long texts are read in big pieces** (up to 8,192 tokens - pieces of words - at a time), which is why a long\ndocument or code base is read at over 1,000 tokens per second. The experts of the next layer stream to the GPU over\nPCIe while the current layer's attention runs. After the first message, PolyStrata keeps the conversation and reads only\nwhat is new, so follow-ups start in seconds.\n\n## More\n\nThe [details](DETAILS.md#how-it-works) explain every part and its numbers, and the\n[paper](paper/Strata-Paper.pdf) tells the whole story, with the measurements behind it.\n\n## Credits\n\n- PolyStrata is built on [Strata](https://github.com/Niko1221/Strata) by Niko1221 and its contributors. The Qwen\n engine, the installer, the server and the web app are that project's work. PolyStrata adds the engine for GLM 5.3\n Flash ([GLM.md](GLM.md)), whose file is from\n [neuralll](https://huggingface.co/neuralll/GLM-5.3-Flash-GSQ-RCO-3.0bit-Q4Kattn-GGUF).\n- Model: [Qwen3.8-Flash-Next](https://huggingface.co/Qwen/Qwen3.8-Flash-Next) by the Qwen team; compressed versions by\n [ISTA-DASLab](https://huggingface.co/ISTA-DASLab/Qwen3.8-Flash-Next-GSQ-RCO-GGUF);\n [Swift 1.5](https://huggingface.co/ukisai/Swift-1.5-Qwen3.8-Flash-Next-GSQ-RCO-GGUF) by UkisAI; the experimental\n [UD-Q4_K_XL](https://huggingface.co/unsloth/Line truncated
}
],
"response": {
"first": 0.5374565217643976,
"total": 2.876839254051447,
"text": "Based on the provided documentation, here is a detailed technical explanation of **PolyStrata**, covering its architectural design, the trade-offs involved, and practical usage.\n\n### 1. Architectural Design: The \"Kitchen and Pantry\" Analogy\n\nPolyStrata is a runtime engine designed to run large-scale Mixture-of-Experts (MoE) models (specifically **Qwen3.8-Flash-Next**) on consumer-grade hardware with limited VRAM (12\u201324 GB). The core innovation is **heterogeneous memory management**, treating the CPU, RAM, GPU, and SSD as a unified, tiered storage and compute system.\n\n#### Core Components & Data Flow\n\n1. **The Model Structure (24,576 Experts):**\n * The model consists of 24,576 small \"expert\" neural network layers.\n * For any given token generation, only **10 experts** are active.\n * This sparsity allows the system to avoid loading all experts into VRAM simultaneously.\n\n2. **Tiered Memory Hierarchy:**\n * **GPU (VRAM - The \"Counter\"):**\n * Holds the **Expert Cache**: The most frequently accessed experts are kept here for low-latency access.\n * Holds global state: Attention mechanisms, DeltaNet mixers, gated-residual weights, routers, shared experts, output head, and the MTP (Multi-Token Prediction) draft layer.\n * Holds the **KV Cache**: Specifically, the most-read portion of the 64K context window. The rest streams from RAM.\n * *Key Metric:* Every extra GB of VRAM holds ~700 more experts, directly reducing CPU load.\n * **RAM (The \"Pantry\"):**\n * Holds **all 24,576 experts** in pinned memory.\n * Acts as the source for experts not currently in VRAM.\n * Supports \"Low-RAM Mode\" for systems with large GPUs but small RAM, keeping only necessary data in RAM.\n * **SSD (The \"Lookup Table\"):**\n * Stores a 28.8 GB n-gram table.\n * Used for **Prompt Lookup**: When the model repeats context (e.g., code edits), it drafts tokens from this table. Only a few small rows are read",
"usage": null,
"timings": {
"cache_n": 0,
"prompt_n": 1696,
"prompt_ms": 523.831,
"prompt_per_token_ms": 0.3088626179245283,
"prompt_per_second": 3237.6854367152764,
"predicted_n": 512,
"predicted_ms": 2339.228,
"predicted_per_token_ms": 4.577745596868884,
"predicted_per_second": 218.4481375906923,
"draft_n": 342,
"draft_n_accepted": 304
},
"err": null,
"pieces": 512
},
"metrics": {
"ok": true,
"err": null,
"ttft_s": 0.537,
"total_s": 2.877,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 1696,
"generated_tokens": 512,
"prompt_tps": 3237.6854367152764,
"prompt_tps_source": "engine",
"decode_tps": 218.4481375906923,
"decode_tps_source": "engine",
"prompt_ms": 523.831,
"decode_ms": 2339.228,
"drafts_offered": 342,
"drafts_accepted": 304
}
},
{
"run": 0,
"source": "docs/INSTALL.md",
"messages": [
{
"role": "user",
"content": "Run identifier 0-1. Read the following project documentation and write a detailed technical explanation of its design, tradeoffs, and how someone would use it in practice.\n\n# Installing PolyStrata\n\nEverything about installing, starting, updating and configuring PolyStrata, on Windows and Linux, with an NVIDIA or an\nAMD graphics card. The short version is in the [README](../README.md#install); an AI coding assistant can do all of\nthis for you with [AI_SETUP.md](AI_SETUP.md).\n\n> **On this page:** [What you need](#what-you-need) \u00b7 [Windows](#windows) \u00b7 [Linux](#linux) \u00b7\n> [AMD cards](#amd-cards) \u00b7 [Several cards](#two-or-three-cards) \u00b7 [Docker](#docker-linux) \u00b7\n> [Older CPUs](#older-cpus-experimental) \u00b7 [Updating](#updating) \u00b7 [Where things are stored](#where-things-are-stored) \u00b7\n> [Setup's questions](#setups-questions) \u00b7 [Tuning](#tuning-for-your-pc) \u00b7 [All options](#options-without-questions)\n\n## What you need\n\nThis is for Qwen3.8-Flash-Next. GLM 5.3 Flash needs Linux, one NVIDIA card and far more RAM:\n[GLM.md](GLM.md#what-you-need). The three smaller models (Qwen3.6-35B-A3B, Ornith 1.5, Gemma 4 26B-A4B) need Linux\nor Windows, one NVIDIA card and less of everything: [BACKENDS.md](BACKENDS.md#install).\n\n| | |\n| --- | --- |\n| **GPU** | **NVIDIA** RTX 20, 30, 40 or 50 series, **12 GB VRAM or more** (8 GB runs, slowly). Measured on an RTX 5070 and an RTX 3090; RTX 20 (Turing, since 0.1.27) was tested by a contributor on an RTX 2070. **AMD** Radeon RX 7900 XT / XTX, RX 9070 / 9070 XT and Radeon AI PRO R9700 (validated), RX 7800 XT / 7700 XT and RX 9060 XT (validated by their owners), RX 6800 / 6900 series (community-reported), with 12 GB of VRAM or more. See [AMD cards](#amd-cards). |\n| **RAM** | Enough for the size you pick ([which model](MODELS.md#pick-by-ram)); **64 GB** runs every size. A big GPU makes up for less RAM - the [low-RAM mode](MODELS.md#a-big-graphics-card-and-little-ram). |\n| **CPU** | x86-64 with AVX2 (any Intel/AMD desktop CPU from the last ~8 years). AVX-512 (Ryzen 7000/9000) is a bit faster. Older CPUs without AVX2 are experimental and slow: [Older CPUs](#older-cpus-experimental). |\n| **Disk** | ~70-80 GB free for the model, ~6 GB for the MTP layer (+1 GB with images). **Q2_0 on an AVX-512 CPU** also writes a one-time ~40 GB copy of its experts for the fast CPU kernel. On Linux with an AMD card, ROCm takes ~10 GB more when setup installs it. An NVMe SSD is strongly recommended: it makes the first start much faster. |\n| **OS** | Windows 10/11, or Linux (Ubuntu 22.04/24.04 and Debian 12/13 get everything installed automatically). |\n| **Driver** | **NVIDIA:** a current driver, version 580 or newer ([nvidia.com/drivers](https://www.nvidia.com/drivers) or the NVIDIA App). **AMD:** on Linux the kernel's amdgpu driver (no ROCm install needed); on Windows a current AMD Software: Adrenalin Edition driver ([amd.com/support](https://www.amd.com/en/support)). |\n\nThe driver is the only thing you install yourself. Everything else - Python, the engine, the model - is set up for\nyou the first time: Python 3.12 if you have none (for your user account, no admin), a private Python environment in\n`.venv/`, the PolyStrata engine, the model and the MTP draft layer. On NVIDIA it uses the ready-made engine for RTX\n20/30/40/50 and NVIDIA's CUDA libraries from pip (~0.4 GB); if no ready-made engine fits your PC, it offers to install\nthe build tools (Visual Studio Build Tools + CUDA Toolkit on Windows, `build-essential` + CUDA on Ubuntu) and compiles\nthe engine for your GPU (asks first; 20-40 minutes once). More: [details](DETAILS.md#before-you-start).\n\n## Windows\n\n1. [Download this project](https://github.com/VecSzn/PolyStrata/archive/refs/heads/main.zip) and unzip it (or\n `git clone` it).\n2. Double-click **`START-HERE.bat`**.\n3. Answer a few questions - or just press Enter each time for the recommended choice ([the questions](#setups-questions)).\n\nThen it downloads everything (the model is ~70 GB, so the first time takes a while - you can stop and it picks up\nwhere it left off) and **starts the model**. Your browser opens the PolyStrata app at `http://127.0.0.1:8080`.\n\n> **While the model starts, your PC can be slow or stop responding for 1-3 minutes** (longest the first time): PolyStrata\n> loads 35-55 GB into your RAM and locks part of it for the graphics card. That's normal - wait, and don't close the\n> window. The window tells you what it is doing.\n\n**Next time**, just double-click `START-HERE.bat` again: it starts right away (30-90 s to load the model), nothing is\ndownloaded twice. Close its window to stop the model. `SETUP.bat` (the same as `START-HERE.bat --setup`) installs\nanother model or changes the settings. Starting PolyStrata from Task Scheduler at logon needs two task settings, or the\nstart is 24x slower: [Running it at startup](DETAILS.md#running-it-at-startup-task-scheduler).\n\Line truncated
}
],
"response": {
"first": 1.2803532797843218,
"total": 3.9378805570304394,
"text": "# Technical Analysis: PolyStrata Project Design and Implementation\n\n## 1. Executive Summary\n\n**PolyStrata** is a specialized inference engine and deployment framework designed to run large language models (LLMs), specifically targeting the **Qwen3.8-Flash-Next** architecture. It is engineered for high-performance local deployment on consumer-grade hardware, leveraging a hybrid CPU/GPU architecture with a focus on **Mixture of Experts (MoE)** models.\n\nThe system is notable for its \"zero-config\" installation philosophy, automatic hardware detection, and support for heterogeneous GPU ecosystems (NVIDIA CUDA and AMD ROCm/HIP). It utilizes a \"draft layer\" (MTP - Multi-Token Prediction) to accelerate inference and employs sophisticated memory management techniques to handle models that exceed available VRAM by offloading to system RAM or CPU.\n\n---\n\n## 2. System Architecture and Design\n\n### 2.1 Core Inference Engine\nPolyStrata is not a generic LLM runner but a custom-built engine optimized for specific quantization formats and MoE architectures.\n* **Custom C++ Backend:** The core engine is compiled from source (or provided as pre-compiled binaries) to leverage specific CPU instruction sets (AVX2, AVX-512) and GPU compute APIs (CUDA, HIP).\n* **MoE Optimization:** The system is designed around Mixture of Experts models. It manages \"experts\" (sub-networks within the model) by caching them in VRAM when possible and swapping them to RAM/CPU when VRAM is insufficient. This allows smaller consumer GPUs (12GB+) to run models that would traditionally require enterprise-grade hardware.\n* **MTP (Multi-Token Prediction) Layer:** The documentation mentions an \"MTP draft layer.\" This suggests the use of speculative decoding or similar techniques where a smaller \"draft\" model predicts tokens, which are then verified by the main model, significantly increasing throughput (tokens per second).\n\n### 2.2 Hardware Abstraction Layer\nPolyStrata abstracts the underlying hardware complexity through a unified setup process:\n* **NVIDIA Support:** Uses CUDA libraries. Supports RTX 20/30/40/50 series. Automatically detects GPU architecture (Compute Capability) and selects the appropriate pre-built binary or compiles a custom one if necessary.\n* **AMD Support:** Uses HIP/ROCm. Supports RDNA 3/4 architectures (RX 7000/9",
"usage": null,
"timings": {
"cache_n": 0,
"prompt_n": 4370,
"prompt_ms": 1257.59,
"prompt_per_token_ms": 0.28777803203661323,
"prompt_per_second": 3474.900404742404,
"predicted_n": 512,
"predicted_ms": 2657.228,
"predicted_per_token_ms": 5.200054794520548,
"predicted_per_second": 192.30566590446887,
"draft_n": 375,
"draft_n_accepted": 278
},
"err": null,
"pieces": 512
},
"metrics": {
"ok": true,
"err": null,
"ttft_s": 1.28,
"total_s": 3.938,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 4370,
"generated_tokens": 512,
"prompt_tps": 3474.900404742404,
"prompt_tps_source": "engine",
"decode_tps": 192.30566590446887,
"decode_tps_source": "engine",
"prompt_ms": 1257.59,
"decode_ms": 2657.228,
"drafts_offered": 375,
"drafts_accepted": 278
}
},
{
"run": 0,
"source": "docs/DETAILS.md",
"messages": [
{
"role": "user",
"content": "Run identifier 0-2. Read the following project documentation and write a detailed technical explanation of its design, tradeoffs, and how someone would use it in practice.\n\n# PolyStrata - the details\n\nThe technical side of PolyStrata: every measured number, the API, images, all settings and how the engine works.\nNew here? Start with the [README](../README.md); installing step by step is in [INSTALL.md](INSTALL.md), the models in\n[MODELS.md](MODELS.md), common problems in [TROUBLESHOOTING.md](TROUBLESHOOTING.md).\n\n> **On this page:** [Speed](#speed-measured) \u00b7 [Other GPUs](#other-gpus-estimated) \u00b7 [Which model?](#which-model) \u00b7\n> [Requirements](#before-you-start) \u00b7 [Windows](#windows) \u00b7 [Linux](#linux) \u00b7 [API](#using-it) \u00b7\n> [MCP tools](#tools-from-mcp-servers) \u00b7 [MCP server](#manage-strata-from-your-ai-assistant-mcp-server) \u00b7\n> [Images](#images-vision) \u00b7\n> [Troubleshooting](#troubleshooting) \u00b7 [How it works](#how-it-works)\n\n---\n\n## Speed (measured)\n\nRTX 5070 **12 GB**, Ryzen 5 7600 (6 cores), 64 GB DDR5-5200, Windows, engine 0.1.26 with the settings setup writes\n(`--prefill auto`, 8-bit KV above 4K, KV streaming from 64K). One code-agent prompt per length, 256 generated tokens,\nMTP speculative decoding on. \"262K\" is the model's full context window (a 259,943-token prompt). The IQ2_XS row was\nmeasured with Swift 1.5's IQ2_XS, which runs at the original's speed.\n\n**Engine 0.1.36 (#136), the same PC:** Q2_0's prompt experts run on fused int8 tensor-core kernels (RTX 30 and newer):\n4K 1,294 -> 1,570, 32K 2,170 -> 2,653, 128K 2,123 -> 2,468 tokens/s (+16-22%), as close to an FP16 reference as the\nprevious kernels (closer at 32K: teacher-forced KL 0.009 vs 0.012). The decode path's block selection and greedy\nargmax run on thread-block clusters (RTX 50, sm_90+; other cards keep the previous kernels; the same tokens): Q2_0 output at 4K 89 -> 93.5, at 128K\n64.5 -> 76.4 tokens/s. `STRATA_PF_FUSED=0` keeps the previous prompt kernels (byte-identical answers to 0.1.35);\n`STRATA_PF_FUSED=1` also runs the native IQ packs' fused kernels (opt-in: IQ2_XS prompts +12% at 4K, +3% at 32K, the\nIQ3 packs about even; on HIP they run on gfx11 and on gfx1200 / gfx1201, see AMD_HIP.md); `STRATA_QSA_CLUSTER=0` / `STRATA_ARGMAX_MULTI=0` turn the decode kernels off. The tables\nbelow are 0.1.26's.\n\n### Prompt processing (tokens/s)\n\n| Model | 1K | 4K | 32K | 64K | 128K | 262K |\n| --- | ---: | ---: | ---: | ---: | ---: | ---: |\n| **Q2_0** | 536 | 1,299 | 2,171 | 2,126 | 2,107 | 1,304\u2020 |\n| **IQ2_XS** | 534 | 1,256 | 2,092 | 1,754 | 1,752 | 1,181*\u2020 |\n| **IQ3_XXS** | 482 | 1,007 | 1,745 | 1,609 | 1,602 | - |\n| **IQ3_S** | 427 | 913 | 1,624 | 1,640 | 1,443 | - |\n| **Coder** | 656 | 1,583 | 2,177 | 2,236 | 2,208 | 1,034** |\n| **IQ3_S** (AMD RX 7900 XTX, gfx1100) | 760 | 1,275 | 1,641 | 1,594 | 1,494 | - |\n\nEngine 0.1.26; `bench/results/2026-09-29-speed-0126`. The AMD RX 7900 XTX row: engine 0.1.38 on a ROCm\n10.2 nightly with a tuned gfx1100 hipBLASLt-100500 table (upstream as [#755](https://github.com/Niko1221/Strata/pull/755)),\nthe median of 3 clean cells per tier\n(Ryzen 9 7900X, 96 GB; 1K-128K one-shot runs, 256 generated tokens,\ngreedy). At 32K-128K that is 8-28% faster than 0.1.22. \u2020 not measured\nagain: 0.1.22. \\* measured with images on (the image encoder's VRAM reserve leaves fewer experts cached). \\*\\* not\nmeasured again: 0.1.14.\n\n### Output (tokens/s)\n\n| Model | 1K | 4K | 32K | 64K | 128K | 262K |\n| --- | ---: | ---: | ---: | ---: | ---: | ---: |\n| **Q2_0** | 87.3 | 93.0 | 81.8 | 76.2 | 73.7 | 60.3\u2020 |\n| **IQ2_XS** | 79.6 | 78.6 | 76.3 | 63.7 | 62.7 | 52.8\u2020 |\n| **IQ3_XXS** | 61.9 | 61.6 | 58.5 | 57.2 | 49.0 | - |\n| **IQ3_S** | 52.4 | 53.3 | 48.3 | 46.3 | 45.5 | - |\n| **Coder** | 58.9 | 55.1 | 54.9 | 53.2 | 43.0 | 42.8\u2020 |\n| **IQ3_S** (AMD RX 7900 XTX, gfx1100) | 65.1 | 60.4 | 64.4 | 61.8 | 59.2 | - |\n\nEngine 0.1.26, the same runs. The AMD RX 7900 XTX row: engine 0.1.38 on a ROCm 10.2 nightly (tuned\ngfx1100 hipBLASLt-100500 table, upstream as [#755](https://github.com/Niko1221/Strata/pull/755)), median of 3 clean cells per tier (same box; decode is flat in\ncontext - the GDN linear attention is O(1) per token; 1K/4K prefill ran slightly under the 0.1.31\npackaged-ROCm numbers, 32K-128K ahead). \u2020 not measured again: 0.1.14.\n\nOutput speed depends on the text as well: speculative decoding runs faster when more of the drafted tokens are\naccepted, so a different answer to the same prompt moves it by several percent. Run back to back on the 4K prompt,\n0.1.14 writes 88.5 tokens/s and 0.1.12 85.7. The numbers before 0.1.13 (prompts about half as fast):\n[`bench/results/2026-09-24-final`](../bench/results/2026-09-24-final/matrix.md); these:\n[`bench/results/2026-09-28-speed-0114`](../bench/results/2026-09-28-speed-0114/README.md).\n\nIQ3_XXS and IQ3_S at 262K are not measLine truncated
}
],
"response": {
"first": 1.437380513176322,
"total": 3.9924013931304216,
"text": "# Technical Analysis: PolyStrata Engine Design and Implementation\n\n## 1. Executive Summary\n\nPolyStrata is a high-performance inference engine designed for running large language models (LLMs) with **Mixture of Experts (MoE)** architectures on consumer-grade hardware. Its core innovation lies in optimizing the memory bandwidth bottleneck inherent in MoE models by utilizing **4-bit quantization**, **dynamic expert caching**, and **speculative decoding**.\n\nThe engine is built to run efficiently on NVIDIA GPUs (RTX 30/40/50 series) and AMD GPUs (via ROCm/HIP), leveraging custom fused kernels for both prompt processing (prefill) and token generation (decode). It prioritizes high throughput for long-context windows (up to 262K tokens) while maintaining acceptable latency through aggressive quantization and memory streaming techniques.\n\n---\n\n## 2. Core Architectural Design\n\n### 2.1 Mixture of Experts (MoE) Management\nUnlike dense models where all parameters are active for every token, PolyStrata handles MoE models where only a subset of \"experts\" are activated per token.\n* **Expert Caching:** The engine maintains a cache of active experts in VRAM. Experts not currently needed are swapped between VRAM and system RAM (or disk via `mmap`).\n* **Dynamic Swapping:** The engine dynamically moves experts between RAM and VRAM based on usage patterns (`adapt-swaps`). This allows models with massive expert footprints (23\u201350 GB) to run on GPUs with limited VRAM (e.g., 8\u201312 GB).\n* **Low-RAM Mode:** If system RAM is insufficient to pin all experts, the engine maps the expert file directly from disk (`--mmap-experts`), relying on the OS file cache. This trades some speed for feasibility on low-RAM systems.\n\n### 2.2 Quantization Strategy\nPolyStrata employs aggressive quantization to fit large models into consumer hardware:\n* **Model Weights:** Supports various quantization levels, including `Q2_0`, `IQ2_XS`, `IQ3_XXS`, and `IQ3_S`. The `IQ` (Intelligence) formats are optimized for specific hardware accelerators (e.g., tensor cores).\n* **KV Cache Quantization:**\n * **8-bit (Default):** Balanced precision and speed.\n * **4-bit (`q4",
"usage": null,
"timings": {
"cache_n": 0,
"prompt_n": 5048,
"prompt_ms": 1412.689,
"prompt_per_token_ms": 0.2798512282091918,
"prompt_per_second": 3573.327179584466,
"predicted_n": 512,
"predicted_ms": 2554.478,
"predicted_per_token_ms": 4.9989784735812135,
"predicted_per_second": 200.04086940658718,
"draft_n": 357,
"draft_n_accepted": 289
},
"err": null,
"pieces": 512
},
"metrics": {
"ok": true,
"err": null,
"ttft_s": 1.437,
"total_s": 3.992,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 5048,
"generated_tokens": 512,
"prompt_tps": 3573.327179584466,
"prompt_tps_source": "engine",
"decode_tps": 200.04086940658718,
"decode_tps_source": "engine",
"prompt_ms": 1412.689,
"decode_ms": 2554.478,
"drafts_offered": 357,
"drafts_accepted": 289
}
},
{
"run": 1,
"source": "docs/HOW_IT_WORKS.md",
"messages": [
{
"role": "user",
"content": "Run identifier 1-0. Read the following project documentation and write a detailed technical explanation of its design, tradeoffs, and how someone would use it in practice.\n\n# How does PolyStrata work?\n\nModels like Qwen3.8-Flash-Next normally run on servers with hundreds of gigabytes of graphics memory. Your graphics\ncard has 12-24 GB. PolyStrata makes it fit by **sharing the work across your whole PC** - the same idea as a kitchen, where\nthe things you use all the time stay on the counter and the rest waits in the pantry. Back to the\n[README](../README.md#how-does-it-work).\n\n## Who does what\n\n<p align=\"center\"><img src=\"media/how-it-works.svg\" width=\"860\" alt=\"The model's 24,576 experts: the busiest on the graphics card, all of them in RAM, a lookup table on the SSD\"></p>\n\n- **The model is a team of 24,576 small specialists (\"experts\"),** and each word it writes needs only 10 of them.\n So it doesn't have to have all of them on the graphics card at once.\n- **Your graphics card** does the part of the work needed for every word, and keeps the few thousand experts that\n are asked most often. It keeps learning which ones those are while you use it.\n- **Your RAM** holds every expert. When a word needs one the card doesn't have, **your processor** works on it -\n at the same time as the graphics card, so neither waits for the other.\n- **Your SSD** holds a big lookup table; the model only reads a few small rows of it per word.\n\nThe same in technical terms:\n\n- **GPU (VRAM):** attention and DeltaNet mixers, the gated-residual weights, routers, shared experts, output head, the\n MTP draft layer, the KV cache (from 64K: only its most-read part, the rest streams from RAM), and an **expert\n cache** that fills the rest of VRAM with the most-used experts (it adapts to the conversation while you chat).\n More VRAM matters more than a faster GPU: every extra GB holds ~700 more experts, and every expert on the GPU is one\n the CPU does not have to compute.\n- **RAM:** all 24,576 experts, pinned. The CPU computes the experts that are not on the GPU **in place**, at the same\n time as the GPU works on the cached ones (AVX-512 / AVX2 kernels, ggml's for the i-quants). On a PC with little RAM\n and a big card, the [low-RAM mode](MODELS.md#a-big-graphics-card-and-little-ram) keeps in RAM only what the GPU does\n not hold.\n- **SSD:** the 28.8 GB n-gram table, read a few rows per token through the OS cache.\n\nThis works the same on NVIDIA (CUDA) and AMD (HIP) cards: the same engine, compiled for each.\n\n## Guess, then check\n\n<p align=\"center\"><img src=\"media/guess-and-check.svg\" width=\"860\" alt=\"A small helper guesses the next words; the big model checks them all at once and keeps the right ones\"></p>\n\n- **Guess, then check.** A small, fast helper built into the model guesses the next few words, and the big model\n checks all the guesses in one go. It keeps the ones it agrees with and writes the next word itself - so one step\n often produces several words. The helper only guesses - the big model decides every word - so you get the same\n quality answer, 1.6-1.8x sooner.\n- In technical terms: the model's own MTP layer drafts up to 3 tokens; one pass over all 48 layers checks them, 2.4-3.2\n tokens per pass on average. When the reply repeats the context (code edits, quoted text), **prompt lookup** drafts\n up to 5 tokens from the earlier copy, but only where its measured acceptance and cost say it pays: code edits 6-11%\n faster, other text unchanged. The drafts are checked like the MTP's, so the output is the same.\n\n## Reading long texts\n\n**Long texts are read in big pieces** (up to 8,192 tokens - pieces of words - at a time), which is why a long\ndocument or code base is read at over 1,000 tokens per second. The experts of the next layer stream to the GPU over\nPCIe while the current layer's attention runs. After the first message, PolyStrata keeps the conversation and reads only\nwhat is new, so follow-ups start in seconds.\n\n## More\n\nThe [details](DETAILS.md#how-it-works) explain every part and its numbers, and the\n[paper](paper/Strata-Paper.pdf) tells the whole story, with the measurements behind it.\n\n## Credits\n\n- PolyStrata is built on [Strata](https://github.com/Niko1221/Strata) by Niko1221 and its contributors. The Qwen\n engine, the installer, the server and the web app are that project's work. PolyStrata adds the engine for GLM 5.3\n Flash ([GLM.md](GLM.md)), whose file is from\n [neuralll](https://huggingface.co/neuralll/GLM-5.3-Flash-GSQ-RCO-3.0bit-Q4Kattn-GGUF).\n- Model: [Qwen3.8-Flash-Next](https://huggingface.co/Qwen/Qwen3.8-Flash-Next) by the Qwen team; compressed versions by\n [ISTA-DASLab](https://huggingface.co/ISTA-DASLab/Qwen3.8-Flash-Next-GSQ-RCO-GGUF);\n [Swift 1.5](https://huggingface.co/ukisai/Swift-1.5-Qwen3.8-Flash-Next-GSQ-RCO-GGUF) by UkisAI; the experimental\n [UD-Q4_K_XL](https://huggingface.co/unsloth/Line truncated
}
],
"response": {
"first": 0.5020743291825056,
"total": 2.8499414436519146,
"text": "# Technical Analysis of PolyStrata Architecture\n\nPolyStrata is a specialized inference engine designed to run large-scale Mixture-of-Experts (MoE) models, specifically **Qwen3.8-Flash-Next**, on consumer-grade hardware with limited VRAM (12\u201324 GB). It achieves this by offloading the computational burden from the GPU to the CPU and RAM, utilizing a hierarchical storage strategy and parallel processing techniques.\n\nBelow is a detailed breakdown of its design, tradeoffs, and practical usage.\n\n---\n\n## 1. Core Design Philosophy: Hierarchical Resource Sharing\n\nThe fundamental innovation of PolyStrata is the concept of **\"sharing the work across your whole PC.\"** Instead of attempting to fit the entire model into VRAM (which is impossible for a model with 24,576 experts on a 12\u201324 GB card), PolyStrata treats the CPU, RAM, and SSD as active computational and storage resources alongside the GPU.\n\n### The \"Kitchen and Pantry\" Analogy\n- **GPU (VRAM):** The \"counter.\" It holds the most frequently used experts (weights) for immediate access.\n- **RAM:** The \"pantry.\" It holds all 24,576 experts. When the GPU needs an expert not on the \"counter,\" it fetches it from RAM.\n- **SSD:** The \"storage room.\" It holds a large n-gram lookup table (28.8 GB) used for optimization, accessed via OS caching.\n\n### Component Roles\n\n| Component | Role | Technical Implementation |\n| :--- | :--- | :--- |\n| **GPU (VRAM)** | **Primary Compute & Cache** | Holds attention mechanisms, DeltaNet mixers, routers, shared experts, output head, MTP draft layer, and KV cache (partial). Crucially, it holds an **Expert Cache** that dynamically adapts to the conversation, keeping the most-used experts in VRAM. |\n| **CPU** | **Secondary Compute** | Computes experts that are **not** present in the GPU's VRAM. It does this **in-place** and **in parallel** with the GPU, ensuring neither component waits for the other. Uses AVX-512/AVX2 kernels and ggml for i-quants. |\n| **RAM** | **Global Expert Storage** | Holds all 24,576 experts. Memory is **pinned**",
"usage": null,
"timings": {
"cache_n": 0,
"prompt_n": 1696,
"prompt_ms": 489.837,
"prompt_per_token_ms": 0.2888189858490566,
"prompt_per_second": 3462.376259857871,
"predicted_n": 512,
"predicted_ms": 2347.497,
"predicted_per_token_ms": 4.59392759295499,
"predicted_per_second": 217.67865944024638,
"draft_n": 366,
"draft_n_accepted": 308
},
"err": null,
"pieces": 512
},
"metrics": {
"ok": true,
"err": null,
"ttft_s": 0.502,
"total_s": 2.85,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 1696,
"generated_tokens": 512,
"prompt_tps": 3462.376259857871,
"prompt_tps_source": "engine",
"decode_tps": 217.67865944024638,
"decode_tps_source": "engine",
"prompt_ms": 489.837,
"decode_ms": 2347.497,
"drafts_offered": 366,
"drafts_accepted": 308
}
},
{
"run": 1,
"source": "docs/INSTALL.md",
"messages": [
{
"role": "user",
"content": "Run identifier 1-1. Read the following project documentation and write a detailed technical explanation of its design, tradeoffs, and how someone would use it in practice.\n\n# Installing PolyStrata\n\nEverything about installing, starting, updating and configuring PolyStrata, on Windows and Linux, with an NVIDIA or an\nAMD graphics card. The short version is in the [README](../README.md#install); an AI coding assistant can do all of\nthis for you with [AI_SETUP.md](AI_SETUP.md).\n\n> **On this page:** [What you need](#what-you-need) \u00b7 [Windows](#windows) \u00b7 [Linux](#linux) \u00b7\n> [AMD cards](#amd-cards) \u00b7 [Several cards](#two-or-three-cards) \u00b7 [Docker](#docker-linux) \u00b7\n> [Older CPUs](#older-cpus-experimental) \u00b7 [Updating](#updating) \u00b7 [Where things are stored](#where-things-are-stored) \u00b7\n> [Setup's questions](#setups-questions) \u00b7 [Tuning](#tuning-for-your-pc) \u00b7 [All options](#options-without-questions)\n\n## What you need\n\nThis is for Qwen3.8-Flash-Next. GLM 5.3 Flash needs Linux, one NVIDIA card and far more RAM:\n[GLM.md](GLM.md#what-you-need). The three smaller models (Qwen3.6-35B-A3B, Ornith 1.5, Gemma 4 26B-A4B) need Linux\nor Windows, one NVIDIA card and less of everything: [BACKENDS.md](BACKENDS.md#install).\n\n| | |\n| --- | --- |\n| **GPU** | **NVIDIA** RTX 20, 30, 40 or 50 series, **12 GB VRAM or more** (8 GB runs, slowly). Measured on an RTX 5070 and an RTX 3090; RTX 20 (Turing, since 0.1.27) was tested by a contributor on an RTX 2070. **AMD** Radeon RX 7900 XT / XTX, RX 9070 / 9070 XT and Radeon AI PRO R9700 (validated), RX 7800 XT / 7700 XT and RX 9060 XT (validated by their owners), RX 6800 / 6900 series (community-reported), with 12 GB of VRAM or more. See [AMD cards](#amd-cards). |\n| **RAM** | Enough for the size you pick ([which model](MODELS.md#pick-by-ram)); **64 GB** runs every size. A big GPU makes up for less RAM - the [low-RAM mode](MODELS.md#a-big-graphics-card-and-little-ram). |\n| **CPU** | x86-64 with AVX2 (any Intel/AMD desktop CPU from the last ~8 years). AVX-512 (Ryzen 7000/9000) is a bit faster. Older CPUs without AVX2 are experimental and slow: [Older CPUs](#older-cpus-experimental). |\n| **Disk** | ~70-80 GB free for the model, ~6 GB for the MTP layer (+1 GB with images). **Q2_0 on an AVX-512 CPU** also writes a one-time ~40 GB copy of its experts for the fast CPU kernel. On Linux with an AMD card, ROCm takes ~10 GB more when setup installs it. An NVMe SSD is strongly recommended: it makes the first start much faster. |\n| **OS** | Windows 10/11, or Linux (Ubuntu 22.04/24.04 and Debian 12/13 get everything installed automatically). |\n| **Driver** | **NVIDIA:** a current driver, version 580 or newer ([nvidia.com/drivers](https://www.nvidia.com/drivers) or the NVIDIA App). **AMD:** on Linux the kernel's amdgpu driver (no ROCm install needed); on Windows a current AMD Software: Adrenalin Edition driver ([amd.com/support](https://www.amd.com/en/support)). |\n\nThe driver is the only thing you install yourself. Everything else - Python, the engine, the model - is set up for\nyou the first time: Python 3.12 if you have none (for your user account, no admin), a private Python environment in\n`.venv/`, the PolyStrata engine, the model and the MTP draft layer. On NVIDIA it uses the ready-made engine for RTX\n20/30/40/50 and NVIDIA's CUDA libraries from pip (~0.4 GB); if no ready-made engine fits your PC, it offers to install\nthe build tools (Visual Studio Build Tools + CUDA Toolkit on Windows, `build-essential` + CUDA on Ubuntu) and compiles\nthe engine for your GPU (asks first; 20-40 minutes once). More: [details](DETAILS.md#before-you-start).\n\n## Windows\n\n1. [Download this project](https://github.com/VecSzn/PolyStrata/archive/refs/heads/main.zip) and unzip it (or\n `git clone` it).\n2. Double-click **`START-HERE.bat`**.\n3. Answer a few questions - or just press Enter each time for the recommended choice ([the questions](#setups-questions)).\n\nThen it downloads everything (the model is ~70 GB, so the first time takes a while - you can stop and it picks up\nwhere it left off) and **starts the model**. Your browser opens the PolyStrata app at `http://127.0.0.1:8080`.\n\n> **While the model starts, your PC can be slow or stop responding for 1-3 minutes** (longest the first time): PolyStrata\n> loads 35-55 GB into your RAM and locks part of it for the graphics card. That's normal - wait, and don't close the\n> window. The window tells you what it is doing.\n\n**Next time**, just double-click `START-HERE.bat` again: it starts right away (30-90 s to load the model), nothing is\ndownloaded twice. Close its window to stop the model. `SETUP.bat` (the same as `START-HERE.bat --setup`) installs\nanother model or changes the settings. Starting PolyStrata from Task Scheduler at logon needs two task settings, or the\nstart is 24x slower: [Running it at startup](DETAILS.md#running-it-at-startup-task-scheduler).\n\Line truncated
}
],
"response": {
"first": 1.2838125973939896,
"total": 3.807084871456027,
"text": "# Technical Analysis: PolyStrata Project (Run Identifier 1-1)\n\n## 1. Executive Summary\nPolyStrata is a high-performance, cross-platform inference engine designed to run large language models (LLMs), specifically targeting the **Qwen3.8-Flash-Next** architecture. It is built on top of the `llama.cpp` ecosystem (indicated by references to `ggml-cpu`, GGUF formats, and quantization schemes like Q2_0, IQ2_XS) but adds a proprietary \"MTP\" (Multi-Token Prediction) draft layer and a custom C++ engine optimized for specific CPU instruction sets (AVX2/AVX-512).\n\nThe system is designed for local deployment on consumer hardware (RTX 20/30/40/50 series and AMD RX 7000/9000 series), emphasizing ease of installation via automated scripts while offering granular control over GPU memory, CPU offloading, and multi-GPU configurations.\n\n## 2. System Architecture & Design\n\n### 2.1 Core Components\n1. **The Engine**: A compiled C++ binary that handles the core inference loop. It is pre-compiled for modern CPUs (AVX2+) but can be compiled from source for older hardware or specific AMD configurations.\n2. **The Model Pack**: GGUF-formatted model weights (e.g., Qwen3.8-Flash-Next) in various quantizations (Q2_0, IQ2_XS, IQ3_XXS). These are stored on disk (~70-80 GB).\n3. **MTP Draft Layer**: A specialized component that enables Multi-Token Prediction. This likely involves a smaller \"draft\" model or a speculative decoding mechanism that predicts subsequent tokens to accelerate generation speed.\n4. **Vision Encoder**: A separate module for handling image inputs. By default, it runs on the GPU, but can be offloaded to the CPU (`--vision cpu`) for AMD cards or low-RAM scenarios.\n5. **Configuration Manager**: JSON-based configuration files (`strata-<model>.json`) that store settings for context length, KV cache precision, vision support, and API keys.\n\n### 2.2 Hardware Abstraction Layer\nPolyStrata abstracts the underlying hardware differences through a unified setup process:\n* **NVIDIA**: Uses CUDA. The engine links against NVIDIA's CUDA libraries",
"usage": null,
"timings": {
"cache_n": 0,
"prompt_n": 4370,
"prompt_ms": 1255.541,
"prompt_per_token_ms": 0.28730915331807777,
"prompt_per_second": 3480.571323437466,
"predicted_n": 512,
"predicted_ms": 2522.687,
"predicted_per_token_ms": 4.936765166340509,
"predicted_per_second": 202.56179224771049,
"draft_n": 363,
"draft_n_accepted": 292
},
"err": null,
"pieces": 512
},
"metrics": {
"ok": true,
"err": null,
"ttft_s": 1.284,
"total_s": 3.807,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 4370,
"generated_tokens": 512,
"prompt_tps": 3480.571323437466,
"prompt_tps_source": "engine",
"decode_tps": 202.56179224771049,
"decode_tps_source": "engine",
"prompt_ms": 1255.541,
"decode_ms": 2522.687,
"drafts_offered": 363,
"drafts_accepted": 292
}
},
{
"run": 1,
"source": "docs/DETAILS.md",
"messages": [
{
"role": "user",
"content": "Run identifier 1-2. Read the following project documentation and write a detailed technical explanation of its design, tradeoffs, and how someone would use it in practice.\n\n# PolyStrata - the details\n\nThe technical side of PolyStrata: every measured number, the API, images, all settings and how the engine works.\nNew here? Start with the [README](../README.md); installing step by step is in [INSTALL.md](INSTALL.md), the models in\n[MODELS.md](MODELS.md), common problems in [TROUBLESHOOTING.md](TROUBLESHOOTING.md).\n\n> **On this page:** [Speed](#speed-measured) \u00b7 [Other GPUs](#other-gpus-estimated) \u00b7 [Which model?](#which-model) \u00b7\n> [Requirements](#before-you-start) \u00b7 [Windows](#windows) \u00b7 [Linux](#linux) \u00b7 [API](#using-it) \u00b7\n> [MCP tools](#tools-from-mcp-servers) \u00b7 [MCP server](#manage-strata-from-your-ai-assistant-mcp-server) \u00b7\n> [Images](#images-vision) \u00b7\n> [Troubleshooting](#troubleshooting) \u00b7 [How it works](#how-it-works)\n\n---\n\n## Speed (measured)\n\nRTX 5070 **12 GB**, Ryzen 5 7600 (6 cores), 64 GB DDR5-5200, Windows, engine 0.1.26 with the settings setup writes\n(`--prefill auto`, 8-bit KV above 4K, KV streaming from 64K). One code-agent prompt per length, 256 generated tokens,\nMTP speculative decoding on. \"262K\" is the model's full context window (a 259,943-token prompt). The IQ2_XS row was\nmeasured with Swift 1.5's IQ2_XS, which runs at the original's speed.\n\n**Engine 0.1.36 (#136), the same PC:** Q2_0's prompt experts run on fused int8 tensor-core kernels (RTX 30 and newer):\n4K 1,294 -> 1,570, 32K 2,170 -> 2,653, 128K 2,123 -> 2,468 tokens/s (+16-22%), as close to an FP16 reference as the\nprevious kernels (closer at 32K: teacher-forced KL 0.009 vs 0.012). The decode path's block selection and greedy\nargmax run on thread-block clusters (RTX 50, sm_90+; other cards keep the previous kernels; the same tokens): Q2_0 output at 4K 89 -> 93.5, at 128K\n64.5 -> 76.4 tokens/s. `STRATA_PF_FUSED=0` keeps the previous prompt kernels (byte-identical answers to 0.1.35);\n`STRATA_PF_FUSED=1` also runs the native IQ packs' fused kernels (opt-in: IQ2_XS prompts +12% at 4K, +3% at 32K, the\nIQ3 packs about even; on HIP they run on gfx11 and on gfx1200 / gfx1201, see AMD_HIP.md); `STRATA_QSA_CLUSTER=0` / `STRATA_ARGMAX_MULTI=0` turn the decode kernels off. The tables\nbelow are 0.1.26's.\n\n### Prompt processing (tokens/s)\n\n| Model | 1K | 4K | 32K | 64K | 128K | 262K |\n| --- | ---: | ---: | ---: | ---: | ---: | ---: |\n| **Q2_0** | 536 | 1,299 | 2,171 | 2,126 | 2,107 | 1,304\u2020 |\n| **IQ2_XS** | 534 | 1,256 | 2,092 | 1,754 | 1,752 | 1,181*\u2020 |\n| **IQ3_XXS** | 482 | 1,007 | 1,745 | 1,609 | 1,602 | - |\n| **IQ3_S** | 427 | 913 | 1,624 | 1,640 | 1,443 | - |\n| **Coder** | 656 | 1,583 | 2,177 | 2,236 | 2,208 | 1,034** |\n| **IQ3_S** (AMD RX 7900 XTX, gfx1100) | 760 | 1,275 | 1,641 | 1,594 | 1,494 | - |\n\nEngine 0.1.26; `bench/results/2026-09-29-speed-0126`. The AMD RX 7900 XTX row: engine 0.1.38 on a ROCm\n10.2 nightly with a tuned gfx1100 hipBLASLt-100500 table (upstream as [#755](https://github.com/Niko1221/Strata/pull/755)),\nthe median of 3 clean cells per tier\n(Ryzen 9 7900X, 96 GB; 1K-128K one-shot runs, 256 generated tokens,\ngreedy). At 32K-128K that is 8-28% faster than 0.1.22. \u2020 not measured\nagain: 0.1.22. \\* measured with images on (the image encoder's VRAM reserve leaves fewer experts cached). \\*\\* not\nmeasured again: 0.1.14.\n\n### Output (tokens/s)\n\n| Model | 1K | 4K | 32K | 64K | 128K | 262K |\n| --- | ---: | ---: | ---: | ---: | ---: | ---: |\n| **Q2_0** | 87.3 | 93.0 | 81.8 | 76.2 | 73.7 | 60.3\u2020 |\n| **IQ2_XS** | 79.6 | 78.6 | 76.3 | 63.7 | 62.7 | 52.8\u2020 |\n| **IQ3_XXS** | 61.9 | 61.6 | 58.5 | 57.2 | 49.0 | - |\n| **IQ3_S** | 52.4 | 53.3 | 48.3 | 46.3 | 45.5 | - |\n| **Coder** | 58.9 | 55.1 | 54.9 | 53.2 | 43.0 | 42.8\u2020 |\n| **IQ3_S** (AMD RX 7900 XTX, gfx1100) | 65.1 | 60.4 | 64.4 | 61.8 | 59.2 | - |\n\nEngine 0.1.26, the same runs. The AMD RX 7900 XTX row: engine 0.1.38 on a ROCm 10.2 nightly (tuned\ngfx1100 hipBLASLt-100500 table, upstream as [#755](https://github.com/Niko1221/Strata/pull/755)), median of 3 clean cells per tier (same box; decode is flat in\ncontext - the GDN linear attention is O(1) per token; 1K/4K prefill ran slightly under the 0.1.31\npackaged-ROCm numbers, 32K-128K ahead). \u2020 not measured again: 0.1.14.\n\nOutput speed depends on the text as well: speculative decoding runs faster when more of the drafted tokens are\naccepted, so a different answer to the same prompt moves it by several percent. Run back to back on the 4K prompt,\n0.1.14 writes 88.5 tokens/s and 0.1.12 85.7. The numbers before 0.1.13 (prompts about half as fast):\n[`bench/results/2026-09-24-final`](../bench/results/2026-09-24-final/matrix.md); these:\n[`bench/results/2026-09-28-speed-0114`](../bench/results/2026-09-28-speed-0114/README.md).\n\nIQ3_XXS and IQ3_S at 262K are not measLine truncated
}
],
"response": {
"first": 1.4349831156432629,
"total": 4.147740138694644,
"text": "# Technical Analysis: PolyStrata Engine Design and Implementation\n\n## 1. Executive Summary\n\nPolyStrata is a high-performance inference engine designed for running large language models (LLMs) with **Mixture of Experts (MoE)** architectures on consumer-grade hardware. Its core innovation lies in optimizing the memory bandwidth bottleneck inherent in MoE models by dynamically managing the placement of \"expert\" weights between GPU VRAM and system RAM, while utilizing advanced quantization techniques (IQ2, IQ3, Q2) and speculative decoding to maximize throughput.\n\nThe engine is built for flexibility, supporting NVIDIA (CUDA) and AMD (ROCm/HIP) GPUs, with specific optimizations for Windows and Linux environments. It prioritizes long-context window support (up to 262K tokens) through KV cache streaming and hybrid quantization.\n\n---\n\n## 2. Core Architectural Design\n\n### 2.1 Mixture of Experts (MoE) Management\nUnlike dense models where all weights are active, MoE models activate only a subset of \"experts\" per token. PolyStrata addresses the VRAM limitation of consumer cards (e.g., 12GB\u201324GB) by implementing a **tiered expert caching system**:\n* **VRAM (GPU):** Holds the most frequently accessed experts for low-latency access.\n* **RAM (System Memory):** Acts as a large buffer for the remaining experts.\n* **Disk (MMap):** In \"Low-RAM mode,\" experts are memory-mapped from disk (`experts.bin`) when system RAM is insufficient. The OS file cache handles swapping between disk and RAM/VRAM.\n\n**Tradeoff:** This design allows running models that exceed VRAM capacity but introduces latency penalties when experts must be fetched from RAM or disk. The engine mitigates this via **KV streaming** (see below) to free up VRAM for more experts.\n\n### 2.2 Quantization Strategies\nPolyStrata supports multiple quantization formats to balance speed, memory usage, and accuracy:\n* **Q2_0:** The fastest format, using fused int8 tensor-core kernels for prompt processing. It offers near-FP16 accuracy with significant speedups.\n* **IQ2_XS / IQ3_XXS / IQ3_S:** These are \"Intelligent Quantization\" formats. They use complex packing schemes to achieve higher precision than standard 4-bit quantization while maintaining smaller footprint.\n * ",
"usage": null,
"timings": {
"cache_n": 0,
"prompt_n": 5048,
"prompt_ms": 1410.307,
"prompt_per_token_ms": 0.27937935816164816,
"prompt_per_second": 3579.3625075958635,
"predicted_n": 512,
"predicted_ms": 2712.195,
"predicted_per_token_ms": 5.307622309197652,
"predicted_per_second": 188.40828185289035,
"draft_n": 349,
"draft_n_accepted": 265
},
"err": null,
"pieces": 512
},
"metrics": {
"ok": true,
"err": null,
"ttft_s": 1.435,
"total_s": 4.148,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 5048,
"generated_tokens": 512,
"prompt_tps": 3579.3625075958635,
"prompt_tps_source": "engine",
"decode_tps": 188.40828185289035,
"decode_tps_source": "engine",
"prompt_ms": 1410.307,
"decode_ms": 2712.195,
"drafts_offered": 349,
"drafts_accepted": 265
}
},
{
"run": 2,
"source": "docs/HOW_IT_WORKS.md",
"messages": [
{
"role": "user",
"content": "Run identifier 2-0. Read the following project documentation and write a detailed technical explanation of its design, tradeoffs, and how someone would use it in practice.\n\n# How does PolyStrata work?\n\nModels like Qwen3.8-Flash-Next normally run on servers with hundreds of gigabytes of graphics memory. Your graphics\ncard has 12-24 GB. PolyStrata makes it fit by **sharing the work across your whole PC** - the same idea as a kitchen, where\nthe things you use all the time stay on the counter and the rest waits in the pantry. Back to the\n[README](../README.md#how-does-it-work).\n\n## Who does what\n\n<p align=\"center\"><img src=\"media/how-it-works.svg\" width=\"860\" alt=\"The model's 24,576 experts: the busiest on the graphics card, all of them in RAM, a lookup table on the SSD\"></p>\n\n- **The model is a team of 24,576 small specialists (\"experts\"),** and each word it writes needs only 10 of them.\n So it doesn't have to have all of them on the graphics card at once.\n- **Your graphics card** does the part of the work needed for every word, and keeps the few thousand experts that\n are asked most often. It keeps learning which ones those are while you use it.\n- **Your RAM** holds every expert. When a word needs one the card doesn't have, **your processor** works on it -\n at the same time as the graphics card, so neither waits for the other.\n- **Your SSD** holds a big lookup table; the model only reads a few small rows of it per word.\n\nThe same in technical terms:\n\n- **GPU (VRAM):** attention and DeltaNet mixers, the gated-residual weights, routers, shared experts, output head, the\n MTP draft layer, the KV cache (from 64K: only its most-read part, the rest streams from RAM), and an **expert\n cache** that fills the rest of VRAM with the most-used experts (it adapts to the conversation while you chat).\n More VRAM matters more than a faster GPU: every extra GB holds ~700 more experts, and every expert on the GPU is one\n the CPU does not have to compute.\n- **RAM:** all 24,576 experts, pinned. The CPU computes the experts that are not on the GPU **in place**, at the same\n time as the GPU works on the cached ones (AVX-512 / AVX2 kernels, ggml's for the i-quants). On a PC with little RAM\n and a big card, the [low-RAM mode](MODELS.md#a-big-graphics-card-and-little-ram) keeps in RAM only what the GPU does\n not hold.\n- **SSD:** the 28.8 GB n-gram table, read a few rows per token through the OS cache.\n\nThis works the same on NVIDIA (CUDA) and AMD (HIP) cards: the same engine, compiled for each.\n\n## Guess, then check\n\n<p align=\"center\"><img src=\"media/guess-and-check.svg\" width=\"860\" alt=\"A small helper guesses the next words; the big model checks them all at once and keeps the right ones\"></p>\n\n- **Guess, then check.** A small, fast helper built into the model guesses the next few words, and the big model\n checks all the guesses in one go. It keeps the ones it agrees with and writes the next word itself - so one step\n often produces several words. The helper only guesses - the big model decides every word - so you get the same\n quality answer, 1.6-1.8x sooner.\n- In technical terms: the model's own MTP layer drafts up to 3 tokens; one pass over all 48 layers checks them, 2.4-3.2\n tokens per pass on average. When the reply repeats the context (code edits, quoted text), **prompt lookup** drafts\n up to 5 tokens from the earlier copy, but only where its measured acceptance and cost say it pays: code edits 6-11%\n faster, other text unchanged. The drafts are checked like the MTP's, so the output is the same.\n\n## Reading long texts\n\n**Long texts are read in big pieces** (up to 8,192 tokens - pieces of words - at a time), which is why a long\ndocument or code base is read at over 1,000 tokens per second. The experts of the next layer stream to the GPU over\nPCIe while the current layer's attention runs. After the first message, PolyStrata keeps the conversation and reads only\nwhat is new, so follow-ups start in seconds.\n\n## More\n\nThe [details](DETAILS.md#how-it-works) explain every part and its numbers, and the\n[paper](paper/Strata-Paper.pdf) tells the whole story, with the measurements behind it.\n\n## Credits\n\n- PolyStrata is built on [Strata](https://github.com/Niko1221/Strata) by Niko1221 and its contributors. The Qwen\n engine, the installer, the server and the web app are that project's work. PolyStrata adds the engine for GLM 5.3\n Flash ([GLM.md](GLM.md)), whose file is from\n [neuralll](https://huggingface.co/neuralll/GLM-5.3-Flash-GSQ-RCO-3.0bit-Q4Kattn-GGUF).\n- Model: [Qwen3.8-Flash-Next](https://huggingface.co/Qwen/Qwen3.8-Flash-Next) by the Qwen team; compressed versions by\n [ISTA-DASLab](https://huggingface.co/ISTA-DASLab/Qwen3.8-Flash-Next-GSQ-RCO-GGUF);\n [Swift 1.5](https://huggingface.co/ukisai/Swift-1.5-Qwen3.8-Flash-Next-GSQ-RCO-GGUF) by UkisAI; the experimental\n [UD-Q4_K_XL](https://huggingface.co/unsloth/Line truncated
}
],
"response": {
"first": 0.5059821251779795,
"total": 2.9647836182266474,
"text": "# Technical Analysis of PolyStrata: Design, Tradeoffs, and Practical Usage\n\n## 1. Executive Summary\n\nPolyStrata is a specialized inference engine designed to run large-scale Mixture-of-Experts (MoE) models, specifically **Qwen3.8-Flash-Next**, on consumer-grade hardware with limited VRAM (12\u201324 GB). Unlike traditional inference engines that require the entire model to fit into GPU memory, PolyStrata utilizes a **heterogeneous computing approach**, distributing the workload across the GPU, CPU (RAM), and SSD.\n\nThe core innovation lies in its dynamic **Expert Cache** mechanism, which keeps frequently accessed \"experts\" on the GPU while offloading less frequent ones to system RAM, computed in parallel by the CPU. This is augmented by **Guess-and-Check** decoding (MTP) and **Prompt Lookup** to accelerate generation speeds.\n\n---\n\n## 2. System Architecture & Design\n\nPolyStrata\u2019s architecture is built around the principle of **spatial and temporal data locality optimization** across three storage tiers: VRAM, RAM, and SSD.\n\n### 2.1. The MoE Structure\nThe model consists of **24,576 experts**. For each token generated, only **10 experts** are activated. This sparsity allows PolyStrata to avoid loading all experts simultaneously.\n\n### 2.2. Tiered Resource Allocation\n\n#### A. GPU (VRAM): The High-Speed Core\nThe GPU handles the most latency-sensitive parts of the computation:\n- **Attention & DeltaNet Mixers**: Core transformer operations.\n- **Gated-Residual Weights & Routers**: Decision-making layers.\n- **Shared Experts & Output Head**: Commonly used components.\n- **MTP Draft Layer**: For speculative decoding.\n- **KV Cache (Partial)**: Only the most-read portion of the 64K context window is kept in VRAM; the rest streams from RAM.\n- **Expert Cache**: The most critical component. It dynamically fills the remaining VRAM with the **most frequently accessed experts**. This cache adapts in real-time during conversation.\n\n> **Key Insight**: VRAM capacity is more valuable than GPU compute speed. Each extra GB of VRAM holds ~700 more experts, directly reducing CPU load.\n\n#### B. RAM: The Parallel Compute Pool\n- **Storage**: Holds **all 24,576 experts** in pinned memory",
"usage": null,
"timings": {
"cache_n": 0,
"prompt_n": 1696,
"prompt_ms": 493.645,
"prompt_per_token_ms": 0.2910642688679245,
"prompt_per_second": 3435.6673317870136,
"predicted_n": 512,
"predicted_ms": 2458.436,
"predicted_per_token_ms": 4.811029354207436,
"predicted_per_second": 207.85572616085997,
"draft_n": 374,
"draft_n_accepted": 295
},
"err": null,
"pieces": 512
},
"metrics": {
"ok": true,
"err": null,
"ttft_s": 0.506,
"total_s": 2.965,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 1696,
"generated_tokens": 512,
"prompt_tps": 3435.6673317870136,
"prompt_tps_source": "engine",
"decode_tps": 207.85572616085997,
"decode_tps_source": "engine",
"prompt_ms": 493.645,
"decode_ms": 2458.436,
"drafts_offered": 374,
"drafts_accepted": 295
}
},
{
"run": 2,
"source": "docs/INSTALL.md",
"messages": [
{
"role": "user",
"content": "Run identifier 2-1. Read the following project documentation and write a detailed technical explanation of its design, tradeoffs, and how someone would use it in practice.\n\n# Installing PolyStrata\n\nEverything about installing, starting, updating and configuring PolyStrata, on Windows and Linux, with an NVIDIA or an\nAMD graphics card. The short version is in the [README](../README.md#install); an AI coding assistant can do all of\nthis for you with [AI_SETUP.md](AI_SETUP.md).\n\n> **On this page:** [What you need](#what-you-need) \u00b7 [Windows](#windows) \u00b7 [Linux](#linux) \u00b7\n> [AMD cards](#amd-cards) \u00b7 [Several cards](#two-or-three-cards) \u00b7 [Docker](#docker-linux) \u00b7\n> [Older CPUs](#older-cpus-experimental) \u00b7 [Updating](#updating) \u00b7 [Where things are stored](#where-things-are-stored) \u00b7\n> [Setup's questions](#setups-questions) \u00b7 [Tuning](#tuning-for-your-pc) \u00b7 [All options](#options-without-questions)\n\n## What you need\n\nThis is for Qwen3.8-Flash-Next. GLM 5.3 Flash needs Linux, one NVIDIA card and far more RAM:\n[GLM.md](GLM.md#what-you-need). The three smaller models (Qwen3.6-35B-A3B, Ornith 1.5, Gemma 4 26B-A4B) need Linux\nor Windows, one NVIDIA card and less of everything: [BACKENDS.md](BACKENDS.md#install).\n\n| | |\n| --- | --- |\n| **GPU** | **NVIDIA** RTX 20, 30, 40 or 50 series, **12 GB VRAM or more** (8 GB runs, slowly). Measured on an RTX 5070 and an RTX 3090; RTX 20 (Turing, since 0.1.27) was tested by a contributor on an RTX 2070. **AMD** Radeon RX 7900 XT / XTX, RX 9070 / 9070 XT and Radeon AI PRO R9700 (validated), RX 7800 XT / 7700 XT and RX 9060 XT (validated by their owners), RX 6800 / 6900 series (community-reported), with 12 GB of VRAM or more. See [AMD cards](#amd-cards). |\n| **RAM** | Enough for the size you pick ([which model](MODELS.md#pick-by-ram)); **64 GB** runs every size. A big GPU makes up for less RAM - the [low-RAM mode](MODELS.md#a-big-graphics-card-and-little-ram). |\n| **CPU** | x86-64 with AVX2 (any Intel/AMD desktop CPU from the last ~8 years). AVX-512 (Ryzen 7000/9000) is a bit faster. Older CPUs without AVX2 are experimental and slow: [Older CPUs](#older-cpus-experimental). |\n| **Disk** | ~70-80 GB free for the model, ~6 GB for the MTP layer (+1 GB with images). **Q2_0 on an AVX-512 CPU** also writes a one-time ~40 GB copy of its experts for the fast CPU kernel. On Linux with an AMD card, ROCm takes ~10 GB more when setup installs it. An NVMe SSD is strongly recommended: it makes the first start much faster. |\n| **OS** | Windows 10/11, or Linux (Ubuntu 22.04/24.04 and Debian 12/13 get everything installed automatically). |\n| **Driver** | **NVIDIA:** a current driver, version 580 or newer ([nvidia.com/drivers](https://www.nvidia.com/drivers) or the NVIDIA App). **AMD:** on Linux the kernel's amdgpu driver (no ROCm install needed); on Windows a current AMD Software: Adrenalin Edition driver ([amd.com/support](https://www.amd.com/en/support)). |\n\nThe driver is the only thing you install yourself. Everything else - Python, the engine, the model - is set up for\nyou the first time: Python 3.12 if you have none (for your user account, no admin), a private Python environment in\n`.venv/`, the PolyStrata engine, the model and the MTP draft layer. On NVIDIA it uses the ready-made engine for RTX\n20/30/40/50 and NVIDIA's CUDA libraries from pip (~0.4 GB); if no ready-made engine fits your PC, it offers to install\nthe build tools (Visual Studio Build Tools + CUDA Toolkit on Windows, `build-essential` + CUDA on Ubuntu) and compiles\nthe engine for your GPU (asks first; 20-40 minutes once). More: [details](DETAILS.md#before-you-start).\n\n## Windows\n\n1. [Download this project](https://github.com/VecSzn/PolyStrata/archive/refs/heads/main.zip) and unzip it (or\n `git clone` it).\n2. Double-click **`START-HERE.bat`**.\n3. Answer a few questions - or just press Enter each time for the recommended choice ([the questions](#setups-questions)).\n\nThen it downloads everything (the model is ~70 GB, so the first time takes a while - you can stop and it picks up\nwhere it left off) and **starts the model**. Your browser opens the PolyStrata app at `http://127.0.0.1:8080`.\n\n> **While the model starts, your PC can be slow or stop responding for 1-3 minutes** (longest the first time): PolyStrata\n> loads 35-55 GB into your RAM and locks part of it for the graphics card. That's normal - wait, and don't close the\n> window. The window tells you what it is doing.\n\n**Next time**, just double-click `START-HERE.bat` again: it starts right away (30-90 s to load the model), nothing is\ndownloaded twice. Close its window to stop the model. `SETUP.bat` (the same as `START-HERE.bat --setup`) installs\nanother model or changes the settings. Starting PolyStrata from Task Scheduler at logon needs two task settings, or the\nstart is 24x slower: [Running it at startup](DETAILS.md#running-it-at-startup-task-scheduler).\n\Line truncated
}
],
"response": {
"first": 1.2777377795428038,
"total": 3.9290474113076925,
"text": "# Technical Analysis: PolyStrata Project (Run Identifier 2-1)\n\n## 1. Executive Summary\nPolyStrata is a high-performance, local Large Language Model (LLM) inference engine designed to run quantized models (specifically focusing on the Qwen3.8-Flash-Next architecture and others) on consumer-grade hardware. It abstracts the complexity of setting up Python environments, CUDA/ROCm drivers, and model weights into a streamlined, cross-platform installer. The system is optimized for low-latency inference using Mixture of Experts (MoE) architectures, leveraging both GPU VRAM and system RAM to manage large model sizes that exceed typical consumer GPU capacities.\n\n## 2. System Design & Architecture\n\n### 2.1 Core Components\nThe system is composed of three primary layers:\n1. **The Engine (PolyStrata):** A C++/CUDA (or HIP for AMD) based inference backend. It handles tensor operations, KV-cache management, and expert routing. It is compiled specifically for the user's hardware architecture (e.g., RTX 30 series vs. RTX 40 series) to ensure optimal performance.\n2. **The Model Layer:** Supports various quantization formats (Q2_0, IQ2_XS, IQ3_XXS, etc.). The system uses a \"pack\" structure where model experts are stored efficiently.\n3. **The MTP (Multi-Token Prediction) Draft Layer:** A specialized component that accelerates generation by predicting multiple tokens ahead, reducing the latency per token.\n\n### 2.2 Hardware Abstraction & Backend Selection\nPolyStrata employs a dynamic backend selection strategy:\n* **NVIDIA:** Uses CUDA. It attempts to load a pre-compiled binary for common architectures (RTX 20/30/40/50 series). If no binary matches, it triggers a one-time compilation using the CUDA Toolkit.\n* **AMD:** Uses HIP/ROCm. On Linux, it leverages system ROCm or installs wheels into a virtual environment. On Windows, it relies on the Adrenalin driver. Note that AMD support has limitations regarding vision tasks (CPU-bound) and specific quantization methods (Unsloth 4-bit requires NVIDIA).\n\n### 2.3 Memory Management Strategy\nA critical design feature is the handling of models larger than available VRAM:\n* **VRAM Priority:** The engine prioritizes loading model experts into GPU VRAM",
"usage": null,
"timings": {
"cache_n": 0,
"prompt_n": 4370,
"prompt_ms": 1254.35,
"prompt_per_token_ms": 0.28703661327231117,
"prompt_per_second": 3483.8761111332565,
"predicted_n": 512,
"predicted_ms": 2646.338,
"predicted_per_token_ms": 5.178743639921723,
"predicted_per_second": 193.09702691039465,
"draft_n": 352,
"draft_n_accepted": 272
},
"err": null,
"pieces": 512
},
"metrics": {
"ok": true,
"err": null,
"ttft_s": 1.278,
"total_s": 3.929,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 4370,
"generated_tokens": 512,
"prompt_tps": 3483.8761111332565,
"prompt_tps_source": "engine",
"decode_tps": 193.09702691039465,
"decode_tps_source": "engine",
"prompt_ms": 1254.35,
"decode_ms": 2646.338,
"drafts_offered": 352,
"drafts_accepted": 272
}
},
{
"run": 2,
"source": "docs/DETAILS.md",
"messages": [
{
"role": "user",
"content": "Run identifier 2-2. Read the following project documentation and write a detailed technical explanation of its design, tradeoffs, and how someone would use it in practice.\n\n# PolyStrata - the details\n\nThe technical side of PolyStrata: every measured number, the API, images, all settings and how the engine works.\nNew here? Start with the [README](../README.md); installing step by step is in [INSTALL.md](INSTALL.md), the models in\n[MODELS.md](MODELS.md), common problems in [TROUBLESHOOTING.md](TROUBLESHOOTING.md).\n\n> **On this page:** [Speed](#speed-measured) \u00b7 [Other GPUs](#other-gpus-estimated) \u00b7 [Which model?](#which-model) \u00b7\n> [Requirements](#before-you-start) \u00b7 [Windows](#windows) \u00b7 [Linux](#linux) \u00b7 [API](#using-it) \u00b7\n> [MCP tools](#tools-from-mcp-servers) \u00b7 [MCP server](#manage-strata-from-your-ai-assistant-mcp-server) \u00b7\n> [Images](#images-vision) \u00b7\n> [Troubleshooting](#troubleshooting) \u00b7 [How it works](#how-it-works)\n\n---\n\n## Speed (measured)\n\nRTX 5070 **12 GB**, Ryzen 5 7600 (6 cores), 64 GB DDR5-5200, Windows, engine 0.1.26 with the settings setup writes\n(`--prefill auto`, 8-bit KV above 4K, KV streaming from 64K). One code-agent prompt per length, 256 generated tokens,\nMTP speculative decoding on. \"262K\" is the model's full context window (a 259,943-token prompt). The IQ2_XS row was\nmeasured with Swift 1.5's IQ2_XS, which runs at the original's speed.\n\n**Engine 0.1.36 (#136), the same PC:** Q2_0's prompt experts run on fused int8 tensor-core kernels (RTX 30 and newer):\n4K 1,294 -> 1,570, 32K 2,170 -> 2,653, 128K 2,123 -> 2,468 tokens/s (+16-22%), as close to an FP16 reference as the\nprevious kernels (closer at 32K: teacher-forced KL 0.009 vs 0.012). The decode path's block selection and greedy\nargmax run on thread-block clusters (RTX 50, sm_90+; other cards keep the previous kernels; the same tokens): Q2_0 output at 4K 89 -> 93.5, at 128K\n64.5 -> 76.4 tokens/s. `STRATA_PF_FUSED=0` keeps the previous prompt kernels (byte-identical answers to 0.1.35);\n`STRATA_PF_FUSED=1` also runs the native IQ packs' fused kernels (opt-in: IQ2_XS prompts +12% at 4K, +3% at 32K, the\nIQ3 packs about even; on HIP they run on gfx11 and on gfx1200 / gfx1201, see AMD_HIP.md); `STRATA_QSA_CLUSTER=0` / `STRATA_ARGMAX_MULTI=0` turn the decode kernels off. The tables\nbelow are 0.1.26's.\n\n### Prompt processing (tokens/s)\n\n| Model | 1K | 4K | 32K | 64K | 128K | 262K |\n| --- | ---: | ---: | ---: | ---: | ---: | ---: |\n| **Q2_0** | 536 | 1,299 | 2,171 | 2,126 | 2,107 | 1,304\u2020 |\n| **IQ2_XS** | 534 | 1,256 | 2,092 | 1,754 | 1,752 | 1,181*\u2020 |\n| **IQ3_XXS** | 482 | 1,007 | 1,745 | 1,609 | 1,602 | - |\n| **IQ3_S** | 427 | 913 | 1,624 | 1,640 | 1,443 | - |\n| **Coder** | 656 | 1,583 | 2,177 | 2,236 | 2,208 | 1,034** |\n| **IQ3_S** (AMD RX 7900 XTX, gfx1100) | 760 | 1,275 | 1,641 | 1,594 | 1,494 | - |\n\nEngine 0.1.26; `bench/results/2026-09-29-speed-0126`. The AMD RX 7900 XTX row: engine 0.1.38 on a ROCm\n10.2 nightly with a tuned gfx1100 hipBLASLt-100500 table (upstream as [#755](https://github.com/Niko1221/Strata/pull/755)),\nthe median of 3 clean cells per tier\n(Ryzen 9 7900X, 96 GB; 1K-128K one-shot runs, 256 generated tokens,\ngreedy). At 32K-128K that is 8-28% faster than 0.1.22. \u2020 not measured\nagain: 0.1.22. \\* measured with images on (the image encoder's VRAM reserve leaves fewer experts cached). \\*\\* not\nmeasured again: 0.1.14.\n\n### Output (tokens/s)\n\n| Model | 1K | 4K | 32K | 64K | 128K | 262K |\n| --- | ---: | ---: | ---: | ---: | ---: | ---: |\n| **Q2_0** | 87.3 | 93.0 | 81.8 | 76.2 | 73.7 | 60.3\u2020 |\n| **IQ2_XS** | 79.6 | 78.6 | 76.3 | 63.7 | 62.7 | 52.8\u2020 |\n| **IQ3_XXS** | 61.9 | 61.6 | 58.5 | 57.2 | 49.0 | - |\n| **IQ3_S** | 52.4 | 53.3 | 48.3 | 46.3 | 45.5 | - |\n| **Coder** | 58.9 | 55.1 | 54.9 | 53.2 | 43.0 | 42.8\u2020 |\n| **IQ3_S** (AMD RX 7900 XTX, gfx1100) | 65.1 | 60.4 | 64.4 | 61.8 | 59.2 | - |\n\nEngine 0.1.26, the same runs. The AMD RX 7900 XTX row: engine 0.1.38 on a ROCm 10.2 nightly (tuned\ngfx1100 hipBLASLt-100500 table, upstream as [#755](https://github.com/Niko1221/Strata/pull/755)), median of 3 clean cells per tier (same box; decode is flat in\ncontext - the GDN linear attention is O(1) per token; 1K/4K prefill ran slightly under the 0.1.31\npackaged-ROCm numbers, 32K-128K ahead). \u2020 not measured again: 0.1.14.\n\nOutput speed depends on the text as well: speculative decoding runs faster when more of the drafted tokens are\naccepted, so a different answer to the same prompt moves it by several percent. Run back to back on the 4K prompt,\n0.1.14 writes 88.5 tokens/s and 0.1.12 85.7. The numbers before 0.1.13 (prompts about half as fast):\n[`bench/results/2026-09-24-final`](../bench/results/2026-09-24-final/matrix.md); these:\n[`bench/results/2026-09-28-speed-0114`](../bench/results/2026-09-28-speed-0114/README.md).\n\nIQ3_XXS and IQ3_S at 262K are not measLine truncated
}
],
"response": {
"first": 1.4993299152702093,
"total": 4.075669066980481,
"text": "# Technical Analysis: PolyStrata Engine (Run Identifier 2-2)\n\n## 1. Executive Summary\nPolyStrata is a high-performance inference engine designed for running large language models (LLMs) with **Mixture of Experts (MoE)** architectures on consumer-grade hardware. Its core innovation lies in optimizing the movement and computation of sparse expert weights between CPU RAM and GPU VRAM, utilizing advanced quantization (down to 2-bit), speculative decoding, and custom CUDA/HIP kernels.\n\nThe engine prioritizes **context length scalability** (up to 262K tokens) and **throughput** over raw per-token latency, making it suitable for long-document analysis and code generation tasks on mid-range GPUs (e.g., RTX 30/50 series, RX 7900 XTX).\n\n---\n\n## 2. Core Design & Architecture\n\n### 2.1 Mixture of Experts (MoE) Management\nUnlike dense models, MoE models contain many \"expert\" sub-networks that are activated per token. PolyStrata manages this via a hierarchical memory strategy:\n* **Expert Cache:** Only the most frequently used experts are kept in GPU VRAM.\n* **RAM/VRAM Streaming:** Less frequent experts reside in pinned CPU RAM. When needed, they are streamed to the GPU.\n* **Low-RAM Mode:** If system RAM is insufficient to hold all experts, the engine uses `--mmap-experts` to map expert files directly from disk, relying on the OS file cache. This allows running models with 50GB+ of experts on systems with limited RAM, albeit with potential I/O bottlenecks.\n\n### 2.2 Quantization Strategy\nPolyStrata supports aggressive quantization to fit large models into limited VRAM:\n* **Weights:** Supports Q2_0 (2-bit), IQ2_XS, IQ3_XXS, IQ3_S, and Coder-specific quantizations.\n* **KV Cache:**\n * **Default:** 8-bit (`int8`).\n * **Optional 4-bit:** `--kv q4_0` uses Hadamard rotation before rounding to save 50% KV memory, with a ~4-12% perplexity penalty.\n * **Hybrid K8V4:** Keeps keys at 8-bit and values at 4-bit rotated, reducing KV memory by 23",
"usage": null,
"timings": {
"cache_n": 0,
"prompt_n": 5048,
"prompt_ms": 1417.019,
"prompt_per_token_ms": 0.2807089936608558,
"prompt_per_second": 3562.408125790833,
"predicted_n": 512,
"predicted_ms": 2574.725,
"predicted_per_token_ms": 5.038600782778865,
"predicted_per_second": 198.46779753177523,
"draft_n": 359,
"draft_n_accepted": 285
},
"err": null,
"pieces": 512
},
"metrics": {
"ok": true,
"err": null,
"ttft_s": 1.499,
"total_s": 4.076,
"prompt_tokens": null,
"reused_tokens": 0,
"read_tokens": 5048,
"generated_tokens": 512,
"prompt_tps": 3562.408125790833,
"prompt_tps_source": "engine",
"decode_tps": 198.46779753177523,
"decode_tps_source": "engine",
"prompt_ms": 1417.019,
"decode_ms": 2574.725,
"drafts_offered": 359,
"drafts_accepted": 285
}
}
]
@@ -0,0 +1,13 @@
[
"/opt/polystrata-v0.1.45-poly.1/.venv/bin/python",
"/opt/polystrata-v0.1.45-poly.1/tools/strata_bench.py",
"--url",
"http://127.0.0.1:18080",
"--config",
"/opt/us2-results/step9/2026-10-17-rtx3090/upstream-flash-next/server.json",
"--runs",
"3",
"--long",
"--out",
"/opt/us2-results/step9/2026-10-17-rtx3090/upstream-flash-next/community"
]
@@ -0,0 +1,61 @@
# Community benchmark on NVIDIA GeForce RTX 3090
Measured on 2026-10-18 with `tools/strata_bench.py` (suite 1, 3 runs per test, medians with ranges). Speeds are the engine's own timings; first-token times are measured by the client over HTTP. Speed only: no correctness check was run.
## Hardware and software
- GPU and VRAM: NVIDIA GeForce RTX 3090, 24 GiB VRAM
- CPU: AMD EPYC 7H12 64-Core Processor (128 cores, 256 threads); installed RAM: 1007.6 GiB; storage: not measured
- OS: Linux 6.8.0-107-generic; GPU driver: 580.126.20; CUDA: 13.0
- PolyStrata: project 0.1.45, commit d0cd84dc; engine 0.1.45
- Background workloads and power limits: not recorded
## Model and configuration
- Model and quantization: qwen3.8-flash-next-iq3_xxs
- Context: 65536 tokens; parallel slots: 1
- Settings: the install's own configuration, unchanged; thinking off for the suite; temperature 0
```text
strata --pack pack-iq3-xxs --native Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00001-of-00002.gguf --ple-gguf Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00002-of-00002.gguf --expert-profile expert-profile.bin --expert-cache auto --prefill auto --spec 4 --spec-min-p 0.5 --mtp mtp --max-context 65536 --kv int8 --ple-io ram --pool-workers 15 --kv-resident 32768
```
## Method
Run by `python tools/strata_bench.py --long` against the HTTP API of a PolyStrata server (already running); model loading is not timed. One warm-up chat and a 1K prompt are discarded first. Every prompt starts with a unique tag, so the conversation cache cannot help the fresh-prompt tests.
- short chat: the three questions of `tools/ab_engine.py`, up to 100 new tokens, 3 runs
- 4K / 16K prompts: generated word lists sized by a calibration request, 24 new tokens, 3 fresh prompts each
- agent session: system prompt and four tools, then 5 turns that each add about 1500 words of a project file and continue from the model's own earlier answers (the way agent clients resend a conversation), 64 new tokens per turn, 3 sessions; the cache numbers come from the answer's usage (`cached_tokens`) and timings (`prompt_n`)
- concurrency (when run): N requests sent at the same moment, total tokens over the wall time of the burst, latency over all requests
## Results
| Configuration | Actual prompt tokens | Reused tokens | Generated tokens | Runs | Prompt tok/s median and range | Decode tok/s median and range | TTFT seconds median and range |
| --- | ---: | ---: | ---: | ---: | --- | --- | --- |
| short chat | 46 (43-51) | 0 | 100 (100-100) | 9 | not measured | 87.1 (72.5-107.0) | 0.41 (0.36-0.48) |
| 4K prompt, fresh | 4019 (4019-4019) | 0 (0-0) | 24 cap | 3 | 1923.9 (1835.2-1933.9) | not measured | 2.11 (2.10-2.21) |
| 16K prompt, fresh | 16058 (16058-16058) | 0 (0-0) | 24 cap | 3 | 2342.1 (2326.5-2347.6) | not measured | 6.89 (6.88-6.93) |
| 32K prompt, fresh | 32049 (32049-32049) | 0 (0-0) | 24 cap | 3 | 2392.9 (2388.9-2395.0) | not measured | 13.45 (13.43-13.47) |
| agent session, follow-up turns | 15157 (15149-15169) at the last turn | see below | up to 64 | 3 | see below | 110.6 (70.0-135.6) | 2.00 (1.64-2.26) |
Ranges are the lowest and highest of the runs; `Runs` counts requests that returned a token.
### Agent session (conversation cache)
Cache hit over the follow-up turns: 69.3 % (69.1-69.3); earlier-turn tokens read again per session: 4 (3-74) (earlier turns that the cache did not hold; the 14334 (14334-14334) new tokens of the files are read once); first turn (nothing cached) first token: 0.97 s (0.97-1.01).
| Turn (run 1) | Prompt tokens | Reused | Read | Prompt tok/s | First token (s) | Decode tok/s |
| ---: | ---: | ---: | ---: | ---: | ---: | ---: |
| 0 | 609 | 0 | 609 | 640.6 | 0.972 | 56.2 |
| 1 | 4180 | 624 | 3556 | 1664.6 | 2.167 | 70.0 |
| 2 | 5841 | 4243 | 1598 | 973.0 | 1.671 | 77.6 |
| 3 | 9277 | 5904 | 3373 | 1510.5 | 2.261 | 85.3 |
| 4 | 12253 | 9331 | 2922 | 1484.5 | 2.003 | 95.9 |
| 5 | 15157 | 12268 | 2889 | 1461.8 | 2.004 | 88.9 |
Per-request data: `results.json`. Engine log lines from the start: `engine-log-excerpt.txt` (when this run started the server).
## Correctness and limitations
Not measured: this is a speed suite. The conversation uses the model's own replies, so token counts differ a little between runs. Machine details come from the server, `nvidia-smi`/`rocm-smi` and the OS; background load and power limits are not recorded. Total time of the suite: 128 s.
@@ -0,0 +1,998 @@
{
"schema": 1,
"tool": "tools/strata_bench.py",
"date": "2026-10-18",
"params": {
"runs": 3,
"think": false,
"clients": 0,
"long": true,
"started_server": false,
"command": "python tools/strata_bench.py --long"
},
"elapsed_s": 127.83168578147888,
"machine": {
"gpu": [
"NVIDIA GeForce RTX 3090"
],
"gpu_vram_mib": 24576,
"gpu_driver": "580.126.20",
"cuda": "13.0",
"cpu": "AMD EPYC 7H12 64-Core Processor",
"cpu_cores": 128,
"cpu_threads": 256,
"ram_gib": 1007.6,
"os": "Linux 6.8.0-107-generic",
"python": "3.12.3",
"strata_version": "0.1.45",
"strata_commit": "d0cd84dc",
"engine_version": "0.1.45",
"model": "qwen3.8-flash-next-iq3_xxs",
"quant": "IQ3",
"context": 65536,
"parallel_slots": 1,
"config": {
"exe": "strata",
"model_name": "qwen3.8-flash-next-iq3_xxs",
"args": [
"--pack",
"pack-iq3-xxs",
"--native",
"Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00001-of-00002.gguf",
"--ple-gguf",
"Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00002-of-00002.gguf",
"--expert-profile",
"expert-profile.bin",
"--expert-cache",
"auto",
"--prefill",
"auto",
"--spec",
"4",
"--spec-min-p",
"0.5",
"--mtp",
"mtp",
"--max-context",
"65536",
"--kv",
"int8",
"--ple-io",
"ram",
"--pool-workers",
"15",
"--kv-resident",
"32768"
],
"sampling": {
"temperature": 0.6,
"top_p": 0.95,
"top_k": 20,
"min_p": 0.0
}
},
"launch": "strata --pack pack-iq3-xxs --native Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00001-of-00002.gguf --ple-gguf Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00002-of-00002.gguf --expert-profile expert-profile.bin --expert-cache auto --prefill auto --spec 4 --spec-min-p 0.5 --mtp mtp --max-context 65536 --kv int8 --ple-io ram --pool-workers 15 --kv-resident 32768",
"engine_info": {
"model": "qwen3.8-flash-next-iq3_xxs",
"max_context": 65536,
"images": false,
"version": "0.1.45",
"logit_bias": 1,
"context": 65536,
"kv": "int8",
"kv_resident": 32768,
"expert_slots": 10531,
"expert_cache_mib": 17485,
"expert_slots_primary": 10531,
"expert_cache_primary_mib": 17485,
"spec": 6,
"mtp_max": 4,
"lookup": 3,
"vram_free_mib": 465,
"cvec": 0,
"arena_mib": 40925,
"pool_workers": 15,
"pcie_frac": "0.55",
"spec_min_p": "0.50",
"conversation_cache_mib": 0,
"conversation_cache_slots": 4,
"conversation_cache_min_free_mib": 2560,
"conversation_cache_min_tokens": 0,
"tail_role_token": -1,
"vram_elastic": 0,
"prefill_cap": 8192,
"prefill_stages": 1,
"stream_all_min": 1024,
"prefill_pipe": 0,
"engine": "0.1.45"
},
"vram_after": {
"elastic": false
}
},
"results": {
"chat": {
"requests": [
{
"ok": true,
"err": null,
"ttft_s": 0.469,
"total_s": 1.619,
"prompt_tokens": 51,
"reused_tokens": 0,
"read_tokens": 51,
"generated_tokens": 100,
"prompt_tps": 112.2,
"prompt_tps_source": "engine",
"decode_tps": 86.1,
"decode_tps_source": "engine",
"prompt_ms": 454.5,
"decode_ms": 1160.8,
"drafts_offered": 86,
"drafts_accepted": 72,
"run": 0,
"prompt": 0
},
{
"ok": true,
"err": null,
"ttft_s": 0.439,
"total_s": 1.785,
"prompt_tokens": 43,
"reused_tokens": 0,
"read_tokens": 43,
"generated_tokens": 100,
"prompt_tps": 102.0,
"prompt_tps_source": "engine",
"decode_tps": 73.6,
"decode_tps_source": "engine",
"prompt_ms": 421.5,
"decode_ms": 1358.7,
"drafts_offered": 96,
"drafts_accepted": 54,
"run": 0,
"prompt": 1
},
{
"ok": true,
"err": null,
"ttft_s": 0.452,
"total_s": 1.82,
"prompt_tokens": 46,
"reused_tokens": 0,
"read_tokens": 46,
"generated_tokens": 100,
"prompt_tps": 105.5,
"prompt_tps_source": "engine",
"decode_tps": 72.5,
"decode_tps_source": "engine",
"prompt_ms": 436.2,
"decode_ms": 1378.8,
"drafts_offered": 99,
"drafts_accepted": 53,
"run": 0,
"prompt": 2
},
{
"ok": true,
"err": null,
"ttft_s": 0.406,
"total_s": 1.348,
"prompt_tokens": 51,
"reused_tokens": 0,
"read_tokens": 51,
"generated_tokens": 100,
"prompt_tps": 130.3,
"prompt_tps_source": "engine",
"decode_tps": 105.0,
"decode_tps_source": "engine",
"prompt_ms": 391.4,
"decode_ms": 952.0,
"drafts_offered": 84,
"drafts_accepted": 70,
"run": 1,
"prompt": 0
},
{
"ok": true,
"err": null,
"ttft_s": 0.361,
"total_s": 1.506,
"prompt_tokens": 43,
"reused_tokens": 0,
"read_tokens": 43,
"generated_tokens": 100,
"prompt_tps": 124.5,
"prompt_tps_source": "engine",
"decode_tps": 86.4,
"decode_tps_source": "engine",
"prompt_ms": 345.4,
"decode_ms": 1157.2,
"drafts_offered": 106,
"drafts_accepted": 54,
"run": 1,
"prompt": 1
},
{
"ok": true,
"err": null,
"ttft_s": 0.401,
"total_s": 1.538,
"prompt_tokens": 46,
"reused_tokens": 0,
"read_tokens": 46,
"generated_tokens": 100,
"prompt_tps": 119.2,
"prompt_tps_source": "engine",
"decode_tps": 87.1,
"decode_tps_source": "engine",
"prompt_ms": 386.0,
"decode_ms": 1147.6,
"drafts_offered": 100,
"drafts_accepted": 54,
"run": 1,
"prompt": 2
},
{
"ok": true,
"err": null,
"ttft_s": 0.478,
"total_s": 1.401,
"prompt_tokens": 51,
"reused_tokens": 0,
"read_tokens": 51,
"generated_tokens": 100,
"prompt_tps": 110.6,
"prompt_tps_source": "engine",
"decode_tps": 107.0,
"decode_tps_source": "engine",
"prompt_ms": 461.2,
"decode_ms": 934.5,
"drafts_offered": 85,
"drafts_accepted": 71,
"run": 2,
"prompt": 0
},
{
"ok": true,
"err": null,
"ttft_s": 0.368,
"total_s": 1.435,
"prompt_tokens": 43,
"reused_tokens": 0,
"read_tokens": 43,
"generated_tokens": 100,
"prompt_tps": 122.1,
"prompt_tps_source": "engine",
"decode_tps": 92.8,
"decode_tps_source": "engine",
"prompt_ms": 352.2,
"decode_ms": 1077.7,
"drafts_offered": 110,
"drafts_accepted": 54,
"run": 2,
"prompt": 1
},
{
"ok": true,
"err": null,
"ttft_s": 0.364,
"total_s": 1.432,
"prompt_tokens": 46,
"reused_tokens": 0,
"read_tokens": 46,
"generated_tokens": 100,
"prompt_tps": 131.9,
"prompt_tps_source": "engine",
"decode_tps": 92.7,
"decode_tps_source": "engine",
"prompt_ms": 348.8,
"decode_ms": 1079.2,
"drafts_offered": 103,
"drafts_accepted": 53,
"run": 2,
"prompt": 2
}
],
"decode_tps": {
"median": 87.1,
"min": 72.5,
"max": 107.0,
"n": 9
},
"ttft_s": {
"median": 0.406,
"min": 0.361,
"max": 0.478,
"n": 9
},
"generated_tokens": {
"median": 100,
"min": 100,
"max": 100,
"n": 9
},
"prompt_tokens": {
"median": 46,
"min": 43,
"max": 51,
"n": 9
}
},
"prompts": {
"4K": {
"target_tokens": 4096,
"requests": [
{
"ok": true,
"err": null,
"ttft_s": 2.212,
"total_s": 2.574,
"prompt_tokens": 4019,
"reused_tokens": 0,
"read_tokens": 4019,
"generated_tokens": 24,
"prompt_tps": 1835.2,
"prompt_tps_source": "engine",
"decode_tps": 64.4,
"decode_tps_source": "engine",
"prompt_ms": 2190.0,
"decode_ms": 372.4,
"drafts_offered": 23,
"drafts_accepted": 14,
"run": 0
},
{
"ok": true,
"err": null,
"ttft_s": 2.113,
"total_s": 2.387,
"prompt_tokens": 4019,
"reused_tokens": 0,
"read_tokens": 4019,
"generated_tokens": 24,
"prompt_tps": 1923.9,
"prompt_tps_source": "engine",
"decode_tps": 84.6,
"decode_tps_source": "engine",
"prompt_ms": 2089.0,
"decode_ms": 283.8,
"drafts_offered": 26,
"drafts_accepted": 14,
"run": 1
},
{
"ok": true,
"err": null,
"ttft_s": 2.101,
"total_s": 2.357,
"prompt_tokens": 4019,
"reused_tokens": 0,
"read_tokens": 4019,
"generated_tokens": 24,
"prompt_tps": 1933.9,
"prompt_tps_source": "engine",
"decode_tps": 90.4,
"decode_tps_source": "engine",
"prompt_ms": 2078.2,
"decode_ms": 265.4,
"drafts_offered": 23,
"drafts_accepted": 14,
"run": 2
}
],
"prompt_tps": {
"median": 1923.9,
"min": 1835.2,
"max": 1933.9,
"n": 3
},
"ttft_s": {
"median": 2.113,
"min": 2.101,
"max": 2.212,
"n": 3
},
"prompt_tokens": {
"median": 4019,
"min": 4019,
"max": 4019,
"n": 3
},
"reused_tokens": {
"median": 0,
"min": 0,
"max": 0,
"n": 3
}
},
"16K": {
"target_tokens": 16384,
"requests": [
{
"ok": true,
"err": null,
"ttft_s": 6.934,
"total_s": 7.195,
"prompt_tokens": 16058,
"reused_tokens": 0,
"read_tokens": 16058,
"generated_tokens": 24,
"prompt_tps": 2326.5,
"prompt_tps_source": "engine",
"decode_tps": 88.3,
"decode_tps_source": "engine",
"prompt_ms": 6902.3,
"decode_ms": 271.7,
"drafts_offered": 20,
"drafts_accepted": 11,
"run": 0
},
{
"ok": true,
"err": null,
"ttft_s": 6.879,
"total_s": 7.113,
"prompt_tokens": 16058,
"reused_tokens": 0,
"read_tokens": 16058,
"generated_tokens": 24,
"prompt_tps": 2347.6,
"prompt_tps_source": "engine",
"decode_tps": 97.8,
"decode_tps_source": "engine",
"prompt_ms": 6840.2,
"decode_ms": 245.5,
"drafts_offered": 18,
"drafts_accepted": 11,
"run": 1
},
{
"ok": true,
"err": null,
"ttft_s": 6.895,
"total_s": 7.122,
"prompt_tokens": 16058,
"reused_tokens": 0,
"read_tokens": 16058,
"generated_tokens": 24,
"prompt_tps": 2342.1,
"prompt_tps_source": "engine",
"decode_tps": 100.8,
"decode_tps_source": "engine",
"prompt_ms": 6856.2,
"decode_ms": 238.1,
"drafts_offered": 20,
"drafts_accepted": 12,
"run": 2
}
],
"prompt_tps": {
"median": 2342.1,
"min": 2326.5,
"max": 2347.6,
"n": 3
},
"ttft_s": {
"median": 6.895,
"min": 6.879,
"max": 6.934,
"n": 3
},
"prompt_tokens": {
"median": 16058,
"min": 16058,
"max": 16058,
"n": 3
},
"reused_tokens": {
"median": 0,
"min": 0,
"max": 0,
"n": 3
}
},
"32K": {
"target_tokens": 32768,
"requests": [
{
"ok": true,
"err": null,
"ttft_s": 13.453,
"total_s": 13.826,
"prompt_tokens": 32049,
"reused_tokens": 0,
"read_tokens": 32049,
"generated_tokens": 24,
"prompt_tps": 2392.9,
"prompt_tps_source": "engine",
"decode_tps": 62.3,
"decode_tps_source": "engine",
"prompt_ms": 13393.1,
"decode_ms": 385.1,
"drafts_offered": 20,
"drafts_accepted": 11,
"run": 0
},
{
"ok": true,
"err": null,
"ttft_s": 13.472,
"total_s": 13.754,
"prompt_tokens": 32049,
"reused_tokens": 0,
"read_tokens": 32049,
"generated_tokens": 24,
"prompt_tps": 2388.9,
"prompt_tps_source": "engine",
"decode_tps": 81.7,
"decode_tps_source": "engine",
"prompt_ms": 13416.0,
"decode_ms": 293.6,
"drafts_offered": 17,
"drafts_accepted": 11,
"run": 1
},
{
"ok": true,
"err": null,
"ttft_s": 13.43,
"total_s": 13.663,
"prompt_tokens": 32049,
"reused_tokens": 0,
"read_tokens": 32049,
"generated_tokens": 24,
"prompt_tps": 2395.0,
"prompt_tps_source": "engine",
"decode_tps": 98.4,
"decode_tps_source": "engine",
"prompt_ms": 13381.9,
"decode_ms": 244.0,
"drafts_offered": 18,
"drafts_accepted": 12,
"run": 2
}
],
"prompt_tps": {
"median": 2392.9,
"min": 2388.9,
"max": 2395.0,
"n": 3
},
"ttft_s": {
"median": 13.453,
"min": 13.43,
"max": 13.472,
"n": 3
},
"prompt_tokens": {
"median": 32049,
"min": 32049,
"max": 32049,
"n": 3
},
"reused_tokens": {
"median": 0,
"min": 0,
"max": 0,
"n": 3
}
}
},
"agent": {
"sessions": [
[
{
"ok": true,
"err": null,
"ttft_s": 0.972,
"total_s": 1.19,
"prompt_tokens": 609,
"reused_tokens": 0,
"read_tokens": 609,
"generated_tokens": 13,
"prompt_tps": 640.6,
"prompt_tps_source": "engine",
"decode_tps": 56.2,
"decode_tps_source": "engine",
"prompt_ms": 950.7,
"decode_ms": 231.2,
"drafts_offered": 15,
"drafts_accepted": 9,
"run": 0,
"turn": 0
},
{
"ok": true,
"err": null,
"ttft_s": 2.167,
"total_s": 3.069,
"prompt_tokens": 4180,
"reused_tokens": 624,
"read_tokens": 3556,
"generated_tokens": 64,
"prompt_tps": 1664.6,
"prompt_tps_source": "engine",
"decode_tps": 70.0,
"decode_tps_source": "engine",
"prompt_ms": 2136.3,
"decode_ms": 914.4,
"drafts_offered": 53,
"drafts_accepted": 39,
"run": 0,
"turn": 1
},
{
"ok": true,
"err": null,
"ttft_s": 1.671,
"total_s": 2.482,
"prompt_tokens": 5841,
"reused_tokens": 4243,
"read_tokens": 1598,
"generated_tokens": 64,
"prompt_tps": 973.0,
"prompt_tps_source": "engine",
"decode_tps": 77.6,
"decode_tps_source": "engine",
"prompt_ms": 1642.3,
"decode_ms": 824.4,
"drafts_offered": 66,
"drafts_accepted": 38,
"run": 0,
"turn": 2
},
{
"ok": true,
"err": null,
"ttft_s": 2.261,
"total_s": 2.894,
"prompt_tokens": 9277,
"reused_tokens": 5904,
"read_tokens": 3373,
"generated_tokens": 55,
"prompt_tps": 1510.5,
"prompt_tps_source": "engine",
"decode_tps": 85.3,
"decode_tps_source": "engine",
"prompt_ms": 2233.1,
"decode_ms": 644.7,
"drafts_offered": 58,
"drafts_accepted": 33,
"run": 0,
"turn": 3
},
{
"ok": true,
"err": null,
"ttft_s": 2.003,
"total_s": 2.159,
"prompt_tokens": 12253,
"reused_tokens": 9331,
"read_tokens": 2922,
"generated_tokens": 16,
"prompt_tps": 1484.5,
"prompt_tps_source": "engine",
"decode_tps": 95.9,
"decode_tps_source": "engine",
"prompt_ms": 1968.4,
"decode_ms": 166.9,
"drafts_offered": 16,
"drafts_accepted": 9,
"run": 0,
"turn": 4
},
{
"ok": true,
"err": null,
"ttft_s": 2.004,
"total_s": 2.352,
"prompt_tokens": 15157,
"reused_tokens": 12268,
"read_tokens": 2889,
"generated_tokens": 32,
"prompt_tps": 1461.8,
"prompt_tps_source": "engine",
"decode_tps": 88.9,
"decode_tps_source": "engine",
"prompt_ms": 1976.3,
"decode_ms": 359.9,
"drafts_offered": 31,
"drafts_accepted": 19,
"run": 0,
"turn": 5
}
],
[
{
"ok": true,
"err": null,
"ttft_s": 1.011,
"total_s": 1.17,
"prompt_tokens": 609,
"reused_tokens": 0,
"read_tokens": 609,
"generated_tokens": 13,
"prompt_tps": 612.4,
"prompt_tps_source": "engine",
"decode_tps": 76.6,
"decode_tps_source": "engine",
"prompt_ms": 994.5,
"decode_ms": 169.7,
"drafts_offered": 18,
"drafts_accepted": 9,
"run": 1,
"turn": 0
},
{
"ok": true,
"err": null,
"ttft_s": 2.13,
"total_s": 2.645,
"prompt_tokens": 4180,
"reused_tokens": 624,
"read_tokens": 3556,
"generated_tokens": 64,
"prompt_tps": 1688.0,
"prompt_tps_source": "engine",
"decode_tps": 121.6,
"decode_tps_source": "engine",
"prompt_ms": 2106.6,
"decode_ms": 526.5,
"drafts_offered": 59,
"drafts_accepted": 44,
"run": 1,
"turn": 1
},
{
"ok": true,
"err": null,
"ttft_s": 1.641,
"total_s": 2.222,
"prompt_tokens": 5841,
"reused_tokens": 4244,
"read_tokens": 1597,
"generated_tokens": 64,
"prompt_tps": 986.8,
"prompt_tps_source": "engine",
"decode_tps": 108.0,
"decode_tps_source": "engine",
"prompt_ms": 1618.4,
"decode_ms": 592.8,
"drafts_offered": 63,
"drafts_accepted": 37,
"run": 1,
"turn": 2
},
{
"ok": true,
"err": null,
"ttft_s": 2.12,
"total_s": 2.596,
"prompt_tokens": 9277,
"reused_tokens": 5904,
"read_tokens": 3373,
"generated_tokens": 44,
"prompt_tps": 1607.7,
"prompt_tps_source": "engine",
"decode_tps": 90.4,
"decode_tps_source": "engine",
"prompt_ms": 2098.0,
"decode_ms": 486.9,
"drafts_offered": 50,
"drafts_accepted": 21,
"run": 1,
"turn": 3
},
{
"ok": true,
"err": null,
"ttft_s": 1.998,
"total_s": 2.34,
"prompt_tokens": 12242,
"reused_tokens": 9320,
"read_tokens": 2922,
"generated_tokens": 39,
"prompt_tps": 1483.1,
"prompt_tps_source": "engine",
"decode_tps": 110.6,
"decode_tps_source": "engine",
"prompt_ms": 1970.2,
"decode_ms": 352.7,
"drafts_offered": 38,
"drafts_accepted": 25,
"run": 1,
"turn": 4
},
{
"ok": true,
"err": null,
"ttft_s": 1.999,
"total_s": 2.22,
"prompt_tokens": 15169,
"reused_tokens": 12280,
"read_tokens": 2889,
"generated_tokens": 27,
"prompt_tps": 1466.4,
"prompt_tps_source": "engine",
"decode_tps": 116.6,
"decode_tps_source": "engine",
"prompt_ms": 1970.1,
"decode_ms": 231.6,
"drafts_offered": 24,
"drafts_accepted": 16,
"run": 1,
"turn": 5
}
],
[
{
"ok": true,
"err": null,
"ttft_s": 0.97,
"total_s": 1.091,
"prompt_tokens": 609,
"reused_tokens": 0,
"read_tokens": 609,
"generated_tokens": 13,
"prompt_tps": 639.2,
"prompt_tps_source": "engine",
"decode_tps": 98.9,
"decode_tps_source": "engine",
"prompt_ms": 952.8,
"decode_ms": 131.5,
"drafts_offered": 15,
"drafts_accepted": 10,
"run": 2,
"turn": 0
},
{
"ok": true,
"err": null,
"ttft_s": 2.155,
"total_s": 2.616,
"prompt_tokens": 4180,
"reused_tokens": 624,
"read_tokens": 3556,
"generated_tokens": 64,
"prompt_tps": 1668.4,
"prompt_tps_source": "engine",
"decode_tps": 135.6,
"decode_tps_source": "engine",
"prompt_ms": 2131.4,
"decode_ms": 471.9,
"drafts_offered": 54,
"drafts_accepted": 43,
"run": 2,
"turn": 1
},
{
"ok": true,
"err": null,
"ttft_s": 1.642,
"total_s": 2.184,
"prompt_tokens": 5841,
"reused_tokens": 4243,
"read_tokens": 1598,
"generated_tokens": 64,
"prompt_tps": 986.4,
"prompt_tps_source": "engine",
"decode_tps": 115.7,
"decode_tps_source": "engine",
"prompt_ms": 1620.1,
"decode_ms": 553.1,
"drafts_offered": 64,
"drafts_accepted": 41,
"run": 2,
"turn": 2
},
{
"ok": true,
"err": null,
"ttft_s": 2.169,
"total_s": 2.581,
"prompt_tokens": 9277,
"reused_tokens": 5834,
"read_tokens": 3443,
"generated_tokens": 47,
"prompt_tps": 1607.0,
"prompt_tps_source": "engine",
"decode_tps": 111.0,
"decode_tps_source": "engine",
"prompt_ms": 2142.5,
"decode_ms": 423.4,
"drafts_offered": 50,
"drafts_accepted": 28,
"run": 2,
"turn": 3
},
{
"ok": true,
"err": null,
"ttft_s": 1.966,
"total_s": 2.079,
"prompt_tokens": 12245,
"reused_tokens": 9323,
"read_tokens": 2922,
"generated_tokens": 16,
"prompt_tps": 1506.6,
"prompt_tps_source": "engine",
"decode_tps": 129.9,
"decode_tps_source": "engine",
"prompt_ms": 1939.5,
"decode_ms": 123.2,
"drafts_offered": 15,
"drafts_accepted": 10,
"run": 2,
"turn": 4
},
{
"ok": true,
"err": null,
"ttft_s": 1.996,
"total_s": 2.202,
"prompt_tokens": 15149,
"reused_tokens": 12260,
"read_tokens": 2889,
"generated_tokens": 26,
"prompt_tps": 1465.0,
"prompt_tps_source": "engine",
"decode_tps": 119.9,
"decode_tps_source": "engine",
"prompt_ms": 1972.0,
"decode_ms": 216.8,
"drafts_offered": 25,
"drafts_accepted": 16,
"run": 2,
"turn": 5
}
]
],
"hit_pct": {
"median": 69.303,
"min": 69.142,
"max": 69.306,
"n": 3
},
"reread_tokens": {
"median": 4,
"min": 3,
"max": 74,
"n": 3
},
"new_tokens": {
"median": 14334,
"min": 14334,
"max": 14334,
"n": 3
},
"turn_ttft_s": {
"median": 2.003,
"min": 1.641,
"max": 2.261,
"n": 15
},
"last_turn_prompt_tokens": {
"median": 15157,
"min": 15149,
"max": 15169,
"n": 3
},
"turn_decode_tps": {
"median": 110.6,
"min": 70.0,
"max": 135.6,
"n": 15
},
"first_turn_ttft_s": {
"median": 0.972,
"min": 0.97,
"max": 1.011,
"n": 3
}
},
"clients": {},
"skipped": {},
"failures": []
}
}
@@ -0,0 +1,5 @@
{
"complete": true,
"bench_seconds": 128.00078868865967,
"finished_utc": "2026-10-18T05:54:09Z"
}
@@ -0,0 +1,10 @@
{
"status": "ok",
"max_context": 65536,
"model": "qwen3.8-flash-next-iq3_xxs",
"images": false,
"api_key": false,
"image_generation": false,
"loaded": true,
"service": "strata"
}
@@ -0,0 +1,9 @@
{
"arm": "upstream-flash-next",
"engine_binary": "/opt/polystrata-v0.1.45-poly.1/build/strata",
"engine_sha256": "4e7254efedee4f6e898cec87e0da4f4e38c81be174553bfaf77536de720d0d37",
"fork_commit": "4c25aa6f6a99d6cb9f0a350bf1141865c158f593",
"nvidia_smi": "NVIDIA GeForce RTX 3090, 580.126.20, 24576 MiB",
"cpu_quota": "3112500/100000",
"started_utc": "2026-10-18T05:48:30Z"
}
@@ -0,0 +1,12 @@
[
"/opt/polystrata-v0.1.45-poly.1/.venv/bin/python",
"/opt/polystrata-v0.1.45-poly.1/serve/server.py",
"--engine",
"strata",
"--config",
"/opt/us2-results/step9/2026-10-17-rtx3090/upstream-flash-next/server.json",
"--host",
"127.0.0.1",
"--port",
"18080"
]
@@ -0,0 +1 @@
{"returncode": 0}
@@ -0,0 +1,44 @@
{
"exe": "/opt/polystrata-v0.1.45-poly.1/build/strata",
"cwd": "/opt/polystrata-v0.1.45-poly.1",
"tokenizer": "/opt/us2-models/pack-iq3-xxs/tokenizer",
"model_name": "qwen3.8-flash-next-iq3_xxs",
"log": "/opt/us2-results/step9/2026-10-17-rtx3090/upstream-flash-next/engine.log",
"args": [
"--pack",
"/opt/us2-models/pack-iq3-xxs",
"--native",
"/opt/us2-models/IQ3_XXS/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00001-of-00002.gguf",
"--ple-gguf",
"/opt/us2-models/IQ3_XXS/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00002-of-00002.gguf",
"--expert-profile",
"/opt/us2-models/pack-iq3-xxs/expert-profile.bin",
"--expert-cache",
"auto",
"--prefill",
"auto",
"--spec",
"4",
"--spec-min-p",
"0.5",
"--mtp",
"/opt/us2-models/mtp",
"--max-context",
"65536",
"--kv",
"int8",
"--ple-io",
"ram",
"--pool-workers",
"15",
"--kv-resident",
"32768"
],
"sampling": {
"temperature": 0.6,
"top_p": 0.95,
"top_k": 20,
"min_p": 0.0
},
"fit_max_tokens": true
}
@@ -0,0 +1,199 @@
{
"checks": {
"requests": 45,
"all_successful": true,
"skipped": {},
"failures": []
},
"sustained": {
"decode_tps": {
"median": 105.1,
"min": 92.9,
"max": 115.5,
"n": 9
},
"prompt_tps": {
"median": 1776.7,
"min": 1111.8,
"max": 1903.3,
"n": 9
},
"ttft_s": {
"median": 2.49,
"min": 1.52,
"max": 2.707,
"n": 9
},
"total_s": {
"median": 7.256,
"min": 5.941,
"max": 7.769,
"n": 9
},
"draft_acceptance_pct": 64.330900243309
},
"chat": {
"median": 87.1,
"min": 72.5,
"max": 107.0,
"n": 9
},
"chat_ttft_s": {
"median": 0.406,
"min": 0.361,
"max": 0.478,
"n": 9
},
"prefill": {
"4K": {
"median": 1923.9,
"min": 1835.2,
"max": 1933.9,
"n": 3
},
"16K": {
"median": 2342.1,
"min": 2326.5,
"max": 2347.6,
"n": 3
},
"32K": {
"median": 2392.9,
"min": 2388.9,
"max": 2395.0,
"n": 3
}
},
"prefill_ttft_s": {
"4K": {
"median": 2.113,
"min": 2.101,
"max": 2.212,
"n": 3
},
"16K": {
"median": 6.895,
"min": 6.879,
"max": 6.934,
"n": 3
},
"32K": {
"median": 13.453,
"min": 13.43,
"max": 13.472,
"n": 3
}
},
"agent": {
"turn_decode_tps": {
"median": 110.6,
"min": 70.0,
"max": 135.6,
"n": 15
},
"turn_ttft_s": {
"median": 2.003,
"min": 1.641,
"max": 2.261,
"n": 15
}
},
"per_document": {
"docs/DETAILS.md": {
"prompt_tokens": {
"median": 5048,
"min": 5048,
"max": 5048,
"n": 3
},
"decode_tps": {
"median": 102.8,
"min": 100.9,
"max": 111.7,
"n": 3
},
"prompt_tps": {
"median": 1898.8,
"min": 1891.0,
"max": 1903.3,
"n": 3
},
"ttft_s": {
"median": 2.685,
"min": 2.679,
"max": 2.707,
"n": 3
},
"total_s": {
"median": 7.647,
"min": 7.256,
"max": 7.769,
"n": 3
}
},
"docs/HOW_IT_WORKS.md": {
"prompt_tokens": {
"median": 1696,
"min": 1696,
"max": 1696,
"n": 3
},
"decode_tps": {
"median": 107.8,
"min": 92.9,
"max": 115.5,
"n": 3
},
"prompt_tps": {
"median": 1120.2,
"min": 1111.8,
"max": 1128.9,
"n": 3
},
"ttft_s": {
"median": 1.538,
"min": 1.52,
"max": 1.548,
"n": 3
},
"total_s": {
"median": 6.281,
"min": 5.941,
"max": 7.038,
"n": 3
}
},
"docs/INSTALL.md": {
"prompt_tokens": {
"median": 4370,
"min": 4370,
"max": 4370,
"n": 3
},
"decode_tps": {
"median": 105.1,
"min": 99.7,
"max": 107.7,
"n": 3
},
"prompt_tps": {
"median": 1776.7,
"min": 1773.6,
"max": 1801.2,
"n": 3
},
"ttft_s": {
"median": 2.49,
"min": 2.448,
"max": 2.501,
"n": 3
},
"total_s": {
"median": 7.308,
"min": 7.23,
"max": 7.618,
"n": 3
}
}
}
}
@@ -0,0 +1,506 @@
[
{
"run": 0,
"source": "docs/HOW_IT_WORKS.md",
"messages": [
{
"role": "user",
"content": "Run identifier 0-0. Read the following project documentation and write a detailed technical explanation of its design, tradeoffs, and how someone would use it in practice.\n\n# How does PolyStrata work?\n\nModels like Qwen3.8-Flash-Next normally run on servers with hundreds of gigabytes of graphics memory. Your graphics\ncard has 12-24 GB. PolyStrata makes it fit by **sharing the work across your whole PC** - the same idea as a kitchen, where\nthe things you use all the time stay on the counter and the rest waits in the pantry. Back to the\n[README](../README.md#how-does-it-work).\n\n## Who does what\n\n<p align=\"center\"><img src=\"media/how-it-works.svg\" width=\"860\" alt=\"The model's 24,576 experts: the busiest on the graphics card, all of them in RAM, a lookup table on the SSD\"></p>\n\n- **The model is a team of 24,576 small specialists (\"experts\"),** and each word it writes needs only 10 of them.\n So it doesn't have to have all of them on the graphics card at once.\n- **Your graphics card** does the part of the work needed for every word, and keeps the few thousand experts that\n are asked most often. It keeps learning which ones those are while you use it.\n- **Your RAM** holds every expert. When a word needs one the card doesn't have, **your processor** works on it -\n at the same time as the graphics card, so neither waits for the other.\n- **Your SSD** holds a big lookup table; the model only reads a few small rows of it per word.\n\nThe same in technical terms:\n\n- **GPU (VRAM):** attention and DeltaNet mixers, the gated-residual weights, routers, shared experts, output head, the\n MTP draft layer, the KV cache (from 64K: only its most-read part, the rest streams from RAM), and an **expert\n cache** that fills the rest of VRAM with the most-used experts (it adapts to the conversation while you chat).\n More VRAM matters more than a faster GPU: every extra GB holds ~700 more experts, and every expert on the GPU is one\n the CPU does not have to compute.\n- **RAM:** all 24,576 experts, pinned. The CPU computes the experts that are not on the GPU **in place**, at the same\n time as the GPU works on the cached ones (AVX-512 / AVX2 kernels, ggml's for the i-quants). On a PC with little RAM\n and a big card, the [low-RAM mode](MODELS.md#a-big-graphics-card-and-little-ram) keeps in RAM only what the GPU does\n not hold.\n- **SSD:** the 28.8 GB n-gram table, read a few rows per token through the OS cache.\n\nThis works the same on NVIDIA (CUDA) and AMD (HIP) cards: the same engine, compiled for each.\n\n## Guess, then check\n\n<p align=\"center\"><img src=\"media/guess-and-check.svg\" width=\"860\" alt=\"A small helper guesses the next words; the big model checks them all at once and keeps the right ones\"></p>\n\n- **Guess, then check.** A small, fast helper built into the model guesses the next few words, and the big model\n checks all the guesses in one go. It keeps the ones it agrees with and writes the next word itself - so one step\n often produces several words. The helper only guesses - the big model decides every word - so you get the same\n quality answer, 1.6-1.8x sooner.\n- In technical terms: the model's own MTP layer drafts up to 3 tokens; one pass over all 48 layers checks them, 2.4-3.2\n tokens per pass on average. When the reply repeats the context (code edits, quoted text), **prompt lookup** drafts\n up to 5 tokens from the earlier copy, but only where its measured acceptance and cost say it pays: code edits 6-11%\n faster, other text unchanged. The drafts are checked like the MTP's, so the output is the same.\n\n## Reading long texts\n\n**Long texts are read in big pieces** (up to 8,192 tokens - pieces of words - at a time), which is why a long\ndocument or code base is read at over 1,000 tokens per second. The experts of the next layer stream to the GPU over\nPCIe while the current layer's attention runs. After the first message, PolyStrata keeps the conversation and reads only\nwhat is new, so follow-ups start in seconds.\n\n## More\n\nThe [details](DETAILS.md#how-it-works) explain every part and its numbers, and the\n[paper](paper/Strata-Paper.pdf) tells the whole story, with the measurements behind it.\n\n## Credits\n\n- PolyStrata is built on [Strata](https://github.com/Niko1221/Strata) by Niko1221 and its contributors. The Qwen\n engine, the installer, the server and the web app are that project's work. PolyStrata adds the engine for GLM 5.3\n Flash ([GLM.md](GLM.md)), whose file is from\n [neuralll](https://huggingface.co/neuralll/GLM-5.3-Flash-GSQ-RCO-3.0bit-Q4Kattn-GGUF).\n- Model: [Qwen3.8-Flash-Next](https://huggingface.co/Qwen/Qwen3.8-Flash-Next) by the Qwen team; compressed versions by\n [ISTA-DASLab](https://huggingface.co/ISTA-DASLab/Qwen3.8-Flash-Next-GSQ-RCO-GGUF);\n [Swift 1.5](https://huggingface.co/ukisai/Swift-1.5-Qwen3.8-Flash-Next-GSQ-RCO-GGUF) by UkisAI; the experimental\n [UD-Q4_K_XL](https://huggingface.co/unsloth/Line truncated
}
],
"response": {
"first": 1.5376275349408388,
"total": 7.038452189415693,
"text": "# PolyStrata: Technical Design Analysis\n\n## Executive Summary\n\nPolyStrata is an inference engine designed to run massive Mixture-of-Experts (MoE) models\u2014specifically Qwen3.8-Flash-Next, which contains 24,576 experts\u2014on consumer hardware with limited VRAM (12\u201324 GB). It achieves this through a **hierarchical memory architecture** that distributes model components across GPU VRAM, system RAM, and SSD storage, combined with speculative decoding techniques to maximize throughput. The core insight is that MoE models only activate a small subset of experts per token, making it feasible to keep frequently-used experts on the GPU while streaming rarely-used ones from slower memory tiers.\n\n---\n\n## Core Architecture: Hierarchical Memory Distribution\n\n### The Problem Space\n\nQwen3.8-Flash-Next is an MoE model with 24,576 expert networks. Each token generation activates only ~10 experts out of these 24,576. However, the full model requires hundreds of gigabytes of memory if all experts were resident in VRAM simultaneously. Consumer GPUs offer 12\u201324 GB VRAM, creating a fundamental capacity mismatch.\n\n### The Solution: Three-Tier Memory Hierarchy\n\nPolyStrata implements a **stratified storage system** analogous to kitchen organization (counter = frequently used items, pantry = rarely accessed items):\n\n| Tier | Storage Medium | Contents | Access Pattern |\n|------|---------------|----------|----------------|\n| **L1 (Fastest)** | GPU VRAM | Attention/DeltaNet mixers, gated-residual weights, routers, shared experts, output head, MTP draft layer, KV cache (partial), adaptive expert cache | Random access, low latency |\n| **L2 (Medium)** | System RAM | All 24,576 experts (pinned memory) | CPU computation in parallel with GPU |\n| **L3 (Slowest)** | SSD/NVMe | 28.8 GB n-gram lookup table | Sequential/streaming reads via OS cache |\n\n### GPU VRAM Allocation Strategy\n\nThe GPU holds:\n1. **Fixed components**: Attention layers, DeltaNet mixers, gated-residual weights, routing networks, shared experts, output projection head, and the Multi-Token Prediction (MTP) draft layer. These are required for every token generation step.\n2. **Adaptive Expert Cache**: The remaining VR",
"usage": {
"prompt_tokens": 1696,
"completion_tokens": 512,
"total_tokens": 2208,
"prompt_tokens_details": {
"cached_tokens": 0
}
},
"timings": {
"cache_n": 0,
"prompt_n": 1696,
"prompt_ms": 1514.0,
"prompt_per_token_ms": 0.893,
"prompt_per_second": 1120.2,
"predicted_n": 512,
"predicted_ms": 5512.6,
"predicted_per_token_ms": 10.767,
"predicted_per_second": 92.9,
"draft_n": 473,
"draft_n_accepted": 304
},
"err": null,
"pieces": 495
},
"metrics": {
"ok": true,
"err": null,
"ttft_s": 1.538,
"total_s": 7.038,
"prompt_tokens": 1696,
"reused_tokens": 0,
"read_tokens": 1696,
"generated_tokens": 512,
"prompt_tps": 1120.2,
"prompt_tps_source": "engine",
"decode_tps": 92.9,
"decode_tps_source": "engine",
"prompt_ms": 1514.0,
"decode_ms": 5512.6,
"drafts_offered": 473,
"drafts_accepted": 304
}
},
{
"run": 0,
"source": "docs/INSTALL.md",
"messages": [
{
"role": "user",
"content": "Run identifier 0-1. Read the following project documentation and write a detailed technical explanation of its design, tradeoffs, and how someone would use it in practice.\n\n# Installing PolyStrata\n\nEverything about installing, starting, updating and configuring PolyStrata, on Windows and Linux, with an NVIDIA or an\nAMD graphics card. The short version is in the [README](../README.md#install); an AI coding assistant can do all of\nthis for you with [AI_SETUP.md](AI_SETUP.md).\n\n> **On this page:** [What you need](#what-you-need) \u00b7 [Windows](#windows) \u00b7 [Linux](#linux) \u00b7\n> [AMD cards](#amd-cards) \u00b7 [Several cards](#two-or-three-cards) \u00b7 [Docker](#docker-linux) \u00b7\n> [Older CPUs](#older-cpus-experimental) \u00b7 [Updating](#updating) \u00b7 [Where things are stored](#where-things-are-stored) \u00b7\n> [Setup's questions](#setups-questions) \u00b7 [Tuning](#tuning-for-your-pc) \u00b7 [All options](#options-without-questions)\n\n## What you need\n\nThis is for Qwen3.8-Flash-Next. GLM 5.3 Flash needs Linux, one NVIDIA card and far more RAM:\n[GLM.md](GLM.md#what-you-need). The three smaller models (Qwen3.6-35B-A3B, Ornith 1.5, Gemma 4 26B-A4B) need Linux\nor Windows, one NVIDIA card and less of everything: [BACKENDS.md](BACKENDS.md#install).\n\n| | |\n| --- | --- |\n| **GPU** | **NVIDIA** RTX 20, 30, 40 or 50 series, **12 GB VRAM or more** (8 GB runs, slowly). Measured on an RTX 5070 and an RTX 3090; RTX 20 (Turing, since 0.1.27) was tested by a contributor on an RTX 2070. **AMD** Radeon RX 7900 XT / XTX, RX 9070 / 9070 XT and Radeon AI PRO R9700 (validated), RX 7800 XT / 7700 XT and RX 9060 XT (validated by their owners), RX 6800 / 6900 series (community-reported), with 12 GB of VRAM or more. See [AMD cards](#amd-cards). |\n| **RAM** | Enough for the size you pick ([which model](MODELS.md#pick-by-ram)); **64 GB** runs every size. A big GPU makes up for less RAM - the [low-RAM mode](MODELS.md#a-big-graphics-card-and-little-ram). |\n| **CPU** | x86-64 with AVX2 (any Intel/AMD desktop CPU from the last ~8 years). AVX-512 (Ryzen 7000/9000) is a bit faster. Older CPUs without AVX2 are experimental and slow: [Older CPUs](#older-cpus-experimental). |\n| **Disk** | ~70-80 GB free for the model, ~6 GB for the MTP layer (+1 GB with images). **Q2_0 on an AVX-512 CPU** also writes a one-time ~40 GB copy of its experts for the fast CPU kernel. On Linux with an AMD card, ROCm takes ~10 GB more when setup installs it. An NVMe SSD is strongly recommended: it makes the first start much faster. |\n| **OS** | Windows 10/11, or Linux (Ubuntu 22.04/24.04 and Debian 12/13 get everything installed automatically). |\n| **Driver** | **NVIDIA:** a current driver, version 580 or newer ([nvidia.com/drivers](https://www.nvidia.com/drivers) or the NVIDIA App). **AMD:** on Linux the kernel's amdgpu driver (no ROCm install needed); on Windows a current AMD Software: Adrenalin Edition driver ([amd.com/support](https://www.amd.com/en/support)). |\n\nThe driver is the only thing you install yourself. Everything else - Python, the engine, the model - is set up for\nyou the first time: Python 3.12 if you have none (for your user account, no admin), a private Python environment in\n`.venv/`, the PolyStrata engine, the model and the MTP draft layer. On NVIDIA it uses the ready-made engine for RTX\n20/30/40/50 and NVIDIA's CUDA libraries from pip (~0.4 GB); if no ready-made engine fits your PC, it offers to install\nthe build tools (Visual Studio Build Tools + CUDA Toolkit on Windows, `build-essential` + CUDA on Ubuntu) and compiles\nthe engine for your GPU (asks first; 20-40 minutes once). More: [details](DETAILS.md#before-you-start).\n\n## Windows\n\n1. [Download this project](https://github.com/VecSzn/PolyStrata/archive/refs/heads/main.zip) and unzip it (or\n `git clone` it).\n2. Double-click **`START-HERE.bat`**.\n3. Answer a few questions - or just press Enter each time for the recommended choice ([the questions](#setups-questions)).\n\nThen it downloads everything (the model is ~70 GB, so the first time takes a while - you can stop and it picks up\nwhere it left off) and **starts the model**. Your browser opens the PolyStrata app at `http://127.0.0.1:8080`.\n\n> **While the model starts, your PC can be slow or stop responding for 1-3 minutes** (longest the first time): PolyStrata\n> loads 35-55 GB into your RAM and locks part of it for the graphics card. That's normal - wait, and don't close the\n> window. The window tells you what it is doing.\n\n**Next time**, just double-click `START-HERE.bat` again: it starts right away (30-90 s to load the model), nothing is\ndownloaded twice. Close its window to stop the model. `SETUP.bat` (the same as `START-HERE.bat --setup`) installs\nanother model or changes the settings. Starting PolyStrata from Task Scheduler at logon needs two task settings, or the\nstart is 24x slower: [Running it at startup](DETAILS.md#running-it-at-startup-task-scheduler).\n\Line truncated
}
],
"response": {
"first": 2.500667478889227,
"total": 7.618429932743311,
"text": "# PolyStrata: Technical Design, Tradeoffs, and Practical Usage Guide\n\n## 1. Executive Summary & Core Architecture\n\nPolyStrata is a specialized inference engine designed to run large language models (LLMs), specifically optimized for **Qwen3.8-Flash-Next** and related architectures, on consumer-grade hardware. Its primary architectural innovation lies in its hybrid memory management strategy: it aggressively offloads model weights (\"experts\") between system RAM and GPU VRAM, leveraging a custom engine that supports both NVIDIA (CUDA) and AMD (HIP/ROCm) backends.\n\nThe project distinguishes itself from standard inference stacks (like llama.cpp or vLLM) by focusing on **MoE (Mixture of Experts)** efficiency, multi-GPU pipeline parallelism, and a highly automated, user-friendly installation process that abstracts away complex dependency management.\n\n---\n\n## 2. Technical Design & Key Components\n\n### A. The Hybrid Memory Model (RAM + VRAM)\nPolyStrata\u2019s core design principle is the **dynamic splitting of model experts**.\n* **VRAM Priority:** The engine attempts to keep as many \"active\" experts in GPU VRAM as possible for fast inference.\n* **RAM Overflow:** Experts that do not fit in VRAM are stored in system RAM.\n* **Low-RAM Mode:** For systems with limited RAM but large GPUs, PolyStrata can map experts directly from disk/pack files into the OS file cache or GPU memory without fully loading them into physical RAM first. This is critical for running 70GB+ models on machines with <64GB RAM.\n* **Page-Locked Memory:** The engine uses pinned (page-locked) host memory to facilitate high-bandwidth transfers between CPU and GPU. This requires significant system resources and explains the \"1-3 minute freeze\" during startup as it locks tens of GBs of RAM.\n\n### B. Backend Abstraction: CUDA vs. HIP\nPolyStrata supports two distinct hardware paths with different tradeoffs:\n1. **NVIDIA (CUDA):**\n * Uses pre-compiled engines for RTX 20/30/40/50 series.\n * Supports advanced features like `--calibrate` (likely for quantization or memory tuning) and GPU-accelerated vision encoders.\n * Preferred for multi-GPU setups due to mature pipeline parallelism support.\n2. **AMD (HIP",
"usage": {
"prompt_tokens": 4370,
"completion_tokens": 512,
"total_tokens": 4882,
"prompt_tokens_details": {
"cached_tokens": 0
}
},
"timings": {
"cache_n": 0,
"prompt_n": 4370,
"prompt_ms": 2459.6,
"prompt_per_token_ms": 0.563,
"prompt_per_second": 1776.7,
"predicted_n": 512,
"predicted_ms": 5133.1,
"predicted_per_token_ms": 10.026,
"predicted_per_second": 99.7,
"draft_n": 447,
"draft_n_accepted": 285
},
"err": null,
"pieces": 494
},
"metrics": {
"ok": true,
"err": null,
"ttft_s": 2.501,
"total_s": 7.618,
"prompt_tokens": 4370,
"reused_tokens": 0,
"read_tokens": 4370,
"generated_tokens": 512,
"prompt_tps": 1776.7,
"prompt_tps_source": "engine",
"decode_tps": 99.7,
"decode_tps_source": "engine",
"prompt_ms": 2459.6,
"decode_ms": 5133.1,
"drafts_offered": 447,
"drafts_accepted": 285
}
},
{
"run": 0,
"source": "docs/DETAILS.md",
"messages": [
{
"role": "user",
"content": "Run identifier 0-2. Read the following project documentation and write a detailed technical explanation of its design, tradeoffs, and how someone would use it in practice.\n\n# PolyStrata - the details\n\nThe technical side of PolyStrata: every measured number, the API, images, all settings and how the engine works.\nNew here? Start with the [README](../README.md); installing step by step is in [INSTALL.md](INSTALL.md), the models in\n[MODELS.md](MODELS.md), common problems in [TROUBLESHOOTING.md](TROUBLESHOOTING.md).\n\n> **On this page:** [Speed](#speed-measured) \u00b7 [Other GPUs](#other-gpus-estimated) \u00b7 [Which model?](#which-model) \u00b7\n> [Requirements](#before-you-start) \u00b7 [Windows](#windows) \u00b7 [Linux](#linux) \u00b7 [API](#using-it) \u00b7\n> [MCP tools](#tools-from-mcp-servers) \u00b7 [MCP server](#manage-strata-from-your-ai-assistant-mcp-server) \u00b7\n> [Images](#images-vision) \u00b7\n> [Troubleshooting](#troubleshooting) \u00b7 [How it works](#how-it-works)\n\n---\n\n## Speed (measured)\n\nRTX 5070 **12 GB**, Ryzen 5 7600 (6 cores), 64 GB DDR5-5200, Windows, engine 0.1.26 with the settings setup writes\n(`--prefill auto`, 8-bit KV above 4K, KV streaming from 64K). One code-agent prompt per length, 256 generated tokens,\nMTP speculative decoding on. \"262K\" is the model's full context window (a 259,943-token prompt). The IQ2_XS row was\nmeasured with Swift 1.5's IQ2_XS, which runs at the original's speed.\n\n**Engine 0.1.36 (#136), the same PC:** Q2_0's prompt experts run on fused int8 tensor-core kernels (RTX 30 and newer):\n4K 1,294 -> 1,570, 32K 2,170 -> 2,653, 128K 2,123 -> 2,468 tokens/s (+16-22%), as close to an FP16 reference as the\nprevious kernels (closer at 32K: teacher-forced KL 0.009 vs 0.012). The decode path's block selection and greedy\nargmax run on thread-block clusters (RTX 50, sm_90+; other cards keep the previous kernels; the same tokens): Q2_0 output at 4K 89 -> 93.5, at 128K\n64.5 -> 76.4 tokens/s. `STRATA_PF_FUSED=0` keeps the previous prompt kernels (byte-identical answers to 0.1.35);\n`STRATA_PF_FUSED=1` also runs the native IQ packs' fused kernels (opt-in: IQ2_XS prompts +12% at 4K, +3% at 32K, the\nIQ3 packs about even; on HIP they run on gfx11 and on gfx1200 / gfx1201, see AMD_HIP.md); `STRATA_QSA_CLUSTER=0` / `STRATA_ARGMAX_MULTI=0` turn the decode kernels off. The tables\nbelow are 0.1.26's.\n\n### Prompt processing (tokens/s)\n\n| Model | 1K | 4K | 32K | 64K | 128K | 262K |\n| --- | ---: | ---: | ---: | ---: | ---: | ---: |\n| **Q2_0** | 536 | 1,299 | 2,171 | 2,126 | 2,107 | 1,304\u2020 |\n| **IQ2_XS** | 534 | 1,256 | 2,092 | 1,754 | 1,752 | 1,181*\u2020 |\n| **IQ3_XXS** | 482 | 1,007 | 1,745 | 1,609 | 1,602 | - |\n| **IQ3_S** | 427 | 913 | 1,624 | 1,640 | 1,443 | - |\n| **Coder** | 656 | 1,583 | 2,177 | 2,236 | 2,208 | 1,034** |\n| **IQ3_S** (AMD RX 7900 XTX, gfx1100) | 760 | 1,275 | 1,641 | 1,594 | 1,494 | - |\n\nEngine 0.1.26; `bench/results/2026-09-29-speed-0126`. The AMD RX 7900 XTX row: engine 0.1.38 on a ROCm\n10.2 nightly with a tuned gfx1100 hipBLASLt-100500 table (upstream as [#755](https://github.com/Niko1221/Strata/pull/755)),\nthe median of 3 clean cells per tier\n(Ryzen 9 7900X, 96 GB; 1K-128K one-shot runs, 256 generated tokens,\ngreedy). At 32K-128K that is 8-28% faster than 0.1.22. \u2020 not measured\nagain: 0.1.22. \\* measured with images on (the image encoder's VRAM reserve leaves fewer experts cached). \\*\\* not\nmeasured again: 0.1.14.\n\n### Output (tokens/s)\n\n| Model | 1K | 4K | 32K | 64K | 128K | 262K |\n| --- | ---: | ---: | ---: | ---: | ---: | ---: |\n| **Q2_0** | 87.3 | 93.0 | 81.8 | 76.2 | 73.7 | 60.3\u2020 |\n| **IQ2_XS** | 79.6 | 78.6 | 76.3 | 63.7 | 62.7 | 52.8\u2020 |\n| **IQ3_XXS** | 61.9 | 61.6 | 58.5 | 57.2 | 49.0 | - |\n| **IQ3_S** | 52.4 | 53.3 | 48.3 | 46.3 | 45.5 | - |\n| **Coder** | 58.9 | 55.1 | 54.9 | 53.2 | 43.0 | 42.8\u2020 |\n| **IQ3_S** (AMD RX 7900 XTX, gfx1100) | 65.1 | 60.4 | 64.4 | 61.8 | 59.2 | - |\n\nEngine 0.1.26, the same runs. The AMD RX 7900 XTX row: engine 0.1.38 on a ROCm 10.2 nightly (tuned\ngfx1100 hipBLASLt-100500 table, upstream as [#755](https://github.com/Niko1221/Strata/pull/755)), median of 3 clean cells per tier (same box; decode is flat in\ncontext - the GDN linear attention is O(1) per token; 1K/4K prefill ran slightly under the 0.1.31\npackaged-ROCm numbers, 32K-128K ahead). \u2020 not measured again: 0.1.14.\n\nOutput speed depends on the text as well: speculative decoding runs faster when more of the drafted tokens are\naccepted, so a different answer to the same prompt moves it by several percent. Run back to back on the 4K prompt,\n0.1.14 writes 88.5 tokens/s and 0.1.12 85.7. The numbers before 0.1.13 (prompts about half as fast):\n[`bench/results/2026-09-24-final`](../bench/results/2026-09-24-final/matrix.md); these:\n[`bench/results/2026-09-28-speed-0114`](../bench/results/2026-09-28-speed-0114/README.md).\n\nIQ3_XXS and IQ3_S at 262K are not measLine truncated
}
],
"response": {
"first": 2.706903165206313,
"total": 7.769424468278885,
"text": "# PolyStrata: Technical Design, Tradeoffs, and Practical Usage\n\nPolyStrata is a specialized inference engine designed to run large Mixture-of-Experts (MoE) models on consumer-grade hardware by aggressively optimizing memory bandwidth and compute efficiency. Its core innovation lies in how it manages the massive weight matrices of MoE models, splitting them between VRAM (GPU) and system RAM/CPU, while using advanced quantization and speculative decoding techniques to maintain high throughput.\n\n## 1. Core Architecture & How It Works\n\n### The MoE Bottleneck\nStandard MoE models (like Mixtral or DeepSeek) have billions of parameters, but only a small fraction is active per token. However, loading all experts into VRAM is impossible on consumer GPUs (e.g., 12GB RTX 5070). PolyStrata solves this by:\n1. **Expert Streaming:** Keeping the most frequently used \"experts\" in VRAM and streaming less-used ones from system RAM or disk.\n2. **Quantization:** Using highly compressed formats (IQ2_XS, IQ3_S, Q2_0) to reduce memory footprint without catastrophic quality loss.\n3. **Speculative Decoding (MTP):** Using a smaller \"draft\" model to predict multiple tokens ahead, which are then verified in parallel by the main MoE model. This hides latency and increases throughput.\n\n### Key Technical Components\n\n#### A. Memory Management: KV Cache & Expert Streaming\nPolyStrata introduces sophisticated memory tiering to fit large contexts on limited VRAM.\n\n* **KV Streaming (`--kv-streaming`):** For long contexts (>64K tokens), the engine keeps only a portion of the Key-Value (KV) cache in VRAM (`--kv-resident N`) and streams the rest from system RAM. This frees up VRAM for more experts.\n * *Tradeoff:* Slight latency increase due to PCIe transfers, but enables 128K\u2013262K context windows on 12GB cards.\n* **KV Quantization:**\n * **8-bit KV (Default):** Balanced precision and speed.\n * **4-bit KV (`--kv q4_0`):** Uses Hadamard rotation before quantization to preserve accuracy. Saves ~50% KV memory but increases perplexity by 8\u201312%. Useful for very long contexts where VRAM is tight.\n * ",
"usage": {
"prompt_tokens": 5048,
"completion_tokens": 512,
"total_tokens": 5560,
"prompt_tokens_details": {
"cached_tokens": 0
}
},
"timings": {
"cache_n": 0,
"prompt_n": 5048,
"prompt_ms": 2669.5,
"prompt_per_token_ms": 0.529,
"prompt_per_second": 1891.0,
"predicted_n": 512,
"predicted_ms": 5075.9,
"predicted_per_token_ms": 9.914,
"predicted_per_second": 100.9,
"draft_n": 465,
"draft_n_accepted": 283
},
"err": null,
"pieces": 496
},
"metrics": {
"ok": true,
"err": null,
"ttft_s": 2.707,
"total_s": 7.769,
"prompt_tokens": 5048,
"reused_tokens": 0,
"read_tokens": 5048,
"generated_tokens": 512,
"prompt_tps": 1891.0,
"prompt_tps_source": "engine",
"decode_tps": 100.9,
"decode_tps_source": "engine",
"prompt_ms": 2669.5,
"decode_ms": 5075.9,
"drafts_offered": 465,
"drafts_accepted": 283
}
},
{
"run": 1,
"source": "docs/HOW_IT_WORKS.md",
"messages": [
{
"role": "user",
"content": "Run identifier 1-0. Read the following project documentation and write a detailed technical explanation of its design, tradeoffs, and how someone would use it in practice.\n\n# How does PolyStrata work?\n\nModels like Qwen3.8-Flash-Next normally run on servers with hundreds of gigabytes of graphics memory. Your graphics\ncard has 12-24 GB. PolyStrata makes it fit by **sharing the work across your whole PC** - the same idea as a kitchen, where\nthe things you use all the time stay on the counter and the rest waits in the pantry. Back to the\n[README](../README.md#how-does-it-work).\n\n## Who does what\n\n<p align=\"center\"><img src=\"media/how-it-works.svg\" width=\"860\" alt=\"The model's 24,576 experts: the busiest on the graphics card, all of them in RAM, a lookup table on the SSD\"></p>\n\n- **The model is a team of 24,576 small specialists (\"experts\"),** and each word it writes needs only 10 of them.\n So it doesn't have to have all of them on the graphics card at once.\n- **Your graphics card** does the part of the work needed for every word, and keeps the few thousand experts that\n are asked most often. It keeps learning which ones those are while you use it.\n- **Your RAM** holds every expert. When a word needs one the card doesn't have, **your processor** works on it -\n at the same time as the graphics card, so neither waits for the other.\n- **Your SSD** holds a big lookup table; the model only reads a few small rows of it per word.\n\nThe same in technical terms:\n\n- **GPU (VRAM):** attention and DeltaNet mixers, the gated-residual weights, routers, shared experts, output head, the\n MTP draft layer, the KV cache (from 64K: only its most-read part, the rest streams from RAM), and an **expert\n cache** that fills the rest of VRAM with the most-used experts (it adapts to the conversation while you chat).\n More VRAM matters more than a faster GPU: every extra GB holds ~700 more experts, and every expert on the GPU is one\n the CPU does not have to compute.\n- **RAM:** all 24,576 experts, pinned. The CPU computes the experts that are not on the GPU **in place**, at the same\n time as the GPU works on the cached ones (AVX-512 / AVX2 kernels, ggml's for the i-quants). On a PC with little RAM\n and a big card, the [low-RAM mode](MODELS.md#a-big-graphics-card-and-little-ram) keeps in RAM only what the GPU does\n not hold.\n- **SSD:** the 28.8 GB n-gram table, read a few rows per token through the OS cache.\n\nThis works the same on NVIDIA (CUDA) and AMD (HIP) cards: the same engine, compiled for each.\n\n## Guess, then check\n\n<p align=\"center\"><img src=\"media/guess-and-check.svg\" width=\"860\" alt=\"A small helper guesses the next words; the big model checks them all at once and keeps the right ones\"></p>\n\n- **Guess, then check.** A small, fast helper built into the model guesses the next few words, and the big model\n checks all the guesses in one go. It keeps the ones it agrees with and writes the next word itself - so one step\n often produces several words. The helper only guesses - the big model decides every word - so you get the same\n quality answer, 1.6-1.8x sooner.\n- In technical terms: the model's own MTP layer drafts up to 3 tokens; one pass over all 48 layers checks them, 2.4-3.2\n tokens per pass on average. When the reply repeats the context (code edits, quoted text), **prompt lookup** drafts\n up to 5 tokens from the earlier copy, but only where its measured acceptance and cost say it pays: code edits 6-11%\n faster, other text unchanged. The drafts are checked like the MTP's, so the output is the same.\n\n## Reading long texts\n\n**Long texts are read in big pieces** (up to 8,192 tokens - pieces of words - at a time), which is why a long\ndocument or code base is read at over 1,000 tokens per second. The experts of the next layer stream to the GPU over\nPCIe while the current layer's attention runs. After the first message, PolyStrata keeps the conversation and reads only\nwhat is new, so follow-ups start in seconds.\n\n## More\n\nThe [details](DETAILS.md#how-it-works) explain every part and its numbers, and the\n[paper](paper/Strata-Paper.pdf) tells the whole story, with the measurements behind it.\n\n## Credits\n\n- PolyStrata is built on [Strata](https://github.com/Niko1221/Strata) by Niko1221 and its contributors. The Qwen\n engine, the installer, the server and the web app are that project's work. PolyStrata adds the engine for GLM 5.3\n Flash ([GLM.md](GLM.md)), whose file is from\n [neuralll](https://huggingface.co/neuralll/GLM-5.3-Flash-GSQ-RCO-3.0bit-Q4Kattn-GGUF).\n- Model: [Qwen3.8-Flash-Next](https://huggingface.co/Qwen/Qwen3.8-Flash-Next) by the Qwen team; compressed versions by\n [ISTA-DASLab](https://huggingface.co/ISTA-DASLab/Qwen3.8-Flash-Next-GSQ-RCO-GGUF);\n [Swift 1.5](https://huggingface.co/ukisai/Swift-1.5-Qwen3.8-Flash-Next-GSQ-RCO-GGUF) by UkisAI; the experimental\n [UD-Q4_K_XL](https://huggingface.co/unsloth/Line truncated
}
],
"response": {
"first": 1.5476723928004503,
"total": 6.280837122350931,
"text": "# PolyStrata: Technical Design Analysis\n\n## Executive Summary\n\nPolyStrata is an inference engine designed to run massive Mixture-of-Experts (MoE) models\u2014specifically Qwen3.8-Flash-Next with 24,576 experts\u2014on consumer hardware with limited VRAM (12\u201324 GB). It achieves this through a **hierarchical memory architecture** that distributes model components across GPU VRAM, system RAM, and SSD storage, combined with speculative decoding techniques to maximize throughput.\n\n---\n\n## Core Architecture: Hierarchical Memory Distribution\n\n### The Problem Space\n\nQwen3.8-Flash-Next is an MoE model where each token generation requires only ~10 of 24,576 experts. However, the full model requires hundreds of GBs of memory\u2014far exceeding consumer GPU VRAM. Traditional approaches either:\n1. Quantize aggressively (quality loss)\n2. Offload all experts to CPU/SSD (throughput collapse)\n3. Require datacenter-grade hardware\n\nPolyStrata solves this by **co-locating frequently-used experts on the GPU** while keeping rarely-used experts in RAM, with a lookup table on SSD for routing decisions.\n\n### Memory Tiering Strategy\n\n| Tier | Contents | Access Pattern | Rationale |\n|------|----------|----------------|-----------|\n| **GPU VRAM** | Attention/DeltaNet mixers, gated-residual weights, routers, shared experts, output head, MTP draft layer, KV cache (hot portion), expert cache | Random access, high bandwidth | Latency-critical operations; every GB holds ~700 experts |\n| **System RAM** | All 24,576 experts (pinned) | Sequential/random via PCIe | CPU computes uncached experts in parallel with GPU |\n| **SSD** | 28.8 GB n-gram lookup table | Few rows per token via OS cache | Routing decisions; amortized cost over long sequences |\n\n### Key Design Decisions\n\n1. **Expert Caching on GPU**: The engine maintains an adaptive expert cache that learns which experts are most frequently invoked during a conversation. This is not static\u2014it evolves as the user chats, ensuring hot experts remain in VRAM.\n\n2. **Parallel CPU/GPU Execution**: When a token requires an expert not cached on GPU, the CPU computes it using AVX-512/AVX2 kernels (or ggml",
"usage": {
"prompt_tokens": 1696,
"completion_tokens": 512,
"total_tokens": 2208,
"prompt_tokens_details": {
"cached_tokens": 0
}
},
"timings": {
"cache_n": 0,
"prompt_n": 1696,
"prompt_ms": 1525.4,
"prompt_per_token_ms": 0.899,
"prompt_per_second": 1111.8,
"predicted_n": 512,
"predicted_ms": 4747.6,
"predicted_per_token_ms": 9.273,
"predicted_per_second": 107.8,
"draft_n": 460,
"draft_n_accepted": 300
},
"err": null,
"pieces": 493
},
"metrics": {
"ok": true,
"err": null,
"ttft_s": 1.548,
"total_s": 6.281,
"prompt_tokens": 1696,
"reused_tokens": 0,
"read_tokens": 1696,
"generated_tokens": 512,
"prompt_tps": 1111.8,
"prompt_tps_source": "engine",
"decode_tps": 107.8,
"decode_tps_source": "engine",
"prompt_ms": 1525.4,
"decode_ms": 4747.6,
"drafts_offered": 460,
"drafts_accepted": 300
}
},
{
"run": 1,
"source": "docs/INSTALL.md",
"messages": [
{
"role": "user",
"content": "Run identifier 1-1. Read the following project documentation and write a detailed technical explanation of its design, tradeoffs, and how someone would use it in practice.\n\n# Installing PolyStrata\n\nEverything about installing, starting, updating and configuring PolyStrata, on Windows and Linux, with an NVIDIA or an\nAMD graphics card. The short version is in the [README](../README.md#install); an AI coding assistant can do all of\nthis for you with [AI_SETUP.md](AI_SETUP.md).\n\n> **On this page:** [What you need](#what-you-need) \u00b7 [Windows](#windows) \u00b7 [Linux](#linux) \u00b7\n> [AMD cards](#amd-cards) \u00b7 [Several cards](#two-or-three-cards) \u00b7 [Docker](#docker-linux) \u00b7\n> [Older CPUs](#older-cpus-experimental) \u00b7 [Updating](#updating) \u00b7 [Where things are stored](#where-things-are-stored) \u00b7\n> [Setup's questions](#setups-questions) \u00b7 [Tuning](#tuning-for-your-pc) \u00b7 [All options](#options-without-questions)\n\n## What you need\n\nThis is for Qwen3.8-Flash-Next. GLM 5.3 Flash needs Linux, one NVIDIA card and far more RAM:\n[GLM.md](GLM.md#what-you-need). The three smaller models (Qwen3.6-35B-A3B, Ornith 1.5, Gemma 4 26B-A4B) need Linux\nor Windows, one NVIDIA card and less of everything: [BACKENDS.md](BACKENDS.md#install).\n\n| | |\n| --- | --- |\n| **GPU** | **NVIDIA** RTX 20, 30, 40 or 50 series, **12 GB VRAM or more** (8 GB runs, slowly). Measured on an RTX 5070 and an RTX 3090; RTX 20 (Turing, since 0.1.27) was tested by a contributor on an RTX 2070. **AMD** Radeon RX 7900 XT / XTX, RX 9070 / 9070 XT and Radeon AI PRO R9700 (validated), RX 7800 XT / 7700 XT and RX 9060 XT (validated by their owners), RX 6800 / 6900 series (community-reported), with 12 GB of VRAM or more. See [AMD cards](#amd-cards). |\n| **RAM** | Enough for the size you pick ([which model](MODELS.md#pick-by-ram)); **64 GB** runs every size. A big GPU makes up for less RAM - the [low-RAM mode](MODELS.md#a-big-graphics-card-and-little-ram). |\n| **CPU** | x86-64 with AVX2 (any Intel/AMD desktop CPU from the last ~8 years). AVX-512 (Ryzen 7000/9000) is a bit faster. Older CPUs without AVX2 are experimental and slow: [Older CPUs](#older-cpus-experimental). |\n| **Disk** | ~70-80 GB free for the model, ~6 GB for the MTP layer (+1 GB with images). **Q2_0 on an AVX-512 CPU** also writes a one-time ~40 GB copy of its experts for the fast CPU kernel. On Linux with an AMD card, ROCm takes ~10 GB more when setup installs it. An NVMe SSD is strongly recommended: it makes the first start much faster. |\n| **OS** | Windows 10/11, or Linux (Ubuntu 22.04/24.04 and Debian 12/13 get everything installed automatically). |\n| **Driver** | **NVIDIA:** a current driver, version 580 or newer ([nvidia.com/drivers](https://www.nvidia.com/drivers) or the NVIDIA App). **AMD:** on Linux the kernel's amdgpu driver (no ROCm install needed); on Windows a current AMD Software: Adrenalin Edition driver ([amd.com/support](https://www.amd.com/en/support)). |\n\nThe driver is the only thing you install yourself. Everything else - Python, the engine, the model - is set up for\nyou the first time: Python 3.12 if you have none (for your user account, no admin), a private Python environment in\n`.venv/`, the PolyStrata engine, the model and the MTP draft layer. On NVIDIA it uses the ready-made engine for RTX\n20/30/40/50 and NVIDIA's CUDA libraries from pip (~0.4 GB); if no ready-made engine fits your PC, it offers to install\nthe build tools (Visual Studio Build Tools + CUDA Toolkit on Windows, `build-essential` + CUDA on Ubuntu) and compiles\nthe engine for your GPU (asks first; 20-40 minutes once). More: [details](DETAILS.md#before-you-start).\n\n## Windows\n\n1. [Download this project](https://github.com/VecSzn/PolyStrata/archive/refs/heads/main.zip) and unzip it (or\n `git clone` it).\n2. Double-click **`START-HERE.bat`**.\n3. Answer a few questions - or just press Enter each time for the recommended choice ([the questions](#setups-questions)).\n\nThen it downloads everything (the model is ~70 GB, so the first time takes a while - you can stop and it picks up\nwhere it left off) and **starts the model**. Your browser opens the PolyStrata app at `http://127.0.0.1:8080`.\n\n> **While the model starts, your PC can be slow or stop responding for 1-3 minutes** (longest the first time): PolyStrata\n> loads 35-55 GB into your RAM and locks part of it for the graphics card. That's normal - wait, and don't close the\n> window. The window tells you what it is doing.\n\n**Next time**, just double-click `START-HERE.bat` again: it starts right away (30-90 s to load the model), nothing is\ndownloaded twice. Close its window to stop the model. `SETUP.bat` (the same as `START-HERE.bat --setup`) installs\nanother model or changes the settings. Starting PolyStrata from Task Scheduler at logon needs two task settings, or the\nstart is 24x slower: [Running it at startup](DETAILS.md#running-it-at-startup-task-scheduler).\n\Line truncated
}
],
"response": {
"first": 2.4899533577263355,
"total": 7.229766728356481,
"text": "# PolyStrata: Technical Design, Tradeoffs, and Practical Usage Guide\n\n## 1. Executive Summary & Core Architecture\n\nPolyStrata is a specialized inference engine designed to run large language models (LLMs), specifically optimized for **Qwen3.8-Flash-Next** and related architectures, on consumer-grade hardware. Its primary architectural innovation lies in its hybrid execution strategy: it leverages **Multi-GPU layer splitting**, **CPU/GPU expert offloading**, and a custom **MTP (Multi-Token Prediction) draft layer** to maximize throughput and minimize latency.\n\nThe system is designed for accessibility, offering automated setup scripts (`START-HERE.bat` / `setup.sh`) that handle dependency management, model downloading, and engine compilation, while providing advanced tuning options for power users.\n\n---\n\n## 2. Technical Design & Key Components\n\n### A. Model Support & Quantization Strategy\nPolyStrata supports a hierarchy of models with varying resource requirements:\n* **Primary Target:** Qwen3.8-Flash-Next (requires ~70\u201380 GB disk, 64 GB RAM recommended).\n* **Secondary Targets:** GLM 5.3 Flash (Linux-only, high RAM), and smaller variants like Qwen3.6-35B-A3B, Ornith 1.5, and Gemma 4 26B-A4B.\n\n**Quantization & Storage:**\n* Models are stored in GGUF format.\n* **MTP Layer:** A separate ~6 GB draft layer is used for speculative decoding to accelerate token generation.\n* **Expert Caching:** For MoE (Mixture of Experts) models, PolyStrata caches \"experts\" on the GPU VRAM when possible. If VRAM is insufficient, it falls back to CPU RAM or disk streaming.\n* **AVX-512 Optimization:** On supported CPUs (Ryzen 7000/9000), a one-time ~40 GB copy of experts is written to disk for fast CPU kernel access in Q2_0 quantization modes.\n\n### B. Hardware Abstraction & Backend Selection\nPolyStrata abstracts hardware complexity through automatic backend detection:\n\n1. **NVIDIA (CUDA):**\n * Uses pre-compiled engines for RTX 20/30/40/50 series.\n * Falls back to local compilation using Visual Studio Build",
"usage": {
"prompt_tokens": 4370,
"completion_tokens": 512,
"total_tokens": 4882,
"prompt_tokens_details": {
"cached_tokens": 0
}
},
"timings": {
"cache_n": 0,
"prompt_n": 4370,
"prompt_ms": 2463.9,
"prompt_per_token_ms": 0.564,
"prompt_per_second": 1773.6,
"predicted_n": 512,
"predicted_ms": 4753.9,
"predicted_per_token_ms": 9.285,
"predicted_per_second": 107.7,
"draft_n": 462,
"draft_n_accepted": 303
},
"err": null,
"pieces": 493
},
"metrics": {
"ok": true,
"err": null,
"ttft_s": 2.49,
"total_s": 7.23,
"prompt_tokens": 4370,
"reused_tokens": 0,
"read_tokens": 4370,
"generated_tokens": 512,
"prompt_tps": 1773.6,
"prompt_tps_source": "engine",
"decode_tps": 107.7,
"decode_tps_source": "engine",
"prompt_ms": 2463.9,
"decode_ms": 4753.9,
"drafts_offered": 462,
"drafts_accepted": 303
}
},
{
"run": 1,
"source": "docs/DETAILS.md",
"messages": [
{
"role": "user",
"content": "Run identifier 1-2. Read the following project documentation and write a detailed technical explanation of its design, tradeoffs, and how someone would use it in practice.\n\n# PolyStrata - the details\n\nThe technical side of PolyStrata: every measured number, the API, images, all settings and how the engine works.\nNew here? Start with the [README](../README.md); installing step by step is in [INSTALL.md](INSTALL.md), the models in\n[MODELS.md](MODELS.md), common problems in [TROUBLESHOOTING.md](TROUBLESHOOTING.md).\n\n> **On this page:** [Speed](#speed-measured) \u00b7 [Other GPUs](#other-gpus-estimated) \u00b7 [Which model?](#which-model) \u00b7\n> [Requirements](#before-you-start) \u00b7 [Windows](#windows) \u00b7 [Linux](#linux) \u00b7 [API](#using-it) \u00b7\n> [MCP tools](#tools-from-mcp-servers) \u00b7 [MCP server](#manage-strata-from-your-ai-assistant-mcp-server) \u00b7\n> [Images](#images-vision) \u00b7\n> [Troubleshooting](#troubleshooting) \u00b7 [How it works](#how-it-works)\n\n---\n\n## Speed (measured)\n\nRTX 5070 **12 GB**, Ryzen 5 7600 (6 cores), 64 GB DDR5-5200, Windows, engine 0.1.26 with the settings setup writes\n(`--prefill auto`, 8-bit KV above 4K, KV streaming from 64K). One code-agent prompt per length, 256 generated tokens,\nMTP speculative decoding on. \"262K\" is the model's full context window (a 259,943-token prompt). The IQ2_XS row was\nmeasured with Swift 1.5's IQ2_XS, which runs at the original's speed.\n\n**Engine 0.1.36 (#136), the same PC:** Q2_0's prompt experts run on fused int8 tensor-core kernels (RTX 30 and newer):\n4K 1,294 -> 1,570, 32K 2,170 -> 2,653, 128K 2,123 -> 2,468 tokens/s (+16-22%), as close to an FP16 reference as the\nprevious kernels (closer at 32K: teacher-forced KL 0.009 vs 0.012). The decode path's block selection and greedy\nargmax run on thread-block clusters (RTX 50, sm_90+; other cards keep the previous kernels; the same tokens): Q2_0 output at 4K 89 -> 93.5, at 128K\n64.5 -> 76.4 tokens/s. `STRATA_PF_FUSED=0` keeps the previous prompt kernels (byte-identical answers to 0.1.35);\n`STRATA_PF_FUSED=1` also runs the native IQ packs' fused kernels (opt-in: IQ2_XS prompts +12% at 4K, +3% at 32K, the\nIQ3 packs about even; on HIP they run on gfx11 and on gfx1200 / gfx1201, see AMD_HIP.md); `STRATA_QSA_CLUSTER=0` / `STRATA_ARGMAX_MULTI=0` turn the decode kernels off. The tables\nbelow are 0.1.26's.\n\n### Prompt processing (tokens/s)\n\n| Model | 1K | 4K | 32K | 64K | 128K | 262K |\n| --- | ---: | ---: | ---: | ---: | ---: | ---: |\n| **Q2_0** | 536 | 1,299 | 2,171 | 2,126 | 2,107 | 1,304\u2020 |\n| **IQ2_XS** | 534 | 1,256 | 2,092 | 1,754 | 1,752 | 1,181*\u2020 |\n| **IQ3_XXS** | 482 | 1,007 | 1,745 | 1,609 | 1,602 | - |\n| **IQ3_S** | 427 | 913 | 1,624 | 1,640 | 1,443 | - |\n| **Coder** | 656 | 1,583 | 2,177 | 2,236 | 2,208 | 1,034** |\n| **IQ3_S** (AMD RX 7900 XTX, gfx1100) | 760 | 1,275 | 1,641 | 1,594 | 1,494 | - |\n\nEngine 0.1.26; `bench/results/2026-09-29-speed-0126`. The AMD RX 7900 XTX row: engine 0.1.38 on a ROCm\n10.2 nightly with a tuned gfx1100 hipBLASLt-100500 table (upstream as [#755](https://github.com/Niko1221/Strata/pull/755)),\nthe median of 3 clean cells per tier\n(Ryzen 9 7900X, 96 GB; 1K-128K one-shot runs, 256 generated tokens,\ngreedy). At 32K-128K that is 8-28% faster than 0.1.22. \u2020 not measured\nagain: 0.1.22. \\* measured with images on (the image encoder's VRAM reserve leaves fewer experts cached). \\*\\* not\nmeasured again: 0.1.14.\n\n### Output (tokens/s)\n\n| Model | 1K | 4K | 32K | 64K | 128K | 262K |\n| --- | ---: | ---: | ---: | ---: | ---: | ---: |\n| **Q2_0** | 87.3 | 93.0 | 81.8 | 76.2 | 73.7 | 60.3\u2020 |\n| **IQ2_XS** | 79.6 | 78.6 | 76.3 | 63.7 | 62.7 | 52.8\u2020 |\n| **IQ3_XXS** | 61.9 | 61.6 | 58.5 | 57.2 | 49.0 | - |\n| **IQ3_S** | 52.4 | 53.3 | 48.3 | 46.3 | 45.5 | - |\n| **Coder** | 58.9 | 55.1 | 54.9 | 53.2 | 43.0 | 42.8\u2020 |\n| **IQ3_S** (AMD RX 7900 XTX, gfx1100) | 65.1 | 60.4 | 64.4 | 61.8 | 59.2 | - |\n\nEngine 0.1.26, the same runs. The AMD RX 7900 XTX row: engine 0.1.38 on a ROCm 10.2 nightly (tuned\ngfx1100 hipBLASLt-100500 table, upstream as [#755](https://github.com/Niko1221/Strata/pull/755)), median of 3 clean cells per tier (same box; decode is flat in\ncontext - the GDN linear attention is O(1) per token; 1K/4K prefill ran slightly under the 0.1.31\npackaged-ROCm numbers, 32K-128K ahead). \u2020 not measured again: 0.1.14.\n\nOutput speed depends on the text as well: speculative decoding runs faster when more of the drafted tokens are\naccepted, so a different answer to the same prompt moves it by several percent. Run back to back on the 4K prompt,\n0.1.14 writes 88.5 tokens/s and 0.1.12 85.7. The numbers before 0.1.13 (prompts about half as fast):\n[`bench/results/2026-09-24-final`](../bench/results/2026-09-24-final/matrix.md); these:\n[`bench/results/2026-09-28-speed-0114`](../bench/results/2026-09-28-speed-0114/README.md).\n\nIQ3_XXS and IQ3_S at 262K are not measLine truncated
}
],
"response": {
"first": 2.679227100685239,
"total": 7.647430758923292,
"text": "# PolyStrata: Technical Design Analysis\n\n## Executive Summary\n\nPolyStrata is a high-performance inference engine for Mixture-of-Experts (MoE) Large Language Models, optimized for consumer-grade hardware (specifically NVIDIA RTX 30/50 series and AMD RDNA3/RDNA4 GPUs). Its core innovation lies in **hybrid memory management** that balances VRAM constraints with RAM/disk availability, combined with aggressive speculative decoding and fused kernel optimizations. The engine targets a specific niche: running large MoE models (like Qwen2-MoE or similar architectures) on single-GPU consumer setups by strategically offloading expert weights while maintaining high throughput through speculative execution and quantization-aware kernels.\n\n---\n\n## Core Architecture & Design Philosophy\n\n### 1. Hybrid Expert Memory Management\n\nThe fundamental challenge PolyStrata addresses is that MoE models have massive parameter counts (23\u201350 GB for experts alone) that exceed typical consumer VRAM (8\u201312 GB). The engine employs a **tiered memory hierarchy**:\n\n```\nVRAM (Fastest, Limited) \u2192 RAM (Medium, Larger) \u2192 Disk/MMap (Slowest, Largest)\n```\n\n**Key Mechanisms:**\n\n- **Expert Caching in VRAM:** Only the most frequently accessed experts reside in GPU memory. The engine dynamically swaps experts between RAM and VRAM based on access patterns (`--adapt-swaps`).\n- **KV Cache Streaming:** For contexts >64K tokens, the KV cache is stored primarily in system RAM, with only a resident window (default 32K cells) kept in VRAM (`--kv-resident 32768`). This frees VRAM for more expert slots.\n- **Low-RAM Mode:** When system RAM cannot hold all experts (~10 GB overhead), the engine maps experts directly from disk via memory-mapped files (`--mmap-experts`), relying on OS file caching.\n\n**Tradeoff:** This introduces latency variance. Expert swaps over PCIe incur bandwidth costs, but the engine mitigates this by:\n- Predictive prefetching of likely-needed experts\n- Keeping a \"hot set\" in VRAM based on recent access patterns\n- Using `--pcie-frac` to control what fraction of missed experts are computed on CPU vs. GPU\n\n### 2. Quantization-Aware Fused Kernels\n\nPolyStrata does not simply dequantize weights before computation. Instead, it implements **fused kernels**",
"usage": {
"prompt_tokens": 5048,
"completion_tokens": 512,
"total_tokens": 5560,
"prompt_tokens_details": {
"cached_tokens": 0
}
},
"timings": {
"cache_n": 0,
"prompt_n": 5048,
"prompt_ms": 2652.3,
"prompt_per_token_ms": 0.525,
"prompt_per_second": 1903.3,
"predicted_n": 512,
"predicted_ms": 4981.6,
"predicted_per_token_ms": 9.73,
"predicted_per_second": 102.8,
"draft_n": 443,
"draft_n_accepted": 270
},
"err": null,
"pieces": 493
},
"metrics": {
"ok": true,
"err": null,
"ttft_s": 2.679,
"total_s": 7.647,
"prompt_tokens": 5048,
"reused_tokens": 0,
"read_tokens": 5048,
"generated_tokens": 512,
"prompt_tps": 1903.3,
"prompt_tps_source": "engine",
"decode_tps": 102.8,
"decode_tps_source": "engine",
"prompt_ms": 2652.3,
"decode_ms": 4981.6,
"drafts_offered": 443,
"drafts_accepted": 270
}
},
{
"run": 2,
"source": "docs/HOW_IT_WORKS.md",
"messages": [
{
"role": "user",
"content": "Run identifier 2-0. Read the following project documentation and write a detailed technical explanation of its design, tradeoffs, and how someone would use it in practice.\n\n# How does PolyStrata work?\n\nModels like Qwen3.8-Flash-Next normally run on servers with hundreds of gigabytes of graphics memory. Your graphics\ncard has 12-24 GB. PolyStrata makes it fit by **sharing the work across your whole PC** - the same idea as a kitchen, where\nthe things you use all the time stay on the counter and the rest waits in the pantry. Back to the\n[README](../README.md#how-does-it-work).\n\n## Who does what\n\n<p align=\"center\"><img src=\"media/how-it-works.svg\" width=\"860\" alt=\"The model's 24,576 experts: the busiest on the graphics card, all of them in RAM, a lookup table on the SSD\"></p>\n\n- **The model is a team of 24,576 small specialists (\"experts\"),** and each word it writes needs only 10 of them.\n So it doesn't have to have all of them on the graphics card at once.\n- **Your graphics card** does the part of the work needed for every word, and keeps the few thousand experts that\n are asked most often. It keeps learning which ones those are while you use it.\n- **Your RAM** holds every expert. When a word needs one the card doesn't have, **your processor** works on it -\n at the same time as the graphics card, so neither waits for the other.\n- **Your SSD** holds a big lookup table; the model only reads a few small rows of it per word.\n\nThe same in technical terms:\n\n- **GPU (VRAM):** attention and DeltaNet mixers, the gated-residual weights, routers, shared experts, output head, the\n MTP draft layer, the KV cache (from 64K: only its most-read part, the rest streams from RAM), and an **expert\n cache** that fills the rest of VRAM with the most-used experts (it adapts to the conversation while you chat).\n More VRAM matters more than a faster GPU: every extra GB holds ~700 more experts, and every expert on the GPU is one\n the CPU does not have to compute.\n- **RAM:** all 24,576 experts, pinned. The CPU computes the experts that are not on the GPU **in place**, at the same\n time as the GPU works on the cached ones (AVX-512 / AVX2 kernels, ggml's for the i-quants). On a PC with little RAM\n and a big card, the [low-RAM mode](MODELS.md#a-big-graphics-card-and-little-ram) keeps in RAM only what the GPU does\n not hold.\n- **SSD:** the 28.8 GB n-gram table, read a few rows per token through the OS cache.\n\nThis works the same on NVIDIA (CUDA) and AMD (HIP) cards: the same engine, compiled for each.\n\n## Guess, then check\n\n<p align=\"center\"><img src=\"media/guess-and-check.svg\" width=\"860\" alt=\"A small helper guesses the next words; the big model checks them all at once and keeps the right ones\"></p>\n\n- **Guess, then check.** A small, fast helper built into the model guesses the next few words, and the big model\n checks all the guesses in one go. It keeps the ones it agrees with and writes the next word itself - so one step\n often produces several words. The helper only guesses - the big model decides every word - so you get the same\n quality answer, 1.6-1.8x sooner.\n- In technical terms: the model's own MTP layer drafts up to 3 tokens; one pass over all 48 layers checks them, 2.4-3.2\n tokens per pass on average. When the reply repeats the context (code edits, quoted text), **prompt lookup** drafts\n up to 5 tokens from the earlier copy, but only where its measured acceptance and cost say it pays: code edits 6-11%\n faster, other text unchanged. The drafts are checked like the MTP's, so the output is the same.\n\n## Reading long texts\n\n**Long texts are read in big pieces** (up to 8,192 tokens - pieces of words - at a time), which is why a long\ndocument or code base is read at over 1,000 tokens per second. The experts of the next layer stream to the GPU over\nPCIe while the current layer's attention runs. After the first message, PolyStrata keeps the conversation and reads only\nwhat is new, so follow-ups start in seconds.\n\n## More\n\nThe [details](DETAILS.md#how-it-works) explain every part and its numbers, and the\n[paper](paper/Strata-Paper.pdf) tells the whole story, with the measurements behind it.\n\n## Credits\n\n- PolyStrata is built on [Strata](https://github.com/Niko1221/Strata) by Niko1221 and its contributors. The Qwen\n engine, the installer, the server and the web app are that project's work. PolyStrata adds the engine for GLM 5.3\n Flash ([GLM.md](GLM.md)), whose file is from\n [neuralll](https://huggingface.co/neuralll/GLM-5.3-Flash-GSQ-RCO-3.0bit-Q4Kattn-GGUF).\n- Model: [Qwen3.8-Flash-Next](https://huggingface.co/Qwen/Qwen3.8-Flash-Next) by the Qwen team; compressed versions by\n [ISTA-DASLab](https://huggingface.co/ISTA-DASLab/Qwen3.8-Flash-Next-GSQ-RCO-GGUF);\n [Swift 1.5](https://huggingface.co/ukisai/Swift-1.5-Qwen3.8-Flash-Next-GSQ-RCO-GGUF) by UkisAI; the experimental\n [UD-Q4_K_XL](https://huggingface.co/unsloth/Line truncated
}
],
"response": {
"first": 1.5204182006418705,
"total": 5.941010043025017,
"text": "# PolyStrata: Technical Design Analysis\n\n## Executive Summary\n\nPolyStrata is a specialized inference engine designed to run massive Mixture-of-Experts (MoE) models\u2014specifically Qwen3.8-Flash-Next and GLM 5.3 Flash\u2014on consumer hardware with limited VRAM (12\u201324 GB). It achieves this through a hierarchical memory architecture that distributes model weights across GPU VRAM, system RAM, and SSD storage, combined with speculative decoding techniques to maximize throughput.\n\n---\n\n## Core Architecture: Hierarchical Memory Distribution\n\n### The Problem Space\n\nQwen3.8-Flash-Next contains **24,576 experts** (small specialized neural sub-networks). A standard MoE model requires all experts to be resident in memory simultaneously for inference. However, each token generation only activates **~10 experts** out of 24,576. This creates a fundamental mismatch: the model is enormous, but its active working set per token is tiny.\n\nPolyStrata exploits this sparsity by implementing a **three-tier memory hierarchy**:\n\n| Tier | Storage Medium | Contents | Access Pattern |\n|------|---------------|----------|----------------|\n| L1 | GPU VRAM (12\u201324 GB) | Attention/DeltaNet mixers, routers, shared experts, output head, MTP draft layer, KV cache (partial), **adaptive expert cache** | Hot path; lowest latency |\n| L2 | System RAM (pinned) | All 24,576 experts | Warm path; CPU computes uncached experts concurrently with GPU |\n| L3 | SSD (28.8 GB n-gram table) | Lookup tables for routing/context | Cold path; OS-cached, few rows read per token |\n\n### The \"Kitchen\" Analogy Explained\n\nThe documentation uses a kitchen metaphor: frequently used items stay on the counter (GPU), everything else waits in the pantry (RAM/SSD). Technically, this translates to:\n\n1. **Static components** (attention layers, routers, shared experts) are always on GPU because they participate in every token's computation.\n2. **Dynamic expert cache** fills remaining VRAM with the most frequently accessed experts. This cache is **adaptive**\u2014it learns which experts your specific conversation uses and promotes them to GPU residency over time.\n3. **Uncached experts** reside in pinned system RAM. When a token requires an expert not",
"usage": {
"prompt_tokens": 1696,
"completion_tokens": 512,
"total_tokens": 2208,
"prompt_tokens_details": {
"cached_tokens": 0
}
},
"timings": {
"cache_n": 0,
"prompt_n": 1696,
"prompt_ms": 1502.3,
"prompt_per_token_ms": 0.886,
"prompt_per_second": 1128.9,
"predicted_n": 512,
"predicted_ms": 4432.7,
"predicted_per_token_ms": 8.658,
"predicted_per_second": 115.5,
"draft_n": 441,
"draft_n_accepted": 310
},
"err": null,
"pieces": 495
},
"metrics": {
"ok": true,
"err": null,
"ttft_s": 1.52,
"total_s": 5.941,
"prompt_tokens": 1696,
"reused_tokens": 0,
"read_tokens": 1696,
"generated_tokens": 512,
"prompt_tps": 1128.9,
"prompt_tps_source": "engine",
"decode_tps": 115.5,
"decode_tps_source": "engine",
"prompt_ms": 1502.3,
"decode_ms": 4432.7,
"drafts_offered": 441,
"drafts_accepted": 310
}
},
{
"run": 2,
"source": "docs/INSTALL.md",
"messages": [
{
"role": "user",
"content": "Run identifier 2-1. Read the following project documentation and write a detailed technical explanation of its design, tradeoffs, and how someone would use it in practice.\n\n# Installing PolyStrata\n\nEverything about installing, starting, updating and configuring PolyStrata, on Windows and Linux, with an NVIDIA or an\nAMD graphics card. The short version is in the [README](../README.md#install); an AI coding assistant can do all of\nthis for you with [AI_SETUP.md](AI_SETUP.md).\n\n> **On this page:** [What you need](#what-you-need) \u00b7 [Windows](#windows) \u00b7 [Linux](#linux) \u00b7\n> [AMD cards](#amd-cards) \u00b7 [Several cards](#two-or-three-cards) \u00b7 [Docker](#docker-linux) \u00b7\n> [Older CPUs](#older-cpus-experimental) \u00b7 [Updating](#updating) \u00b7 [Where things are stored](#where-things-are-stored) \u00b7\n> [Setup's questions](#setups-questions) \u00b7 [Tuning](#tuning-for-your-pc) \u00b7 [All options](#options-without-questions)\n\n## What you need\n\nThis is for Qwen3.8-Flash-Next. GLM 5.3 Flash needs Linux, one NVIDIA card and far more RAM:\n[GLM.md](GLM.md#what-you-need). The three smaller models (Qwen3.6-35B-A3B, Ornith 1.5, Gemma 4 26B-A4B) need Linux\nor Windows, one NVIDIA card and less of everything: [BACKENDS.md](BACKENDS.md#install).\n\n| | |\n| --- | --- |\n| **GPU** | **NVIDIA** RTX 20, 30, 40 or 50 series, **12 GB VRAM or more** (8 GB runs, slowly). Measured on an RTX 5070 and an RTX 3090; RTX 20 (Turing, since 0.1.27) was tested by a contributor on an RTX 2070. **AMD** Radeon RX 7900 XT / XTX, RX 9070 / 9070 XT and Radeon AI PRO R9700 (validated), RX 7800 XT / 7700 XT and RX 9060 XT (validated by their owners), RX 6800 / 6900 series (community-reported), with 12 GB of VRAM or more. See [AMD cards](#amd-cards). |\n| **RAM** | Enough for the size you pick ([which model](MODELS.md#pick-by-ram)); **64 GB** runs every size. A big GPU makes up for less RAM - the [low-RAM mode](MODELS.md#a-big-graphics-card-and-little-ram). |\n| **CPU** | x86-64 with AVX2 (any Intel/AMD desktop CPU from the last ~8 years). AVX-512 (Ryzen 7000/9000) is a bit faster. Older CPUs without AVX2 are experimental and slow: [Older CPUs](#older-cpus-experimental). |\n| **Disk** | ~70-80 GB free for the model, ~6 GB for the MTP layer (+1 GB with images). **Q2_0 on an AVX-512 CPU** also writes a one-time ~40 GB copy of its experts for the fast CPU kernel. On Linux with an AMD card, ROCm takes ~10 GB more when setup installs it. An NVMe SSD is strongly recommended: it makes the first start much faster. |\n| **OS** | Windows 10/11, or Linux (Ubuntu 22.04/24.04 and Debian 12/13 get everything installed automatically). |\n| **Driver** | **NVIDIA:** a current driver, version 580 or newer ([nvidia.com/drivers](https://www.nvidia.com/drivers) or the NVIDIA App). **AMD:** on Linux the kernel's amdgpu driver (no ROCm install needed); on Windows a current AMD Software: Adrenalin Edition driver ([amd.com/support](https://www.amd.com/en/support)). |\n\nThe driver is the only thing you install yourself. Everything else - Python, the engine, the model - is set up for\nyou the first time: Python 3.12 if you have none (for your user account, no admin), a private Python environment in\n`.venv/`, the PolyStrata engine, the model and the MTP draft layer. On NVIDIA it uses the ready-made engine for RTX\n20/30/40/50 and NVIDIA's CUDA libraries from pip (~0.4 GB); if no ready-made engine fits your PC, it offers to install\nthe build tools (Visual Studio Build Tools + CUDA Toolkit on Windows, `build-essential` + CUDA on Ubuntu) and compiles\nthe engine for your GPU (asks first; 20-40 minutes once). More: [details](DETAILS.md#before-you-start).\n\n## Windows\n\n1. [Download this project](https://github.com/VecSzn/PolyStrata/archive/refs/heads/main.zip) and unzip it (or\n `git clone` it).\n2. Double-click **`START-HERE.bat`**.\n3. Answer a few questions - or just press Enter each time for the recommended choice ([the questions](#setups-questions)).\n\nThen it downloads everything (the model is ~70 GB, so the first time takes a while - you can stop and it picks up\nwhere it left off) and **starts the model**. Your browser opens the PolyStrata app at `http://127.0.0.1:8080`.\n\n> **While the model starts, your PC can be slow or stop responding for 1-3 minutes** (longest the first time): PolyStrata\n> loads 35-55 GB into your RAM and locks part of it for the graphics card. That's normal - wait, and don't close the\n> window. The window tells you what it is doing.\n\n**Next time**, just double-click `START-HERE.bat` again: it starts right away (30-90 s to load the model), nothing is\ndownloaded twice. Close its window to stop the model. `SETUP.bat` (the same as `START-HERE.bat --setup`) installs\nanother model or changes the settings. Starting PolyStrata from Task Scheduler at logon needs two task settings, or the\nstart is 24x slower: [Running it at startup](DETAILS.md#running-it-at-startup-task-scheduler).\n\Line truncated
}
],
"response": {
"first": 2.4482060223817825,
"total": 7.308285115286708,
"text": "# PolyStrata: Technical Design, Tradeoffs, and Practical Usage Guide\n\n## 1. Executive Summary & Core Philosophy\n\nPolyStrata is a specialized inference engine designed to run large language models (LLMs), specifically optimized for the **Qwen3.8-Flash-Next** family, on consumer-grade hardware. Its primary architectural goal is to maximize performance on systems with limited VRAM by leveraging advanced quantization techniques, multi-GPU layer splitting, and hybrid CPU/GPU execution strategies.\n\nThe project distinguishes itself from generic LLM runners (like standard `llama.cpp` or `vLLM`) through:\n1. **Aggressive Quantization Support:** Heavy reliance on i-quant models (IQ2_XS, IQ3_XXS, etc.) to fit massive parameter counts into consumer VRAM/RAM budgets.\n2. **Hardware-Agnostic Automation:** A setup process that automatically detects hardware capabilities (AVX2/512, GPU architecture) and compiles or downloads the appropriate engine binaries.\n3. **Hybrid Inference Pipeline:** Explicit support for splitting model layers across multiple GPUs and offloading \"expert\" weights to system RAM or disk when VRAM is insufficient.\n\n---\n\n## 2. System Requirements & Hardware Constraints\n\nPolyStrata\u2019s design imposes strict hardware requirements that dictate its performance envelope. Understanding these constraints is critical for practical deployment.\n\n### 2.1 GPU Requirements\n* **NVIDIA:** Requires RTX 20, 30, 40, or 50 series cards.\n * **Minimum VRAM:** 8 GB (slow), **Recommended:** 12 GB+.\n * **Driver:** Version 580+ required for CUDA 13.0 compatibility.\n* **AMD:** Requires Radeon RX 6800/6900, 7700/7800/7900 XT/XTX, or 9060/9070 series.\n * **Constraint:** Integrated Radeon GPUs are **not supported**.\n * **Driver:** Linux uses kernel `amdgpu` (no ROCm install needed for basic setup); Windows requires current Adrenalin drivers.\n\n### 2.2 CPU & RAM Requirements\n* **CPU Architecture:** x86-64 with **AVX2** instruction set support (Intel Haswell 20",
"usage": {
"prompt_tokens": 4370,
"completion_tokens": 512,
"total_tokens": 4882,
"prompt_tokens_details": {
"cached_tokens": 0
}
},
"timings": {
"cache_n": 0,
"prompt_n": 4370,
"prompt_ms": 2426.2,
"prompt_per_token_ms": 0.555,
"prompt_per_second": 1801.2,
"predicted_n": 512,
"predicted_ms": 4872.9,
"predicted_per_token_ms": 9.517,
"predicted_per_second": 105.1,
"draft_n": 484,
"draft_n_accepted": 295
},
"err": null,
"pieces": 494
},
"metrics": {
"ok": true,
"err": null,
"ttft_s": 2.448,
"total_s": 7.308,
"prompt_tokens": 4370,
"reused_tokens": 0,
"read_tokens": 4370,
"generated_tokens": 512,
"prompt_tps": 1801.2,
"prompt_tps_source": "engine",
"decode_tps": 105.1,
"decode_tps_source": "engine",
"prompt_ms": 2426.2,
"decode_ms": 4872.9,
"drafts_offered": 484,
"drafts_accepted": 295
}
},
{
"run": 2,
"source": "docs/DETAILS.md",
"messages": [
{
"role": "user",
"content": "Run identifier 2-2. Read the following project documentation and write a detailed technical explanation of its design, tradeoffs, and how someone would use it in practice.\n\n# PolyStrata - the details\n\nThe technical side of PolyStrata: every measured number, the API, images, all settings and how the engine works.\nNew here? Start with the [README](../README.md); installing step by step is in [INSTALL.md](INSTALL.md), the models in\n[MODELS.md](MODELS.md), common problems in [TROUBLESHOOTING.md](TROUBLESHOOTING.md).\n\n> **On this page:** [Speed](#speed-measured) \u00b7 [Other GPUs](#other-gpus-estimated) \u00b7 [Which model?](#which-model) \u00b7\n> [Requirements](#before-you-start) \u00b7 [Windows](#windows) \u00b7 [Linux](#linux) \u00b7 [API](#using-it) \u00b7\n> [MCP tools](#tools-from-mcp-servers) \u00b7 [MCP server](#manage-strata-from-your-ai-assistant-mcp-server) \u00b7\n> [Images](#images-vision) \u00b7\n> [Troubleshooting](#troubleshooting) \u00b7 [How it works](#how-it-works)\n\n---\n\n## Speed (measured)\n\nRTX 5070 **12 GB**, Ryzen 5 7600 (6 cores), 64 GB DDR5-5200, Windows, engine 0.1.26 with the settings setup writes\n(`--prefill auto`, 8-bit KV above 4K, KV streaming from 64K). One code-agent prompt per length, 256 generated tokens,\nMTP speculative decoding on. \"262K\" is the model's full context window (a 259,943-token prompt). The IQ2_XS row was\nmeasured with Swift 1.5's IQ2_XS, which runs at the original's speed.\n\n**Engine 0.1.36 (#136), the same PC:** Q2_0's prompt experts run on fused int8 tensor-core kernels (RTX 30 and newer):\n4K 1,294 -> 1,570, 32K 2,170 -> 2,653, 128K 2,123 -> 2,468 tokens/s (+16-22%), as close to an FP16 reference as the\nprevious kernels (closer at 32K: teacher-forced KL 0.009 vs 0.012). The decode path's block selection and greedy\nargmax run on thread-block clusters (RTX 50, sm_90+; other cards keep the previous kernels; the same tokens): Q2_0 output at 4K 89 -> 93.5, at 128K\n64.5 -> 76.4 tokens/s. `STRATA_PF_FUSED=0` keeps the previous prompt kernels (byte-identical answers to 0.1.35);\n`STRATA_PF_FUSED=1` also runs the native IQ packs' fused kernels (opt-in: IQ2_XS prompts +12% at 4K, +3% at 32K, the\nIQ3 packs about even; on HIP they run on gfx11 and on gfx1200 / gfx1201, see AMD_HIP.md); `STRATA_QSA_CLUSTER=0` / `STRATA_ARGMAX_MULTI=0` turn the decode kernels off. The tables\nbelow are 0.1.26's.\n\n### Prompt processing (tokens/s)\n\n| Model | 1K | 4K | 32K | 64K | 128K | 262K |\n| --- | ---: | ---: | ---: | ---: | ---: | ---: |\n| **Q2_0** | 536 | 1,299 | 2,171 | 2,126 | 2,107 | 1,304\u2020 |\n| **IQ2_XS** | 534 | 1,256 | 2,092 | 1,754 | 1,752 | 1,181*\u2020 |\n| **IQ3_XXS** | 482 | 1,007 | 1,745 | 1,609 | 1,602 | - |\n| **IQ3_S** | 427 | 913 | 1,624 | 1,640 | 1,443 | - |\n| **Coder** | 656 | 1,583 | 2,177 | 2,236 | 2,208 | 1,034** |\n| **IQ3_S** (AMD RX 7900 XTX, gfx1100) | 760 | 1,275 | 1,641 | 1,594 | 1,494 | - |\n\nEngine 0.1.26; `bench/results/2026-09-29-speed-0126`. The AMD RX 7900 XTX row: engine 0.1.38 on a ROCm\n10.2 nightly with a tuned gfx1100 hipBLASLt-100500 table (upstream as [#755](https://github.com/Niko1221/Strata/pull/755)),\nthe median of 3 clean cells per tier\n(Ryzen 9 7900X, 96 GB; 1K-128K one-shot runs, 256 generated tokens,\ngreedy). At 32K-128K that is 8-28% faster than 0.1.22. \u2020 not measured\nagain: 0.1.22. \\* measured with images on (the image encoder's VRAM reserve leaves fewer experts cached). \\*\\* not\nmeasured again: 0.1.14.\n\n### Output (tokens/s)\n\n| Model | 1K | 4K | 32K | 64K | 128K | 262K |\n| --- | ---: | ---: | ---: | ---: | ---: | ---: |\n| **Q2_0** | 87.3 | 93.0 | 81.8 | 76.2 | 73.7 | 60.3\u2020 |\n| **IQ2_XS** | 79.6 | 78.6 | 76.3 | 63.7 | 62.7 | 52.8\u2020 |\n| **IQ3_XXS** | 61.9 | 61.6 | 58.5 | 57.2 | 49.0 | - |\n| **IQ3_S** | 52.4 | 53.3 | 48.3 | 46.3 | 45.5 | - |\n| **Coder** | 58.9 | 55.1 | 54.9 | 53.2 | 43.0 | 42.8\u2020 |\n| **IQ3_S** (AMD RX 7900 XTX, gfx1100) | 65.1 | 60.4 | 64.4 | 61.8 | 59.2 | - |\n\nEngine 0.1.26, the same runs. The AMD RX 7900 XTX row: engine 0.1.38 on a ROCm 10.2 nightly (tuned\ngfx1100 hipBLASLt-100500 table, upstream as [#755](https://github.com/Niko1221/Strata/pull/755)), median of 3 clean cells per tier (same box; decode is flat in\ncontext - the GDN linear attention is O(1) per token; 1K/4K prefill ran slightly under the 0.1.31\npackaged-ROCm numbers, 32K-128K ahead). \u2020 not measured again: 0.1.14.\n\nOutput speed depends on the text as well: speculative decoding runs faster when more of the drafted tokens are\naccepted, so a different answer to the same prompt moves it by several percent. Run back to back on the 4K prompt,\n0.1.14 writes 88.5 tokens/s and 0.1.12 85.7. The numbers before 0.1.13 (prompts about half as fast):\n[`bench/results/2026-09-24-final`](../bench/results/2026-09-24-final/matrix.md); these:\n[`bench/results/2026-09-28-speed-0114`](../bench/results/2026-09-28-speed-0114/README.md).\n\nIQ3_XXS and IQ3_S at 262K are not measLine truncated
}
],
"response": {
"first": 2.685029035434127,
"total": 7.256418826058507,
"text": "# PolyStrata: Technical Design Analysis & Implementation Guide\n\n## 1. Executive Summary\n\n**PolyStrata** is a high-performance inference engine optimized for **Mixture-of-Experts (MoE)** Large Language Models (LLMs). Its core architectural innovation lies in its sophisticated management of the \"expert\" weights\u2014the specialized sub-networks within an MoE model\u2014balancing them across VRAM, system RAM, and disk to maximize throughput on consumer-grade hardware.\n\nThe engine distinguishes itself through:\n1. **Hybrid Memory Management:** Dynamic streaming of Key-Value (KV) caches and expert weights between VRAM and RAM/Disk.\n2. **Advanced Quantization & Kernels:** Utilizing fused INT8 tensor-core kernels, IQ quantization packs, and speculative decoding with coupled draft layers.\n3. **Context Efficiency:** Supporting massive context windows (up to 262K tokens) by offloading KV cache storage to system RAM while keeping active attention data in VRAM.\n\n---\n\n## 2. Core Architecture & How It Works\n\n### 2.1 The MoE Challenge\nIn standard dense models, all weights reside in VRAM. In MoE models (like Qwen or Mixtral), only a subset of \"experts\" is activated per token. However, the total weight size often exceeds consumer GPU VRAM (e.g., 12GB\u201324GB). PolyStrata solves this by:\n* **Expert Caching:** Keeping frequently used experts in VRAM.\n* **Streaming:** Moving less-used experts to System RAM or Disk (`mmap`).\n* **KV Cache Offloading:** Storing the KV cache (context memory) primarily in System RAM, streaming only the necessary slices into VRAM for attention calculations.\n\n### 2.2 Key Technical Components\n\n#### A. Expert Management & Streaming\n* **Standard Mode:** Experts are pinned to System RAM. The GPU maintains a \"hot\" cache of experts.\n* **Low-RAM Mode (`--mmap-experts`):** If system RAM is insufficient, experts are memory-mapped from disk (`experts.bin`). The OS file cache acts as the intermediate layer between disk and GPU.\n* **Adaptive Tiering:** The engine dynamically swaps experts between RAM and VRAM based on usage frequency (`--adapt-swaps`).\n\n#### B. KV Cache Optimization\nPolyStrata offers multiple strategies to handle long contexts:\n1.",
"usage": {
"prompt_tokens": 5048,
"completion_tokens": 512,
"total_tokens": 5560,
"prompt_tokens_details": {
"cached_tokens": 0
}
},
"timings": {
"cache_n": 0,
"prompt_n": 5048,
"prompt_ms": 2658.5,
"prompt_per_token_ms": 0.527,
"prompt_per_second": 1898.8,
"predicted_n": 512,
"predicted_ms": 4584.1,
"predicted_per_token_ms": 8.953,
"predicted_per_second": 111.7,
"draft_n": 435,
"draft_n_accepted": 294
},
"err": null,
"pieces": 491
},
"metrics": {
"ok": true,
"err": null,
"ttft_s": 2.685,
"total_s": 7.256,
"prompt_tokens": 5048,
"reused_tokens": 0,
"read_tokens": 5048,
"generated_tokens": 512,
"prompt_tps": 1898.8,
"prompt_tps_source": "engine",
"decode_tps": 111.7,
"decode_tps_source": "engine",
"prompt_ms": 2658.5,
"decode_ms": 4584.1,
"drafts_offered": 435,
"drafts_accepted": 294
}
}
]
@@ -0,0 +1,13 @@
[
"/opt/polystrata-v0.1.45-poly.1/.venv/bin/python",
"/opt/polystrata-v0.1.45-poly.1/tools/strata_bench.py",
"--url",
"http://127.0.0.1:18080",
"--config",
"/opt/us2-results/step9/2026-10-17-rtx3090/upstream-qwen36-q3km/server.json",
"--runs",
"3",
"--long",
"--out",
"/opt/us2-results/step9/2026-10-17-rtx3090/upstream-qwen36-q3km/community"
]
@@ -0,0 +1,64 @@
# Community benchmark on NVIDIA GeForce RTX 3090
Measured on 2026-10-18 with `tools/strata_bench.py` (suite 1, 3 runs per test, medians with ranges). Speeds are the engine's own timings; first-token times are measured by the client over HTTP. Speed only: no correctness check was run.
## Hardware and software
- GPU and VRAM: NVIDIA GeForce RTX 3090, 24 GiB VRAM
- CPU: AMD EPYC 7H12 64-Core Processor (128 cores, 256 threads); installed RAM: 1007.6 GiB; storage: not measured
- OS: Linux 6.8.0-107-generic; GPU driver: 580.126.20; CUDA: 13.0
- PolyStrata: project 0.1.45, commit d0cd84dc; engine 0.1.45
- Background workloads and power limits: not recorded
## Model and configuration
- Model and quantization: qwen3.6-35b-a3b-ud-q3_k_m
- Context: 32768 tokens; parallel slots: 1
- Settings: the install's own configuration, unchanged; thinking off for the suite; temperature 0
```text
strata-poly --model Qwen3.6-35B-A3B-UD-Q3_K_M.gguf --max-context 32768 --expert-profile expert-profile.txt --tail-skip 6
```
## Method
Run by `python tools/strata_bench.py --long` against the HTTP API of a PolyStrata server (already running); model loading is not timed. One warm-up chat and a 1K prompt are discarded first. Every prompt starts with a unique tag, so the conversation cache cannot help the fresh-prompt tests.
- short chat: the three questions of `tools/ab_engine.py`, up to 100 new tokens, 3 runs
- 4K / 16K prompts: generated word lists sized by a calibration request, 24 new tokens, 3 fresh prompts each
- agent session: system prompt and four tools, then 5 turns that each add about 1500 words of a project file and continue from the model's own earlier answers (the way agent clients resend a conversation), 64 new tokens per turn, 3 sessions; the cache numbers come from the answer's usage (`cached_tokens`) and timings (`prompt_n`)
- concurrency (when run): N requests sent at the same moment, total tokens over the wall time of the burst, latency over all requests
## Results
| Configuration | Actual prompt tokens | Reused tokens | Generated tokens | Runs | Prompt tok/s median and range | Decode tok/s median and range | TTFT seconds median and range |
| --- | ---: | ---: | ---: | ---: | --- | --- | --- |
| short chat | 46 (43-51) | 0 | 100 (100-100) | 9 | not measured | 220.8 (198.5-271.1) | 0.18 (0.17-0.18) |
| 4K prompt, fresh | 4019 (4019-4019) | 0 (0-0) | 24 cap | 3 | 3651.6 (3598.4-3655.0) | not measured | 1.11 (1.11-1.13) |
| 16K prompt, fresh | 16058 (16058-16058) | 0 (0-0) | 24 cap | 3 | 3569.7 (3567.6-3589.4) | not measured | 4.53 (4.50-4.53) |
| agent session, follow-up turns | 15129 (15125-15130) at the last turn | see below | up to 64 | 3 | see below | 194.0 (174.1-223.7) | 1.13 (0.56-1.28) |
Ranges are the lowest and highest of the runs; `Runs` counts requests that returned a token.
### Agent session (conversation cache)
Cache hit over the follow-up turns: 68.8 % (68.8-68.8); earlier-turn tokens read again per session: 241 (237-242) (earlier turns that the cache did not hold; the 14314 (14314-14314) new tokens of the files are read once); first turn (nothing cached) first token: 0.32 s (0.32-0.33).
| Turn (run 1) | Prompt tokens | Reused | Read | Prompt tok/s | First token (s) | Decode tok/s |
| ---: | ---: | ---: | ---: | ---: | ---: | ---: |
| 0 | 609 | 0 | 609 | 1955.1 | 0.32 | 240.8 |
| 1 | 4197 | 602 | 3595 | 3033.0 | 1.205 | 174.1 |
| 2 | 5829 | 4190 | 1639 | 2851.4 | 0.591 | 217.9 |
| 3 | 9247 | 5822 | 3425 | 2726.9 | 1.278 | 183.9 |
| 4 | 12201 | 9240 | 2961 | 2831.6 | 1.064 | 211.3 |
| 5 | 15130 | 12194 | 2936 | 2640.3 | 1.135 | 175.2 |
### Skipped and failed
- skipped 32K: the context is 32768 tokens
Per-request data: `results.json`. Engine log lines from the start: `engine-log-excerpt.txt` (when this run started the server).
## Correctness and limitations
Not measured: this is a speed suite. The conversation uses the model's own replies, so token counts differ a little between runs. Machine details come from the server, `nvidia-smi`/`rocm-smi` and the OS; background load and power limits are not recorded. Total time of the suite: 45 s.
@@ -0,0 +1,877 @@
{
"schema": 1,
"tool": "tools/strata_bench.py",
"date": "2026-10-18",
"params": {
"runs": 3,
"think": false,
"clients": 0,
"long": true,
"started_server": false,
"command": "python tools/strata_bench.py --long"
},
"elapsed_s": 45.43232297897339,
"machine": {
"gpu": [
"NVIDIA GeForce RTX 3090"
],
"gpu_vram_mib": 24576,
"gpu_driver": "580.126.20",
"cuda": "13.0",
"cpu": "AMD EPYC 7H12 64-Core Processor",
"cpu_cores": 128,
"cpu_threads": 256,
"ram_gib": 1007.6,
"os": "Linux 6.8.0-107-generic",
"python": "3.12.3",
"strata_version": "0.1.45",
"strata_commit": "d0cd84dc",
"engine_version": "0.1.45",
"model": "qwen3.6-35b-a3b-ud-q3_k_m",
"quant": "UD-Q3_K_M",
"context": 32768,
"parallel_slots": 1,
"config": {
"exe": "strata-poly",
"model_name": "qwen3.6-35b-a3b-ud-q3_k_m",
"args": [
"--model",
"Qwen3.6-35B-A3B-UD-Q3_K_M.gguf",
"--max-context",
"32768",
"--expert-profile",
"expert-profile.txt",
"--tail-skip",
"6"
],
"sampling": {
"temperature": 0.6,
"top_p": 0.95,
"top_k": 20,
"min_p": 0.0
}
},
"launch": "strata-poly --model Qwen3.6-35B-A3B-UD-Q3_K_M.gguf --max-context 32768 --expert-profile expert-profile.txt --tail-skip 6",
"engine_info": {
"model": "qwen3.6-35b-a3b-ud-q3_k_m",
"max_context": 32768,
"images": false,
"version": "0.1.45",
"context": 32768,
"expert_slots": 10496,
"expert_cache_mib": 14003,
"pool_workers": 31,
"conversation_cache_mib": 0,
"conversation_cache_slots": 4,
"conversation_cache_min_free_mib": 2560,
"vram_free_mib": 5913,
"vram_elastic": 1,
"batch_slots": 0,
"engine": "0.1.45"
},
"vram_after": {
"elastic": true
}
},
"results": {
"chat": {
"requests": [
{
"ok": true,
"err": null,
"ttft_s": 0.184,
"total_s": 0.617,
"prompt_tokens": 51,
"reused_tokens": 0,
"read_tokens": 51,
"generated_tokens": 100,
"prompt_tps": 282.4,
"prompt_tps_source": "engine",
"decode_tps": 230.9,
"decode_tps_source": "engine",
"prompt_ms": 180.6,
"decode_ms": 433.1,
"drafts_offered": 67,
"drafts_accepted": 57,
"run": 0,
"prompt": 0
},
{
"ok": true,
"err": null,
"ttft_s": 0.178,
"total_s": 0.644,
"prompt_tokens": 43,
"reused_tokens": 0,
"read_tokens": 43,
"generated_tokens": 100,
"prompt_tps": 247.8,
"prompt_tps_source": "engine",
"decode_tps": 214.4,
"decode_tps_source": "engine",
"prompt_ms": 173.5,
"decode_ms": 466.5,
"drafts_offered": 80,
"drafts_accepted": 59,
"run": 0,
"prompt": 1
},
{
"ok": true,
"err": null,
"ttft_s": 0.179,
"total_s": 0.632,
"prompt_tokens": 46,
"reused_tokens": 0,
"read_tokens": 46,
"generated_tokens": 100,
"prompt_tps": 268.1,
"prompt_tps_source": "engine",
"decode_tps": 220.8,
"decode_tps_source": "engine",
"prompt_ms": 171.6,
"decode_ms": 452.9,
"drafts_offered": 73,
"drafts_accepted": 59,
"run": 0,
"prompt": 2
},
{
"ok": true,
"err": null,
"ttft_s": 0.178,
"total_s": 0.547,
"prompt_tokens": 51,
"reused_tokens": 0,
"read_tokens": 51,
"generated_tokens": 100,
"prompt_tps": 293.9,
"prompt_tps_source": "engine",
"decode_tps": 271.1,
"decode_tps_source": "engine",
"prompt_ms": 173.5,
"decode_ms": 368.8,
"drafts_offered": 81,
"drafts_accepted": 72,
"run": 1,
"prompt": 0
},
{
"ok": true,
"err": null,
"ttft_s": 0.178,
"total_s": 0.634,
"prompt_tokens": 43,
"reused_tokens": 0,
"read_tokens": 43,
"generated_tokens": 100,
"prompt_tps": 246.1,
"prompt_tps_source": "engine",
"decode_tps": 219.5,
"decode_tps_source": "engine",
"prompt_ms": 174.7,
"decode_ms": 455.6,
"drafts_offered": 76,
"drafts_accepted": 58,
"run": 1,
"prompt": 1
},
{
"ok": true,
"err": null,
"ttft_s": 0.177,
"total_s": 0.633,
"prompt_tokens": 46,
"reused_tokens": 0,
"read_tokens": 46,
"generated_tokens": 100,
"prompt_tps": 268.4,
"prompt_tps_source": "engine",
"decode_tps": 218.4,
"decode_tps_source": "engine",
"prompt_ms": 171.4,
"decode_ms": 457.9,
"drafts_offered": 73,
"drafts_accepted": 56,
"run": 1,
"prompt": 2
},
{
"ok": true,
"err": null,
"ttft_s": 0.176,
"total_s": 0.554,
"prompt_tokens": 51,
"reused_tokens": 0,
"read_tokens": 51,
"generated_tokens": 100,
"prompt_tps": 296.2,
"prompt_tps_source": "engine",
"decode_tps": 264.8,
"decode_tps_source": "engine",
"prompt_ms": 172.2,
"decode_ms": 377.7,
"drafts_offered": 82,
"drafts_accepted": 71,
"run": 2,
"prompt": 0
},
{
"ok": true,
"err": null,
"ttft_s": 0.175,
"total_s": 0.679,
"prompt_tokens": 43,
"reused_tokens": 0,
"read_tokens": 43,
"generated_tokens": 100,
"prompt_tps": 251.3,
"prompt_tps_source": "engine",
"decode_tps": 198.5,
"decode_tps_source": "engine",
"prompt_ms": 171.1,
"decode_ms": 503.9,
"drafts_offered": 80,
"drafts_accepted": 54,
"run": 2,
"prompt": 1
},
{
"ok": true,
"err": null,
"ttft_s": 0.181,
"total_s": 0.63,
"prompt_tokens": 46,
"reused_tokens": 0,
"read_tokens": 46,
"generated_tokens": 100,
"prompt_tps": 262.1,
"prompt_tps_source": "engine",
"decode_tps": 222.0,
"decode_tps_source": "engine",
"prompt_ms": 175.5,
"decode_ms": 450.4,
"drafts_offered": 68,
"drafts_accepted": 56,
"run": 2,
"prompt": 2
}
],
"decode_tps": {
"median": 220.8,
"min": 198.5,
"max": 271.1,
"n": 9
},
"ttft_s": {
"median": 0.178,
"min": 0.175,
"max": 0.184,
"n": 9
},
"generated_tokens": {
"median": 100,
"min": 100,
"max": 100,
"n": 9
},
"prompt_tokens": {
"median": 46,
"min": 43,
"max": 51,
"n": 9
}
},
"prompts": {
"4K": {
"target_tokens": 4096,
"requests": [
{
"ok": true,
"err": null,
"ttft_s": 1.112,
"total_s": 1.258,
"prompt_tokens": 4019,
"reused_tokens": 0,
"read_tokens": 4019,
"generated_tokens": 24,
"prompt_tps": 3655.0,
"prompt_tps_source": "engine",
"decode_tps": 163.9,
"decode_tps_source": "engine",
"prompt_ms": 1099.6,
"decode_ms": 146.4,
"drafts_offered": 17,
"drafts_accepted": 13,
"run": 0
},
{
"ok": true,
"err": null,
"ttft_s": 1.127,
"total_s": 1.243,
"prompt_tokens": 4019,
"reused_tokens": 0,
"read_tokens": 4019,
"generated_tokens": 24,
"prompt_tps": 3598.4,
"prompt_tps_source": "engine",
"decode_tps": 206.0,
"decode_tps_source": "engine",
"prompt_ms": 1116.9,
"decode_ms": 116.5,
"drafts_offered": 16,
"drafts_accepted": 12,
"run": 1
},
{
"ok": true,
"err": null,
"ttft_s": 1.113,
"total_s": 1.243,
"prompt_tokens": 4019,
"reused_tokens": 0,
"read_tokens": 4019,
"generated_tokens": 24,
"prompt_tps": 3651.6,
"prompt_tps_source": "engine",
"decode_tps": 183.9,
"decode_tps_source": "engine",
"prompt_ms": 1100.6,
"decode_ms": 130.5,
"drafts_offered": 13,
"drafts_accepted": 9,
"run": 2
}
],
"prompt_tps": {
"median": 3651.6,
"min": 3598.4,
"max": 3655.0,
"n": 3
},
"ttft_s": {
"median": 1.113,
"min": 1.112,
"max": 1.127,
"n": 3
},
"prompt_tokens": {
"median": 4019,
"min": 4019,
"max": 4019,
"n": 3
},
"reused_tokens": {
"median": 0,
"min": 0,
"max": 0,
"n": 3
}
},
"16K": {
"target_tokens": 16384,
"requests": [
{
"ok": true,
"err": null,
"ttft_s": 4.497,
"total_s": 4.682,
"prompt_tokens": 16058,
"reused_tokens": 0,
"read_tokens": 16058,
"generated_tokens": 24,
"prompt_tps": 3589.4,
"prompt_tps_source": "engine",
"decode_tps": 128.2,
"decode_tps_source": "engine",
"prompt_ms": 4473.7,
"decode_ms": 187.2,
"drafts_offered": 20,
"drafts_accepted": 11,
"run": 0
},
{
"ok": true,
"err": null,
"ttft_s": 4.528,
"total_s": 4.666,
"prompt_tokens": 16058,
"reused_tokens": 0,
"read_tokens": 16058,
"generated_tokens": 24,
"prompt_tps": 3569.7,
"prompt_tps_source": "engine",
"decode_tps": 172.5,
"decode_tps_source": "engine",
"prompt_ms": 4498.4,
"decode_ms": 139.1,
"drafts_offered": 19,
"drafts_accepted": 13,
"run": 1
},
{
"ok": true,
"err": null,
"ttft_s": 4.531,
"total_s": 4.67,
"prompt_tokens": 16058,
"reused_tokens": 0,
"read_tokens": 16058,
"generated_tokens": 24,
"prompt_tps": 3567.6,
"prompt_tps_source": "engine",
"decode_tps": 171.2,
"decode_tps_source": "engine",
"prompt_ms": 4501.1,
"decode_ms": 140.2,
"drafts_offered": 16,
"drafts_accepted": 12,
"run": 2
}
],
"prompt_tps": {
"median": 3569.7,
"min": 3567.6,
"max": 3589.4,
"n": 3
},
"ttft_s": {
"median": 4.528,
"min": 4.497,
"max": 4.531,
"n": 3
},
"prompt_tokens": {
"median": 16058,
"min": 16058,
"max": 16058,
"n": 3
},
"reused_tokens": {
"median": 0,
"min": 0,
"max": 0,
"n": 3
}
}
},
"agent": {
"sessions": [
[
{
"ok": true,
"err": null,
"ttft_s": 0.32,
"total_s": 0.461,
"prompt_tokens": 609,
"reused_tokens": 0,
"read_tokens": 609,
"generated_tokens": 34,
"prompt_tps": 1955.1,
"prompt_tps_source": "engine",
"decode_tps": 240.8,
"decode_tps_source": "engine",
"prompt_ms": 311.5,
"decode_ms": 141.2,
"drafts_offered": 24,
"drafts_accepted": 20,
"run": 0,
"turn": 0
},
{
"ok": true,
"err": null,
"ttft_s": 1.205,
"total_s": 1.433,
"prompt_tokens": 4197,
"reused_tokens": 602,
"read_tokens": 3595,
"generated_tokens": 40,
"prompt_tps": 3033.0,
"prompt_tps_source": "engine",
"decode_tps": 174.1,
"decode_tps_source": "engine",
"prompt_ms": 1185.3,
"decode_ms": 229.7,
"drafts_offered": 28,
"drafts_accepted": 20,
"run": 0,
"turn": 1
},
{
"ok": true,
"err": null,
"ttft_s": 0.591,
"total_s": 0.825,
"prompt_tokens": 5829,
"reused_tokens": 4190,
"read_tokens": 1639,
"generated_tokens": 51,
"prompt_tps": 2851.4,
"prompt_tps_source": "engine",
"decode_tps": 217.9,
"decode_tps_source": "engine",
"prompt_ms": 574.8,
"decode_ms": 234.1,
"drafts_offered": 29,
"drafts_accepted": 27,
"run": 0,
"turn": 2
},
{
"ok": true,
"err": null,
"ttft_s": 1.278,
"total_s": 1.479,
"prompt_tokens": 9247,
"reused_tokens": 5822,
"read_tokens": 3425,
"generated_tokens": 37,
"prompt_tps": 2726.9,
"prompt_tps_source": "engine",
"decode_tps": 183.9,
"decode_tps_source": "engine",
"prompt_ms": 1256.0,
"decode_ms": 201.2,
"drafts_offered": 23,
"drafts_accepted": 17,
"run": 0,
"turn": 3
},
{
"ok": true,
"err": null,
"ttft_s": 1.064,
"total_s": 1.276,
"prompt_tokens": 12201,
"reused_tokens": 9240,
"read_tokens": 2961,
"generated_tokens": 45,
"prompt_tps": 2831.6,
"prompt_tps_source": "engine",
"decode_tps": 211.3,
"decode_tps_source": "engine",
"prompt_ms": 1045.7,
"decode_ms": 213.0,
"drafts_offered": 29,
"drafts_accepted": 27,
"run": 0,
"turn": 4
},
{
"ok": true,
"err": null,
"ttft_s": 1.135,
"total_s": 1.409,
"prompt_tokens": 15130,
"reused_tokens": 12194,
"read_tokens": 2936,
"generated_tokens": 48,
"prompt_tps": 2640.3,
"prompt_tps_source": "engine",
"decode_tps": 175.2,
"decode_tps_source": "engine",
"prompt_ms": 1112.0,
"decode_ms": 274.0,
"drafts_offered": 35,
"drafts_accepted": 25,
"run": 0,
"turn": 5
}
],
[
{
"ok": true,
"err": null,
"ttft_s": 0.321,
"total_s": 0.421,
"prompt_tokens": 609,
"reused_tokens": 0,
"read_tokens": 609,
"generated_tokens": 26,
"prompt_tps": 1926.0,
"prompt_tps_source": "engine",
"decode_tps": 260.8,
"decode_tps_source": "engine",
"prompt_ms": 316.2,
"decode_ms": 99.7,
"drafts_offered": 20,
"drafts_accepted": 17,
"run": 1,
"turn": 0
},
{
"ok": true,
"err": null,
"ttft_s": 1.145,
"total_s": 1.356,
"prompt_tokens": 4189,
"reused_tokens": 602,
"read_tokens": 3587,
"generated_tokens": 42,
"prompt_tps": 3169.0,
"prompt_tps_source": "engine",
"decode_tps": 198.9,
"decode_tps_source": "engine",
"prompt_ms": 1131.9,
"decode_ms": 211.2,
"drafts_offered": 35,
"drafts_accepted": 23,
"run": 1,
"turn": 1
},
{
"ok": true,
"err": null,
"ttft_s": 0.565,
"total_s": 0.832,
"prompt_tokens": 5823,
"reused_tokens": 4182,
"read_tokens": 1641,
"generated_tokens": 52,
"prompt_tps": 2969.6,
"prompt_tps_source": "engine",
"decode_tps": 194.0,
"decode_tps_source": "engine",
"prompt_ms": 552.6,
"decode_ms": 268.1,
"drafts_offered": 31,
"drafts_accepted": 24,
"run": 1,
"turn": 2
},
{
"ok": true,
"err": null,
"ttft_s": 1.238,
"total_s": 1.439,
"prompt_tokens": 9242,
"reused_tokens": 5816,
"read_tokens": 3426,
"generated_tokens": 37,
"prompt_tps": 2801.1,
"prompt_tps_source": "engine",
"decode_tps": 183.7,
"decode_tps_source": "engine",
"prompt_ms": 1223.1,
"decode_ms": 201.4,
"drafts_offered": 21,
"drafts_accepted": 16,
"run": 1,
"turn": 3
},
{
"ok": true,
"err": null,
"ttft_s": 1.05,
"total_s": 1.266,
"prompt_tokens": 12196,
"reused_tokens": 9235,
"read_tokens": 2961,
"generated_tokens": 45,
"prompt_tps": 2868.4,
"prompt_tps_source": "engine",
"decode_tps": 209.0,
"decode_tps_source": "engine",
"prompt_ms": 1032.3,
"decode_ms": 215.3,
"drafts_offered": 28,
"drafts_accepted": 26,
"run": 1,
"turn": 4
},
{
"ok": true,
"err": null,
"ttft_s": 1.127,
"total_s": 1.398,
"prompt_tokens": 15125,
"reused_tokens": 12189,
"read_tokens": 2936,
"generated_tokens": 48,
"prompt_tps": 2659.4,
"prompt_tps_source": "engine",
"decode_tps": 176.1,
"decode_tps_source": "engine",
"prompt_ms": 1104.0,
"decode_ms": 272.5,
"drafts_offered": 34,
"drafts_accepted": 25,
"run": 1,
"turn": 5
}
],
[
{
"ok": true,
"err": null,
"ttft_s": 0.33,
"total_s": 0.446,
"prompt_tokens": 609,
"reused_tokens": 0,
"read_tokens": 609,
"generated_tokens": 29,
"prompt_tps": 1877.9,
"prompt_tps_source": "engine",
"decode_tps": 248.3,
"decode_tps_source": "engine",
"prompt_ms": 324.3,
"decode_ms": 116.8,
"drafts_offered": 22,
"drafts_accepted": 18,
"run": 2,
"turn": 0
},
{
"ok": true,
"err": null,
"ttft_s": 1.146,
"total_s": 1.331,
"prompt_tokens": 4192,
"reused_tokens": 602,
"read_tokens": 3590,
"generated_tokens": 40,
"prompt_tps": 3164.1,
"prompt_tps_source": "engine",
"decode_tps": 214.8,
"decode_tps_source": "engine",
"prompt_ms": 1134.6,
"decode_ms": 186.2,
"drafts_offered": 30,
"drafts_accepted": 23,
"run": 2,
"turn": 1
},
{
"ok": true,
"err": null,
"ttft_s": 0.567,
"total_s": 0.813,
"prompt_tokens": 5824,
"reused_tokens": 4185,
"read_tokens": 1639,
"generated_tokens": 55,
"prompt_tps": 2944.7,
"prompt_tps_source": "engine",
"decode_tps": 223.7,
"decode_tps_source": "engine",
"prompt_ms": 556.6,
"decode_ms": 245.9,
"drafts_offered": 37,
"drafts_accepted": 33,
"run": 2,
"turn": 2
},
{
"ok": true,
"err": null,
"ttft_s": 1.258,
"total_s": 1.461,
"prompt_tokens": 9246,
"reused_tokens": 5817,
"read_tokens": 3429,
"generated_tokens": 37,
"prompt_tps": 2764.9,
"prompt_tps_source": "engine",
"decode_tps": 180.9,
"decode_tps_source": "engine",
"prompt_ms": 1240.2,
"decode_ms": 204.5,
"drafts_offered": 26,
"drafts_accepted": 18,
"run": 2,
"turn": 3
},
{
"ok": true,
"err": null,
"ttft_s": 1.053,
"total_s": 1.274,
"prompt_tokens": 12200,
"reused_tokens": 9239,
"read_tokens": 2961,
"generated_tokens": 45,
"prompt_tps": 2862.0,
"prompt_tps_source": "engine",
"decode_tps": 203.7,
"decode_tps_source": "engine",
"prompt_ms": 1034.6,
"decode_ms": 220.9,
"drafts_offered": 32,
"drafts_accepted": 27,
"run": 2,
"turn": 4
},
{
"ok": true,
"err": null,
"ttft_s": 1.122,
"total_s": 1.409,
"prompt_tokens": 15129,
"reused_tokens": 12193,
"read_tokens": 2936,
"generated_tokens": 51,
"prompt_tps": 2664.5,
"prompt_tps_source": "engine",
"decode_tps": 176.5,
"decode_tps_source": "engine",
"prompt_ms": 1101.9,
"decode_ms": 289.0,
"drafts_offered": 38,
"drafts_accepted": 27,
"run": 2,
"turn": 5
}
]
],
"hit_pct": {
"median": 68.76,
"min": 68.758,
"max": 68.767,
"n": 3
},
"reread_tokens": {
"median": 241,
"min": 237,
"max": 242,
"n": 3
},
"new_tokens": {
"median": 14314,
"min": 14314,
"max": 14314,
"n": 3
},
"turn_ttft_s": {
"median": 1.127,
"min": 0.565,
"max": 1.278,
"n": 15
},
"last_turn_prompt_tokens": {
"median": 15129,
"min": 15125,
"max": 15130,
"n": 3
},
"turn_decode_tps": {
"median": 194.0,
"min": 174.1,
"max": 223.7,
"n": 15
},
"first_turn_ttft_s": {
"median": 0.321,
"min": 0.32,
"max": 0.33,
"n": 3
}
},
"clients": {},
"skipped": {
"32K": "the context is 32768 tokens"
},
"failures": []
}
}
@@ -0,0 +1,5 @@
{
"complete": true,
"bench_seconds": 45.5882511138916,
"finished_utc": "2026-10-18T06:35:50Z"
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,10 @@
{
"status": "ok",
"max_context": 32768,
"model": "qwen3.6-35b-a3b-ud-q3_k_m",
"images": false,
"api_key": false,
"image_generation": false,
"loaded": true,
"service": "strata"
}
@@ -0,0 +1,9 @@
{
"arm": "upstream-qwen36-q3km",
"engine_binary": "/opt/polystrata-v0.1.45-poly.1/build/strata-poly",
"engine_sha256": "c893c1690e43b9be3a80c99316909f7a68f4e1db53ff232165e631ffc9ac648b",
"fork_commit": "143ada26fe968d27686cab50ad76c9c171eb748d",
"nvidia_smi": "NVIDIA GeForce RTX 3090, 580.126.20, 24576 MiB",
"cpu_quota": "3112500/100000",
"started_utc": "2026-10-18T06:34:20Z"
}
@@ -0,0 +1,12 @@
[
"/opt/polystrata-v0.1.45-poly.1/.venv/bin/python",
"/opt/polystrata-v0.1.45-poly.1/serve/server.py",
"--engine",
"strata",
"--config",
"/opt/us2-results/step9/2026-10-17-rtx3090/upstream-qwen36-q3km/server.json",
"--host",
"127.0.0.1",
"--port",
"18080"
]
@@ -0,0 +1 @@
{"returncode": 0}
@@ -0,0 +1,24 @@
{
"exe": "/opt/polystrata-v0.1.45-poly.1/build/strata-poly",
"cwd": "/opt/polystrata-v0.1.45-poly.1",
"tokenizer": "/opt/us2-models/qwen36-mtp/pack-q3km/tokenizer",
"model_name": "qwen3.6-35b-a3b-ud-q3_k_m",
"log": "/opt/us2-results/step9/2026-10-17-rtx3090/upstream-qwen36-q3km/engine.log",
"args": [
"--model",
"/opt/us2-models/qwen36-mtp/Qwen3.6-35B-A3B-UD-Q3_K_M.gguf",
"--max-context",
"32768",
"--expert-profile",
"/opt/us2-results/step9/2026-10-17-rtx3090/upstream-qwen36-q3km/expert-profile.txt",
"--tail-skip",
"6"
],
"sampling": {
"temperature": 0.6,
"top_p": 0.95,
"top_k": 20,
"min_p": 0.0
},
"fit_max_tokens": true
}
@@ -0,0 +1,189 @@
{
"checks": {
"requests": 42,
"all_successful": true,
"skipped": {
"32K": "the context is 32768 tokens"
},
"failures": []
},
"sustained": {
"decode_tps": {
"median": 207.6,
"min": 198.5,
"max": 225.7,
"n": 9
},
"prompt_tps": {
"median": 3381.8,
"min": 2980.7,
"max": 3525.6,
"n": 9
},
"ttft_s": {
"median": 1.305,
"min": 0.556,
"max": 1.48,
"n": 9
},
"total_s": {
"median": 3.771,
"min": 2.824,
"max": 4.024,
"n": 9
},
"draft_acceptance_pct": 80.37609948437974
},
"chat": {
"median": 220.8,
"min": 198.5,
"max": 271.1,
"n": 9
},
"chat_ttft_s": {
"median": 0.178,
"min": 0.175,
"max": 0.184,
"n": 9
},
"prefill": {
"4K": {
"median": 3651.6,
"min": 3598.4,
"max": 3655.0,
"n": 3
},
"16K": {
"median": 3569.7,
"min": 3567.6,
"max": 3589.4,
"n": 3
}
},
"prefill_ttft_s": {
"4K": {
"median": 1.113,
"min": 1.112,
"max": 1.127,
"n": 3
},
"16K": {
"median": 4.528,
"min": 4.497,
"max": 4.531,
"n": 3
}
},
"agent": {
"turn_decode_tps": {
"median": 194.0,
"min": 174.1,
"max": 223.7,
"n": 15
},
"turn_ttft_s": {
"median": 1.127,
"min": 0.565,
"max": 1.278,
"n": 15
}
},
"per_document": {
"docs/DETAILS.md": {
"prompt_tokens": {
"median": 5048,
"min": 5048,
"max": 5048,
"n": 3
},
"decode_tps": {
"median": 201.3,
"min": 198.5,
"max": 204.1,
"n": 3
},
"prompt_tps": {
"median": 3458.7,
"min": 3452.6,
"max": 3525.6,
"n": 3
},
"ttft_s": {
"median": 1.475,
"min": 1.447,
"max": 1.48,
"n": 3
},
"total_s": {
"median": 4.022,
"min": 3.982,
"max": 4.024,
"n": 3
}
},
"docs/HOW_IT_WORKS.md": {
"prompt_tokens": {
"median": 1696,
"min": 1696,
"max": 1696,
"n": 3
},
"decode_tps": {
"median": 221.8,
"min": 219.6,
"max": 225.7,
"n": 3
},
"prompt_tps": {
"median": 3068.0,
"min": 2980.7,
"max": 3106.8,
"n": 3
},
"ttft_s": {
"median": 0.559,
"min": 0.556,
"max": 0.577,
"n": 3
},
"total_s": {
"median": 2.885,
"min": 2.824,
"max": 2.891,
"n": 3
}
},
"docs/INSTALL.md": {
"prompt_tokens": {
"median": 4370,
"min": 4370,
"max": 4370,
"n": 3
},
"decode_tps": {
"median": 207.6,
"min": 205.6,
"max": 211.4,
"n": 3
},
"prompt_tps": {
"median": 3381.8,
"min": 3371.4,
"max": 3408.7,
"n": 3
},
"ttft_s": {
"median": 1.305,
"min": 1.295,
"max": 1.314,
"n": 3
},
"total_s": {
"median": 3.771,
"min": 3.716,
"max": 3.803,
"n": 3
}
}
}
}
@@ -0,0 +1,506 @@
[
{
"run": 0,
"source": "docs/HOW_IT_WORKS.md",
"messages": [
{
"role": "user",
"content": "Run identifier 0-0. Read the following project documentation and write a detailed technical explanation of its design, tradeoffs, and how someone would use it in practice.\n\n# How does PolyStrata work?\n\nModels like Qwen3.8-Flash-Next normally run on servers with hundreds of gigabytes of graphics memory. Your graphics\ncard has 12-24 GB. PolyStrata makes it fit by **sharing the work across your whole PC** - the same idea as a kitchen, where\nthe things you use all the time stay on the counter and the rest waits in the pantry. Back to the\n[README](../README.md#how-does-it-work).\n\n## Who does what\n\n<p align=\"center\"><img src=\"media/how-it-works.svg\" width=\"860\" alt=\"The model's 24,576 experts: the busiest on the graphics card, all of them in RAM, a lookup table on the SSD\"></p>\n\n- **The model is a team of 24,576 small specialists (\"experts\"),** and each word it writes needs only 10 of them.\n So it doesn't have to have all of them on the graphics card at once.\n- **Your graphics card** does the part of the work needed for every word, and keeps the few thousand experts that\n are asked most often. It keeps learning which ones those are while you use it.\n- **Your RAM** holds every expert. When a word needs one the card doesn't have, **your processor** works on it -\n at the same time as the graphics card, so neither waits for the other.\n- **Your SSD** holds a big lookup table; the model only reads a few small rows of it per word.\n\nThe same in technical terms:\n\n- **GPU (VRAM):** attention and DeltaNet mixers, the gated-residual weights, routers, shared experts, output head, the\n MTP draft layer, the KV cache (from 64K: only its most-read part, the rest streams from RAM), and an **expert\n cache** that fills the rest of VRAM with the most-used experts (it adapts to the conversation while you chat).\n More VRAM matters more than a faster GPU: every extra GB holds ~700 more experts, and every expert on the GPU is one\n the CPU does not have to compute.\n- **RAM:** all 24,576 experts, pinned. The CPU computes the experts that are not on the GPU **in place**, at the same\n time as the GPU works on the cached ones (AVX-512 / AVX2 kernels, ggml's for the i-quants). On a PC with little RAM\n and a big card, the [low-RAM mode](MODELS.md#a-big-graphics-card-and-little-ram) keeps in RAM only what the GPU does\n not hold.\n- **SSD:** the 28.8 GB n-gram table, read a few rows per token through the OS cache.\n\nThis works the same on NVIDIA (CUDA) and AMD (HIP) cards: the same engine, compiled for each.\n\n## Guess, then check\n\n<p align=\"center\"><img src=\"media/guess-and-check.svg\" width=\"860\" alt=\"A small helper guesses the next words; the big model checks them all at once and keeps the right ones\"></p>\n\n- **Guess, then check.** A small, fast helper built into the model guesses the next few words, and the big model\n checks all the guesses in one go. It keeps the ones it agrees with and writes the next word itself - so one step\n often produces several words. The helper only guesses - the big model decides every word - so you get the same\n quality answer, 1.6-1.8x sooner.\n- In technical terms: the model's own MTP layer drafts up to 3 tokens; one pass over all 48 layers checks them, 2.4-3.2\n tokens per pass on average. When the reply repeats the context (code edits, quoted text), **prompt lookup** drafts\n up to 5 tokens from the earlier copy, but only where its measured acceptance and cost say it pays: code edits 6-11%\n faster, other text unchanged. The drafts are checked like the MTP's, so the output is the same.\n\n## Reading long texts\n\n**Long texts are read in big pieces** (up to 8,192 tokens - pieces of words - at a time), which is why a long\ndocument or code base is read at over 1,000 tokens per second. The experts of the next layer stream to the GPU over\nPCIe while the current layer's attention runs. After the first message, PolyStrata keeps the conversation and reads only\nwhat is new, so follow-ups start in seconds.\n\n## More\n\nThe [details](DETAILS.md#how-it-works) explain every part and its numbers, and the\n[paper](paper/Strata-Paper.pdf) tells the whole story, with the measurements behind it.\n\n## Credits\n\n- PolyStrata is built on [Strata](https://github.com/Niko1221/Strata) by Niko1221 and its contributors. The Qwen\n engine, the installer, the server and the web app are that project's work. PolyStrata adds the engine for GLM 5.3\n Flash ([GLM.md](GLM.md)), whose file is from\n [neuralll](https://huggingface.co/neuralll/GLM-5.3-Flash-GSQ-RCO-3.0bit-Q4Kattn-GGUF).\n- Model: [Qwen3.8-Flash-Next](https://huggingface.co/Qwen/Qwen3.8-Flash-Next) by the Qwen team; compressed versions by\n [ISTA-DASLab](https://huggingface.co/ISTA-DASLab/Qwen3.8-Flash-Next-GSQ-RCO-GGUF);\n [Swift 1.5](https://huggingface.co/ukisai/Swift-1.5-Qwen3.8-Flash-Next-GSQ-RCO-GGUF) by UkisAI; the experimental\n [UD-Q4_K_XL](https://huggingface.co/unsloth/Line truncated
}
],
"response": {
"first": 0.5771037638187408,
"total": 2.885388808324933,
"text": "# Technical Analysis of PolyStrata Architecture\n\nPolyStrata is a specialized inference engine designed to run large-scale Mixture-of-Experts (MoE) models, specifically **Qwen3.8-Flash-Next**, on consumer-grade hardware with limited VRAM (12\u201324 GB). It achieves this by offloading the computational burden from the GPU to the CPU and RAM, utilizing a hierarchical storage strategy and parallel processing techniques.\n\nBelow is a detailed breakdown of its design, tradeoffs, and practical usage.\n\n---\n\n## 1. Core Design Philosophy: The \"Kitchen and Pantry\" Model\n\nThe fundamental innovation of PolyStrata is treating the entire PC as a unified compute resource rather than relying solely on the GPU. It uses a metaphor of a kitchen:\n* **GPU (VRAM):** The \"counter\" where frequently used items (experts) are kept for immediate access.\n* **RAM:** The \"pantry\" where all experts are stored.\n* **SSD:** The \"deep storage\" holding auxiliary data structures.\n\n### 1.1. Expert Distribution Strategy\nThe model consists of **24,576 small specialists (\"experts\")**. For any given token generation, only **10 experts** are active. PolyStrata manages this distribution across three tiers:\n\n| Component | Role | Capacity/Content |\n| :--- | :--- | :--- |\n| **GPU (VRAM)** | High-speed compute & caching | Holds attention layers, DeltaNet mixers, routers, shared experts, output head, MTP draft layer, KV cache (partial), and an **adaptive expert cache**. |\n| **RAM** | Bulk storage & CPU compute | Holds **all 24,576 experts** (pinned memory). CPU computes experts not present on the GPU. |\n| **SSD** | Auxiliary lookup | Holds a **28.8 GB n-gram table** for prompt lookup optimization. |\n\n### 1.2. Parallel Execution Model\nPolyStrata eliminates the traditional bottleneck where the CPU waits for the GPU or vice versa.\n* **Simultaneous Computation:** While the GPU processes the cached experts and attention mechanisms, the CPU simultaneously computes the non-cached experts in RAM.\n* **PCIe Streaming:** As the current layer\u2019s attention runs, the experts for the next layer stream over PCIe to the GPU, ensuring the GPU is never idle waiting for",
"usage": {
"prompt_tokens": 1696,
"completion_tokens": 512,
"total_tokens": 2208,
"prompt_tokens_details": {
"cached_tokens": 0
}
},
"timings": {
"cache_n": 0,
"prompt_n": 1696,
"prompt_ms": 569.0,
"prompt_per_token_ms": 0.335,
"prompt_per_second": 2980.7,
"predicted_n": 512,
"predicted_ms": 2308.3,
"predicted_per_token_ms": 4.508,
"predicted_per_second": 221.8,
"draft_n": 380,
"draft_n_accepted": 310
},
"err": null,
"pieces": 493
},
"metrics": {
"ok": true,
"err": null,
"ttft_s": 0.577,
"total_s": 2.885,
"prompt_tokens": 1696,
"reused_tokens": 0,
"read_tokens": 1696,
"generated_tokens": 512,
"prompt_tps": 2980.7,
"prompt_tps_source": "engine",
"decode_tps": 221.8,
"decode_tps_source": "engine",
"prompt_ms": 569.0,
"decode_ms": 2308.3,
"drafts_offered": 380,
"drafts_accepted": 310
}
},
{
"run": 0,
"source": "docs/INSTALL.md",
"messages": [
{
"role": "user",
"content": "Run identifier 0-1. Read the following project documentation and write a detailed technical explanation of its design, tradeoffs, and how someone would use it in practice.\n\n# Installing PolyStrata\n\nEverything about installing, starting, updating and configuring PolyStrata, on Windows and Linux, with an NVIDIA or an\nAMD graphics card. The short version is in the [README](../README.md#install); an AI coding assistant can do all of\nthis for you with [AI_SETUP.md](AI_SETUP.md).\n\n> **On this page:** [What you need](#what-you-need) \u00b7 [Windows](#windows) \u00b7 [Linux](#linux) \u00b7\n> [AMD cards](#amd-cards) \u00b7 [Several cards](#two-or-three-cards) \u00b7 [Docker](#docker-linux) \u00b7\n> [Older CPUs](#older-cpus-experimental) \u00b7 [Updating](#updating) \u00b7 [Where things are stored](#where-things-are-stored) \u00b7\n> [Setup's questions](#setups-questions) \u00b7 [Tuning](#tuning-for-your-pc) \u00b7 [All options](#options-without-questions)\n\n## What you need\n\nThis is for Qwen3.8-Flash-Next. GLM 5.3 Flash needs Linux, one NVIDIA card and far more RAM:\n[GLM.md](GLM.md#what-you-need). The three smaller models (Qwen3.6-35B-A3B, Ornith 1.5, Gemma 4 26B-A4B) need Linux\nor Windows, one NVIDIA card and less of everything: [BACKENDS.md](BACKENDS.md#install).\n\n| | |\n| --- | --- |\n| **GPU** | **NVIDIA** RTX 20, 30, 40 or 50 series, **12 GB VRAM or more** (8 GB runs, slowly). Measured on an RTX 5070 and an RTX 3090; RTX 20 (Turing, since 0.1.27) was tested by a contributor on an RTX 2070. **AMD** Radeon RX 7900 XT / XTX, RX 9070 / 9070 XT and Radeon AI PRO R9700 (validated), RX 7800 XT / 7700 XT and RX 9060 XT (validated by their owners), RX 6800 / 6900 series (community-reported), with 12 GB of VRAM or more. See [AMD cards](#amd-cards). |\n| **RAM** | Enough for the size you pick ([which model](MODELS.md#pick-by-ram)); **64 GB** runs every size. A big GPU makes up for less RAM - the [low-RAM mode](MODELS.md#a-big-graphics-card-and-little-ram). |\n| **CPU** | x86-64 with AVX2 (any Intel/AMD desktop CPU from the last ~8 years). AVX-512 (Ryzen 7000/9000) is a bit faster. Older CPUs without AVX2 are experimental and slow: [Older CPUs](#older-cpus-experimental). |\n| **Disk** | ~70-80 GB free for the model, ~6 GB for the MTP layer (+1 GB with images). **Q2_0 on an AVX-512 CPU** also writes a one-time ~40 GB copy of its experts for the fast CPU kernel. On Linux with an AMD card, ROCm takes ~10 GB more when setup installs it. An NVMe SSD is strongly recommended: it makes the first start much faster. |\n| **OS** | Windows 10/11, or Linux (Ubuntu 22.04/24.04 and Debian 12/13 get everything installed automatically). |\n| **Driver** | **NVIDIA:** a current driver, version 580 or newer ([nvidia.com/drivers](https://www.nvidia.com/drivers) or the NVIDIA App). **AMD:** on Linux the kernel's amdgpu driver (no ROCm install needed); on Windows a current AMD Software: Adrenalin Edition driver ([amd.com/support](https://www.amd.com/en/support)). |\n\nThe driver is the only thing you install yourself. Everything else - Python, the engine, the model - is set up for\nyou the first time: Python 3.12 if you have none (for your user account, no admin), a private Python environment in\n`.venv/`, the PolyStrata engine, the model and the MTP draft layer. On NVIDIA it uses the ready-made engine for RTX\n20/30/40/50 and NVIDIA's CUDA libraries from pip (~0.4 GB); if no ready-made engine fits your PC, it offers to install\nthe build tools (Visual Studio Build Tools + CUDA Toolkit on Windows, `build-essential` + CUDA on Ubuntu) and compiles\nthe engine for your GPU (asks first; 20-40 minutes once). More: [details](DETAILS.md#before-you-start).\n\n## Windows\n\n1. [Download this project](https://github.com/VecSzn/PolyStrata/archive/refs/heads/main.zip) and unzip it (or\n `git clone` it).\n2. Double-click **`START-HERE.bat`**.\n3. Answer a few questions - or just press Enter each time for the recommended choice ([the questions](#setups-questions)).\n\nThen it downloads everything (the model is ~70 GB, so the first time takes a while - you can stop and it picks up\nwhere it left off) and **starts the model**. Your browser opens the PolyStrata app at `http://127.0.0.1:8080`.\n\n> **While the model starts, your PC can be slow or stop responding for 1-3 minutes** (longest the first time): PolyStrata\n> loads 35-55 GB into your RAM and locks part of it for the graphics card. That's normal - wait, and don't close the\n> window. The window tells you what it is doing.\n\n**Next time**, just double-click `START-HERE.bat` again: it starts right away (30-90 s to load the model), nothing is\ndownloaded twice. Close its window to stop the model. `SETUP.bat` (the same as `START-HERE.bat --setup`) installs\nanother model or changes the settings. Starting PolyStrata from Task Scheduler at logon needs two task settings, or the\nstart is 24x slower: [Running it at startup](DETAILS.md#running-it-at-startup-task-scheduler).\n\Line truncated
}
],
"response": {
"first": 1.313829069957137,
"total": 3.803109209984541,
"text": "# Technical Analysis: PolyStrata Project Design and Implementation\n\n## 1. Executive Summary\n\n**PolyStrata** is a specialized inference engine and deployment framework designed to run large language models (LLMs), specifically targeting the **Qwen3.8-Flash-Next** architecture (and smaller variants like Qwen3.6, Ornith, Gemma). It is built on top of the **MPT (Mixture of Tokens/Experts)** or similar MoE (Mixture of Experts) architectures, leveraging hardware acceleration via NVIDIA CUDA and AMD HIP/ROCm.\n\nThe project distinguishes itself through:\n1. **Hybrid CPU/GPU Offloading:** It intelligently splits model layers and experts between GPU VRAM and system RAM/CPU, allowing models larger than available VRAM to run on consumer hardware.\n2. **Cross-Platform Automation:** A unified setup script (`START-HERE.bat` / `setup.sh`) handles dependency resolution, engine compilation, and model downloading, abstracting away the complexity of C++ compilation and environment management.\n3. **Multi-GPU Support:** Native support for splitting models across multiple GPUs (NVIDIA and AMD) to increase context window and throughput.\n\n---\n\n## 2. System Architecture & Design\n\n### 2.1 Core Components\nThe system is composed of three main layers:\n1. **The PolyStrata Engine:** A C++/CUDA/C++ backend that handles tensor operations, KV-cache management, and expert routing. It is compiled from source if a pre-built binary does not match the user's GPU architecture (compute capability).\n2. **The Model Pack:** Quantized model weights (e.g., `Q2_0`, `IQ2_XS`, `IQ3_XXS`). These are stored in a specific format optimized for the engine's memory layout.\n3. **The MTP Layer (Mixture of Tokens/Experts):** A draft layer that manages the distribution of \"experts\" (sub-networks within the MoE model) across available memory (VRAM and RAM).\n\n### 2.2 Memory Management Strategy\nPolyStrata employs a sophisticated memory hierarchy:\n* **VRAM (Primary):** Holds active layers and frequently accessed experts.\n* **System RAM (Secondary):** Acts as a swap space for experts not currently in VRAM. The engine uses page-locked memory for faster transfer between RAM and VRAM.\n* **CPU (T",
"usage": {
"prompt_tokens": 4370,
"completion_tokens": 512,
"total_tokens": 4882,
"prompt_tokens_details": {
"cached_tokens": 0
}
},
"timings": {
"cache_n": 0,
"prompt_n": 4370,
"prompt_ms": 1296.2,
"prompt_per_token_ms": 0.297,
"prompt_per_second": 3371.4,
"predicted_n": 512,
"predicted_ms": 2490.8,
"predicted_per_token_ms": 4.865,
"predicted_per_second": 205.6,
"draft_n": 351,
"draft_n_accepted": 283
},
"err": null,
"pieces": 494
},
"metrics": {
"ok": true,
"err": null,
"ttft_s": 1.314,
"total_s": 3.803,
"prompt_tokens": 4370,
"reused_tokens": 0,
"read_tokens": 4370,
"generated_tokens": 512,
"prompt_tps": 3371.4,
"prompt_tps_source": "engine",
"decode_tps": 205.6,
"decode_tps_source": "engine",
"prompt_ms": 1296.2,
"decode_ms": 2490.8,
"drafts_offered": 351,
"drafts_accepted": 283
}
},
{
"run": 0,
"source": "docs/DETAILS.md",
"messages": [
{
"role": "user",
"content": "Run identifier 0-2. Read the following project documentation and write a detailed technical explanation of its design, tradeoffs, and how someone would use it in practice.\n\n# PolyStrata - the details\n\nThe technical side of PolyStrata: every measured number, the API, images, all settings and how the engine works.\nNew here? Start with the [README](../README.md); installing step by step is in [INSTALL.md](INSTALL.md), the models in\n[MODELS.md](MODELS.md), common problems in [TROUBLESHOOTING.md](TROUBLESHOOTING.md).\n\n> **On this page:** [Speed](#speed-measured) \u00b7 [Other GPUs](#other-gpus-estimated) \u00b7 [Which model?](#which-model) \u00b7\n> [Requirements](#before-you-start) \u00b7 [Windows](#windows) \u00b7 [Linux](#linux) \u00b7 [API](#using-it) \u00b7\n> [MCP tools](#tools-from-mcp-servers) \u00b7 [MCP server](#manage-strata-from-your-ai-assistant-mcp-server) \u00b7\n> [Images](#images-vision) \u00b7\n> [Troubleshooting](#troubleshooting) \u00b7 [How it works](#how-it-works)\n\n---\n\n## Speed (measured)\n\nRTX 5070 **12 GB**, Ryzen 5 7600 (6 cores), 64 GB DDR5-5200, Windows, engine 0.1.26 with the settings setup writes\n(`--prefill auto`, 8-bit KV above 4K, KV streaming from 64K). One code-agent prompt per length, 256 generated tokens,\nMTP speculative decoding on. \"262K\" is the model's full context window (a 259,943-token prompt). The IQ2_XS row was\nmeasured with Swift 1.5's IQ2_XS, which runs at the original's speed.\n\n**Engine 0.1.36 (#136), the same PC:** Q2_0's prompt experts run on fused int8 tensor-core kernels (RTX 30 and newer):\n4K 1,294 -> 1,570, 32K 2,170 -> 2,653, 128K 2,123 -> 2,468 tokens/s (+16-22%), as close to an FP16 reference as the\nprevious kernels (closer at 32K: teacher-forced KL 0.009 vs 0.012). The decode path's block selection and greedy\nargmax run on thread-block clusters (RTX 50, sm_90+; other cards keep the previous kernels; the same tokens): Q2_0 output at 4K 89 -> 93.5, at 128K\n64.5 -> 76.4 tokens/s. `STRATA_PF_FUSED=0` keeps the previous prompt kernels (byte-identical answers to 0.1.35);\n`STRATA_PF_FUSED=1` also runs the native IQ packs' fused kernels (opt-in: IQ2_XS prompts +12% at 4K, +3% at 32K, the\nIQ3 packs about even; on HIP they run on gfx11 and on gfx1200 / gfx1201, see AMD_HIP.md); `STRATA_QSA_CLUSTER=0` / `STRATA_ARGMAX_MULTI=0` turn the decode kernels off. The tables\nbelow are 0.1.26's.\n\n### Prompt processing (tokens/s)\n\n| Model | 1K | 4K | 32K | 64K | 128K | 262K |\n| --- | ---: | ---: | ---: | ---: | ---: | ---: |\n| **Q2_0** | 536 | 1,299 | 2,171 | 2,126 | 2,107 | 1,304\u2020 |\n| **IQ2_XS** | 534 | 1,256 | 2,092 | 1,754 | 1,752 | 1,181*\u2020 |\n| **IQ3_XXS** | 482 | 1,007 | 1,745 | 1,609 | 1,602 | - |\n| **IQ3_S** | 427 | 913 | 1,624 | 1,640 | 1,443 | - |\n| **Coder** | 656 | 1,583 | 2,177 | 2,236 | 2,208 | 1,034** |\n| **IQ3_S** (AMD RX 7900 XTX, gfx1100) | 760 | 1,275 | 1,641 | 1,594 | 1,494 | - |\n\nEngine 0.1.26; `bench/results/2026-09-29-speed-0126`. The AMD RX 7900 XTX row: engine 0.1.38 on a ROCm\n10.2 nightly with a tuned gfx1100 hipBLASLt-100500 table (upstream as [#755](https://github.com/Niko1221/Strata/pull/755)),\nthe median of 3 clean cells per tier\n(Ryzen 9 7900X, 96 GB; 1K-128K one-shot runs, 256 generated tokens,\ngreedy). At 32K-128K that is 8-28% faster than 0.1.22. \u2020 not measured\nagain: 0.1.22. \\* measured with images on (the image encoder's VRAM reserve leaves fewer experts cached). \\*\\* not\nmeasured again: 0.1.14.\n\n### Output (tokens/s)\n\n| Model | 1K | 4K | 32K | 64K | 128K | 262K |\n| --- | ---: | ---: | ---: | ---: | ---: | ---: |\n| **Q2_0** | 87.3 | 93.0 | 81.8 | 76.2 | 73.7 | 60.3\u2020 |\n| **IQ2_XS** | 79.6 | 78.6 | 76.3 | 63.7 | 62.7 | 52.8\u2020 |\n| **IQ3_XXS** | 61.9 | 61.6 | 58.5 | 57.2 | 49.0 | - |\n| **IQ3_S** | 52.4 | 53.3 | 48.3 | 46.3 | 45.5 | - |\n| **Coder** | 58.9 | 55.1 | 54.9 | 53.2 | 43.0 | 42.8\u2020 |\n| **IQ3_S** (AMD RX 7900 XTX, gfx1100) | 65.1 | 60.4 | 64.4 | 61.8 | 59.2 | - |\n\nEngine 0.1.26, the same runs. The AMD RX 7900 XTX row: engine 0.1.38 on a ROCm 10.2 nightly (tuned\ngfx1100 hipBLASLt-100500 table, upstream as [#755](https://github.com/Niko1221/Strata/pull/755)), median of 3 clean cells per tier (same box; decode is flat in\ncontext - the GDN linear attention is O(1) per token; 1K/4K prefill ran slightly under the 0.1.31\npackaged-ROCm numbers, 32K-128K ahead). \u2020 not measured again: 0.1.14.\n\nOutput speed depends on the text as well: speculative decoding runs faster when more of the drafted tokens are\naccepted, so a different answer to the same prompt moves it by several percent. Run back to back on the 4K prompt,\n0.1.14 writes 88.5 tokens/s and 0.1.12 85.7. The numbers before 0.1.13 (prompts about half as fast):\n[`bench/results/2026-09-24-final`](../bench/results/2026-09-24-final/matrix.md); these:\n[`bench/results/2026-09-28-speed-0114`](../bench/results/2026-09-28-speed-0114/README.md).\n\nIQ3_XXS and IQ3_S at 262K are not measLine truncated
}
],
"response": {
"first": 1.480242082849145,
"total": 4.022440079599619,
"text": "# Technical Analysis: PolyStrata Engine Design and Implementation\n\n## 1. Executive Summary\n\nPolyStrata is a high-performance inference engine designed for running large language models (LLMs) with **Mixture of Experts (MoE)** architectures on consumer-grade hardware. Its core innovation lies in optimizing the memory bandwidth bottleneck inherent in MoE models by utilizing aggressive quantization (down to 2-bit), dynamic expert caching, and specialized kernel optimizations for both prompt processing (prefill) and token generation (decode).\n\nThe engine is built to run on NVIDIA GPUs (via CUDA) and AMD GPUs (via ROCm/HIP), with specific optimizations for recent architectures (RTX 30/40/50 series and AMD RX 7000/8000 series). It supports context windows up to 262K tokens through hybrid memory management techniques.\n\n---\n\n## 2. Core Architectural Design\n\n### 2.1 Mixture of Experts (MoE) Management\nUnlike dense models where all parameters are active for every token, MoE models activate only a subset of \"experts\" per token. PolyStrata addresses the primary challenge of MoE inference: **VRAM capacity vs. Expert Count**.\n\n* **Dynamic Expert Caching:** The engine maintains a pool of experts in VRAM. Experts not currently in VRAM are stored in system RAM (pinned memory) or on disk (mmap).\n* **Adaptive Swapping:** The engine dynamically moves experts between VRAM and RAM based on usage frequency. This is controlled by `--adapt-swaps` and `--pcie-frac` (PCIe bandwidth fraction).\n* **Low-RAM Mode:** If system RAM is insufficient to hold all experts, the engine maps the expert file (`experts.bin`) directly from disk using memory-mapped I/O (`--mmap-experts`). The OS file cache acts as the intermediate buffer, reducing the need for large pinned RAM allocations.\n\n### 2.2 Quantization Strategy\nPolyStrata supports multiple quantization formats to balance speed, memory usage, and accuracy:\n\n* **Q2_0:** 2-bit quantization. Offers the highest speed and lowest VRAM usage but with potential accuracy trade-offs.\n* **IQ2_XS / IQ3_XXS / IQ3_S:** Int8-based quantization schemes (IQ = Int8 Quantization). These provide a better accuracy/speed trade-off than",
"usage": {
"prompt_tokens": 5048,
"completion_tokens": 512,
"total_tokens": 5560,
"prompt_tokens_details": {
"cached_tokens": 0
}
},
"timings": {
"cache_n": 0,
"prompt_n": 5048,
"prompt_ms": 1462.1,
"prompt_per_token_ms": 0.29,
"prompt_per_second": 3452.6,
"predicted_n": 512,
"predicted_ms": 2543.9,
"predicted_per_token_ms": 4.969,
"predicted_per_second": 201.3,
"draft_n": 364,
"draft_n_accepted": 284
},
"err": null,
"pieces": 498
},
"metrics": {
"ok": true,
"err": null,
"ttft_s": 1.48,
"total_s": 4.022,
"prompt_tokens": 5048,
"reused_tokens": 0,
"read_tokens": 5048,
"generated_tokens": 512,
"prompt_tps": 3452.6,
"prompt_tps_source": "engine",
"decode_tps": 201.3,
"decode_tps_source": "engine",
"prompt_ms": 1462.1,
"decode_ms": 2543.9,
"drafts_offered": 364,
"drafts_accepted": 284
}
},
{
"run": 1,
"source": "docs/HOW_IT_WORKS.md",
"messages": [
{
"role": "user",
"content": "Run identifier 1-0. Read the following project documentation and write a detailed technical explanation of its design, tradeoffs, and how someone would use it in practice.\n\n# How does PolyStrata work?\n\nModels like Qwen3.8-Flash-Next normally run on servers with hundreds of gigabytes of graphics memory. Your graphics\ncard has 12-24 GB. PolyStrata makes it fit by **sharing the work across your whole PC** - the same idea as a kitchen, where\nthe things you use all the time stay on the counter and the rest waits in the pantry. Back to the\n[README](../README.md#how-does-it-work).\n\n## Who does what\n\n<p align=\"center\"><img src=\"media/how-it-works.svg\" width=\"860\" alt=\"The model's 24,576 experts: the busiest on the graphics card, all of them in RAM, a lookup table on the SSD\"></p>\n\n- **The model is a team of 24,576 small specialists (\"experts\"),** and each word it writes needs only 10 of them.\n So it doesn't have to have all of them on the graphics card at once.\n- **Your graphics card** does the part of the work needed for every word, and keeps the few thousand experts that\n are asked most often. It keeps learning which ones those are while you use it.\n- **Your RAM** holds every expert. When a word needs one the card doesn't have, **your processor** works on it -\n at the same time as the graphics card, so neither waits for the other.\n- **Your SSD** holds a big lookup table; the model only reads a few small rows of it per word.\n\nThe same in technical terms:\n\n- **GPU (VRAM):** attention and DeltaNet mixers, the gated-residual weights, routers, shared experts, output head, the\n MTP draft layer, the KV cache (from 64K: only its most-read part, the rest streams from RAM), and an **expert\n cache** that fills the rest of VRAM with the most-used experts (it adapts to the conversation while you chat).\n More VRAM matters more than a faster GPU: every extra GB holds ~700 more experts, and every expert on the GPU is one\n the CPU does not have to compute.\n- **RAM:** all 24,576 experts, pinned. The CPU computes the experts that are not on the GPU **in place**, at the same\n time as the GPU works on the cached ones (AVX-512 / AVX2 kernels, ggml's for the i-quants). On a PC with little RAM\n and a big card, the [low-RAM mode](MODELS.md#a-big-graphics-card-and-little-ram) keeps in RAM only what the GPU does\n not hold.\n- **SSD:** the 28.8 GB n-gram table, read a few rows per token through the OS cache.\n\nThis works the same on NVIDIA (CUDA) and AMD (HIP) cards: the same engine, compiled for each.\n\n## Guess, then check\n\n<p align=\"center\"><img src=\"media/guess-and-check.svg\" width=\"860\" alt=\"A small helper guesses the next words; the big model checks them all at once and keeps the right ones\"></p>\n\n- **Guess, then check.** A small, fast helper built into the model guesses the next few words, and the big model\n checks all the guesses in one go. It keeps the ones it agrees with and writes the next word itself - so one step\n often produces several words. The helper only guesses - the big model decides every word - so you get the same\n quality answer, 1.6-1.8x sooner.\n- In technical terms: the model's own MTP layer drafts up to 3 tokens; one pass over all 48 layers checks them, 2.4-3.2\n tokens per pass on average. When the reply repeats the context (code edits, quoted text), **prompt lookup** drafts\n up to 5 tokens from the earlier copy, but only where its measured acceptance and cost say it pays: code edits 6-11%\n faster, other text unchanged. The drafts are checked like the MTP's, so the output is the same.\n\n## Reading long texts\n\n**Long texts are read in big pieces** (up to 8,192 tokens - pieces of words - at a time), which is why a long\ndocument or code base is read at over 1,000 tokens per second. The experts of the next layer stream to the GPU over\nPCIe while the current layer's attention runs. After the first message, PolyStrata keeps the conversation and reads only\nwhat is new, so follow-ups start in seconds.\n\n## More\n\nThe [details](DETAILS.md#how-it-works) explain every part and its numbers, and the\n[paper](paper/Strata-Paper.pdf) tells the whole story, with the measurements behind it.\n\n## Credits\n\n- PolyStrata is built on [Strata](https://github.com/Niko1221/Strata) by Niko1221 and its contributors. The Qwen\n engine, the installer, the server and the web app are that project's work. PolyStrata adds the engine for GLM 5.3\n Flash ([GLM.md](GLM.md)), whose file is from\n [neuralll](https://huggingface.co/neuralll/GLM-5.3-Flash-GSQ-RCO-3.0bit-Q4Kattn-GGUF).\n- Model: [Qwen3.8-Flash-Next](https://huggingface.co/Qwen/Qwen3.8-Flash-Next) by the Qwen team; compressed versions by\n [ISTA-DASLab](https://huggingface.co/ISTA-DASLab/Qwen3.8-Flash-Next-GSQ-RCO-GGUF);\n [Swift 1.5](https://huggingface.co/ukisai/Swift-1.5-Qwen3.8-Flash-Next-GSQ-RCO-GGUF) by UkisAI; the experimental\n [UD-Q4_K_XL](https://huggingface.co/unsloth/Line truncated
}
],
"response": {
"first": 0.5591428838670254,
"total": 2.8906556461006403,
"text": "# Technical Analysis of PolyStrata Architecture\n\nPolyStrata is a specialized inference engine designed to run large-scale Mixture-of-Experts (MoE) models, specifically **Qwen3.8-Flash-Next**, on consumer-grade hardware with limited VRAM (12\u201324 GB). The core innovation lies in its ability to offload the computational burden of a model that normally requires hundreds of gigabytes of GPU memory by orchestrating a hybrid execution pipeline across the GPU, CPU (RAM), and SSD.\n\nBelow is a detailed technical explanation of its design, the trade-offs involved, and practical usage guidelines.\n\n---\n\n## 1. System Design and Architecture\n\nPolyStrata treats the model\u2019s 24,576 \"experts\" not as a monolithic block to be loaded entirely into VRAM, but as a dynamic pool of resources distributed across the system\u2019s memory hierarchy. The architecture is built on three key pillars: **Dynamic Expert Caching**, **Parallel CPU-GPU Execution**, and **Speculative Decoding**.\n\n### A. The Memory Hierarchy Strategy\n\nThe system divides the model\u2019s components based on access frequency and computational intensity:\n\n1. **GPU (VRAM): The High-Speed Core**\n * **Contents:** Attention mechanisms, DeltaNet mixers, gated-residual weights, routers, shared experts, the output head, the MTP (Multi-Token Prediction) draft layer, and the KV cache (specifically the most-read portion of the 64K context window).\n * **Expert Cache:** The remaining VRAM is filled with an **expert cache**. This cache is dynamic; it learns which experts are most frequently requested during a conversation and keeps them resident in VRAM.\n * **Impact:** Every extra GB of VRAM holds ~700 more experts. An expert on the GPU is computed instantly; an expert offloaded to the CPU requires PCIe transfer and CPU computation.\n\n2. **RAM (System Memory): The Expert Pool**\n * **Contents:** All 24,576 experts are stored here in a pinned memory format for faster PCIe transfer.\n * **Execution:** When the GPU requests an expert not in its cache, the CPU computes it **in-place**. Crucially, this computation happens **in parallel** with the GPU processing the cached experts. The CPU uses optimized kernels (AVX-512/AVX2 for standard quantization, ggml",
"usage": {
"prompt_tokens": 1696,
"completion_tokens": 512,
"total_tokens": 2208,
"prompt_tokens_details": {
"cached_tokens": 0
}
},
"timings": {
"cache_n": 0,
"prompt_n": 1696,
"prompt_ms": 552.8,
"prompt_per_token_ms": 0.326,
"prompt_per_second": 3068.0,
"predicted_n": 512,
"predicted_ms": 2331.3,
"predicted_per_token_ms": 4.553,
"predicted_per_second": 219.6,
"draft_n": 376,
"draft_n_accepted": 304
},
"err": null,
"pieces": 498
},
"metrics": {
"ok": true,
"err": null,
"ttft_s": 0.559,
"total_s": 2.891,
"prompt_tokens": 1696,
"reused_tokens": 0,
"read_tokens": 1696,
"generated_tokens": 512,
"prompt_tps": 3068.0,
"prompt_tps_source": "engine",
"decode_tps": 219.6,
"decode_tps_source": "engine",
"prompt_ms": 552.8,
"decode_ms": 2331.3,
"drafts_offered": 376,
"drafts_accepted": 304
}
},
{
"run": 1,
"source": "docs/INSTALL.md",
"messages": [
{
"role": "user",
"content": "Run identifier 1-1. Read the following project documentation and write a detailed technical explanation of its design, tradeoffs, and how someone would use it in practice.\n\n# Installing PolyStrata\n\nEverything about installing, starting, updating and configuring PolyStrata, on Windows and Linux, with an NVIDIA or an\nAMD graphics card. The short version is in the [README](../README.md#install); an AI coding assistant can do all of\nthis for you with [AI_SETUP.md](AI_SETUP.md).\n\n> **On this page:** [What you need](#what-you-need) \u00b7 [Windows](#windows) \u00b7 [Linux](#linux) \u00b7\n> [AMD cards](#amd-cards) \u00b7 [Several cards](#two-or-three-cards) \u00b7 [Docker](#docker-linux) \u00b7\n> [Older CPUs](#older-cpus-experimental) \u00b7 [Updating](#updating) \u00b7 [Where things are stored](#where-things-are-stored) \u00b7\n> [Setup's questions](#setups-questions) \u00b7 [Tuning](#tuning-for-your-pc) \u00b7 [All options](#options-without-questions)\n\n## What you need\n\nThis is for Qwen3.8-Flash-Next. GLM 5.3 Flash needs Linux, one NVIDIA card and far more RAM:\n[GLM.md](GLM.md#what-you-need). The three smaller models (Qwen3.6-35B-A3B, Ornith 1.5, Gemma 4 26B-A4B) need Linux\nor Windows, one NVIDIA card and less of everything: [BACKENDS.md](BACKENDS.md#install).\n\n| | |\n| --- | --- |\n| **GPU** | **NVIDIA** RTX 20, 30, 40 or 50 series, **12 GB VRAM or more** (8 GB runs, slowly). Measured on an RTX 5070 and an RTX 3090; RTX 20 (Turing, since 0.1.27) was tested by a contributor on an RTX 2070. **AMD** Radeon RX 7900 XT / XTX, RX 9070 / 9070 XT and Radeon AI PRO R9700 (validated), RX 7800 XT / 7700 XT and RX 9060 XT (validated by their owners), RX 6800 / 6900 series (community-reported), with 12 GB of VRAM or more. See [AMD cards](#amd-cards). |\n| **RAM** | Enough for the size you pick ([which model](MODELS.md#pick-by-ram)); **64 GB** runs every size. A big GPU makes up for less RAM - the [low-RAM mode](MODELS.md#a-big-graphics-card-and-little-ram). |\n| **CPU** | x86-64 with AVX2 (any Intel/AMD desktop CPU from the last ~8 years). AVX-512 (Ryzen 7000/9000) is a bit faster. Older CPUs without AVX2 are experimental and slow: [Older CPUs](#older-cpus-experimental). |\n| **Disk** | ~70-80 GB free for the model, ~6 GB for the MTP layer (+1 GB with images). **Q2_0 on an AVX-512 CPU** also writes a one-time ~40 GB copy of its experts for the fast CPU kernel. On Linux with an AMD card, ROCm takes ~10 GB more when setup installs it. An NVMe SSD is strongly recommended: it makes the first start much faster. |\n| **OS** | Windows 10/11, or Linux (Ubuntu 22.04/24.04 and Debian 12/13 get everything installed automatically). |\n| **Driver** | **NVIDIA:** a current driver, version 580 or newer ([nvidia.com/drivers](https://www.nvidia.com/drivers) or the NVIDIA App). **AMD:** on Linux the kernel's amdgpu driver (no ROCm install needed); on Windows a current AMD Software: Adrenalin Edition driver ([amd.com/support](https://www.amd.com/en/support)). |\n\nThe driver is the only thing you install yourself. Everything else - Python, the engine, the model - is set up for\nyou the first time: Python 3.12 if you have none (for your user account, no admin), a private Python environment in\n`.venv/`, the PolyStrata engine, the model and the MTP draft layer. On NVIDIA it uses the ready-made engine for RTX\n20/30/40/50 and NVIDIA's CUDA libraries from pip (~0.4 GB); if no ready-made engine fits your PC, it offers to install\nthe build tools (Visual Studio Build Tools + CUDA Toolkit on Windows, `build-essential` + CUDA on Ubuntu) and compiles\nthe engine for your GPU (asks first; 20-40 minutes once). More: [details](DETAILS.md#before-you-start).\n\n## Windows\n\n1. [Download this project](https://github.com/VecSzn/PolyStrata/archive/refs/heads/main.zip) and unzip it (or\n `git clone` it).\n2. Double-click **`START-HERE.bat`**.\n3. Answer a few questions - or just press Enter each time for the recommended choice ([the questions](#setups-questions)).\n\nThen it downloads everything (the model is ~70 GB, so the first time takes a while - you can stop and it picks up\nwhere it left off) and **starts the model**. Your browser opens the PolyStrata app at `http://127.0.0.1:8080`.\n\n> **While the model starts, your PC can be slow or stop responding for 1-3 minutes** (longest the first time): PolyStrata\n> loads 35-55 GB into your RAM and locks part of it for the graphics card. That's normal - wait, and don't close the\n> window. The window tells you what it is doing.\n\n**Next time**, just double-click `START-HERE.bat` again: it starts right away (30-90 s to load the model), nothing is\ndownloaded twice. Close its window to stop the model. `SETUP.bat` (the same as `START-HERE.bat --setup`) installs\nanother model or changes the settings. Starting PolyStrata from Task Scheduler at logon needs two task settings, or the\nstart is 24x slower: [Running it at startup](DETAILS.md#running-it-at-startup-task-scheduler).\n\Line truncated
}
],
"response": {
"first": 1.2954782079905272,
"total": 3.7156853284686804,
"text": "# Technical Analysis: PolyStrata Project (Run Identifier 1-1)\n\n## 1. Executive Summary\nPolyStrata is a high-performance, cross-platform inference engine designed to run large language models (LLMs), specifically targeting the **Qwen3.8-Flash-Next** architecture. It is built on top of the `llama.cpp` ecosystem (indicated by references to `ggml-cpu`, GGUF formats, and quantization schemes like Q2_0, IQ2_XS) but adds a proprietary \"MTP\" (Multi-Token Prediction) draft layer and a custom C++ kernel optimized for specific CPU instruction sets (AVX2/AVX-512).\n\nThe system is designed for local deployment on consumer hardware (RTX 20/30/40/50 series and AMD RX 7000/9000 series), emphasizing ease of installation via automated scripts while offering granular control over GPU memory, CPU offloading, and multi-GPU configurations.\n\n## 2. System Architecture & Design\n\n### 2.1 Core Components\n1. **The Engine (Backend):**\n * **NVIDIA:** Uses CUDA-based kernels. The installer provides pre-compiled binaries for common architectures (RTX 20/30/40/50). If the GPU architecture is unsupported, it triggers a local compilation using CUDA Toolkit and build tools.\n * **AMD:** Uses HIP/ROCm. On Linux, it leverages system ROCm or installs AMD wheels into a virtual environment. It compiles the engine locally for the specific GPU generation (gfx1100, gfx1200, etc.).\n * **CPU Fallback:** The engine includes `ggml-cpu` kernels. For older CPUs (pre-AVX2), it compiles a fallback version using AVX or SSE4.2 instructions, though performance is significantly degraded.\n\n2. **Model Format & Quantization:**\n * Models are stored in **GGUF** format.\n * Supported quantizations include **Q2_0**, **IQ2_XS**, **IQ3_XXS**, and **IQ3_S**.\n * **Q2_0** is highlighted for AVX-512 CPUs, requiring a one-time ~40GB copy of experts for fast CPU kernel execution.\n * **Unsloth 4",
"usage": {
"prompt_tokens": 4370,
"completion_tokens": 512,
"total_tokens": 4882,
"prompt_tokens_details": {
"cached_tokens": 0
}
},
"timings": {
"cache_n": 0,
"prompt_n": 4370,
"prompt_ms": 1282.0,
"prompt_per_token_ms": 0.293,
"prompt_per_second": 3408.7,
"predicted_n": 512,
"predicted_ms": 2421.6,
"predicted_per_token_ms": 4.73,
"predicted_per_second": 211.4,
"draft_n": 377,
"draft_n_accepted": 303
},
"err": null,
"pieces": 498
},
"metrics": {
"ok": true,
"err": null,
"ttft_s": 1.295,
"total_s": 3.716,
"prompt_tokens": 4370,
"reused_tokens": 0,
"read_tokens": 4370,
"generated_tokens": 512,
"prompt_tps": 3408.7,
"prompt_tps_source": "engine",
"decode_tps": 211.4,
"decode_tps_source": "engine",
"prompt_ms": 1282.0,
"decode_ms": 2421.6,
"drafts_offered": 377,
"drafts_accepted": 303
}
},
{
"run": 1,
"source": "docs/DETAILS.md",
"messages": [
{
"role": "user",
"content": "Run identifier 1-2. Read the following project documentation and write a detailed technical explanation of its design, tradeoffs, and how someone would use it in practice.\n\n# PolyStrata - the details\n\nThe technical side of PolyStrata: every measured number, the API, images, all settings and how the engine works.\nNew here? Start with the [README](../README.md); installing step by step is in [INSTALL.md](INSTALL.md), the models in\n[MODELS.md](MODELS.md), common problems in [TROUBLESHOOTING.md](TROUBLESHOOTING.md).\n\n> **On this page:** [Speed](#speed-measured) \u00b7 [Other GPUs](#other-gpus-estimated) \u00b7 [Which model?](#which-model) \u00b7\n> [Requirements](#before-you-start) \u00b7 [Windows](#windows) \u00b7 [Linux](#linux) \u00b7 [API](#using-it) \u00b7\n> [MCP tools](#tools-from-mcp-servers) \u00b7 [MCP server](#manage-strata-from-your-ai-assistant-mcp-server) \u00b7\n> [Images](#images-vision) \u00b7\n> [Troubleshooting](#troubleshooting) \u00b7 [How it works](#how-it-works)\n\n---\n\n## Speed (measured)\n\nRTX 5070 **12 GB**, Ryzen 5 7600 (6 cores), 64 GB DDR5-5200, Windows, engine 0.1.26 with the settings setup writes\n(`--prefill auto`, 8-bit KV above 4K, KV streaming from 64K). One code-agent prompt per length, 256 generated tokens,\nMTP speculative decoding on. \"262K\" is the model's full context window (a 259,943-token prompt). The IQ2_XS row was\nmeasured with Swift 1.5's IQ2_XS, which runs at the original's speed.\n\n**Engine 0.1.36 (#136), the same PC:** Q2_0's prompt experts run on fused int8 tensor-core kernels (RTX 30 and newer):\n4K 1,294 -> 1,570, 32K 2,170 -> 2,653, 128K 2,123 -> 2,468 tokens/s (+16-22%), as close to an FP16 reference as the\nprevious kernels (closer at 32K: teacher-forced KL 0.009 vs 0.012). The decode path's block selection and greedy\nargmax run on thread-block clusters (RTX 50, sm_90+; other cards keep the previous kernels; the same tokens): Q2_0 output at 4K 89 -> 93.5, at 128K\n64.5 -> 76.4 tokens/s. `STRATA_PF_FUSED=0` keeps the previous prompt kernels (byte-identical answers to 0.1.35);\n`STRATA_PF_FUSED=1` also runs the native IQ packs' fused kernels (opt-in: IQ2_XS prompts +12% at 4K, +3% at 32K, the\nIQ3 packs about even; on HIP they run on gfx11 and on gfx1200 / gfx1201, see AMD_HIP.md); `STRATA_QSA_CLUSTER=0` / `STRATA_ARGMAX_MULTI=0` turn the decode kernels off. The tables\nbelow are 0.1.26's.\n\n### Prompt processing (tokens/s)\n\n| Model | 1K | 4K | 32K | 64K | 128K | 262K |\n| --- | ---: | ---: | ---: | ---: | ---: | ---: |\n| **Q2_0** | 536 | 1,299 | 2,171 | 2,126 | 2,107 | 1,304\u2020 |\n| **IQ2_XS** | 534 | 1,256 | 2,092 | 1,754 | 1,752 | 1,181*\u2020 |\n| **IQ3_XXS** | 482 | 1,007 | 1,745 | 1,609 | 1,602 | - |\n| **IQ3_S** | 427 | 913 | 1,624 | 1,640 | 1,443 | - |\n| **Coder** | 656 | 1,583 | 2,177 | 2,236 | 2,208 | 1,034** |\n| **IQ3_S** (AMD RX 7900 XTX, gfx1100) | 760 | 1,275 | 1,641 | 1,594 | 1,494 | - |\n\nEngine 0.1.26; `bench/results/2026-09-29-speed-0126`. The AMD RX 7900 XTX row: engine 0.1.38 on a ROCm\n10.2 nightly with a tuned gfx1100 hipBLASLt-100500 table (upstream as [#755](https://github.com/Niko1221/Strata/pull/755)),\nthe median of 3 clean cells per tier\n(Ryzen 9 7900X, 96 GB; 1K-128K one-shot runs, 256 generated tokens,\ngreedy). At 32K-128K that is 8-28% faster than 0.1.22. \u2020 not measured\nagain: 0.1.22. \\* measured with images on (the image encoder's VRAM reserve leaves fewer experts cached). \\*\\* not\nmeasured again: 0.1.14.\n\n### Output (tokens/s)\n\n| Model | 1K | 4K | 32K | 64K | 128K | 262K |\n| --- | ---: | ---: | ---: | ---: | ---: | ---: |\n| **Q2_0** | 87.3 | 93.0 | 81.8 | 76.2 | 73.7 | 60.3\u2020 |\n| **IQ2_XS** | 79.6 | 78.6 | 76.3 | 63.7 | 62.7 | 52.8\u2020 |\n| **IQ3_XXS** | 61.9 | 61.6 | 58.5 | 57.2 | 49.0 | - |\n| **IQ3_S** | 52.4 | 53.3 | 48.3 | 46.3 | 45.5 | - |\n| **Coder** | 58.9 | 55.1 | 54.9 | 53.2 | 43.0 | 42.8\u2020 |\n| **IQ3_S** (AMD RX 7900 XTX, gfx1100) | 65.1 | 60.4 | 64.4 | 61.8 | 59.2 | - |\n\nEngine 0.1.26, the same runs. The AMD RX 7900 XTX row: engine 0.1.38 on a ROCm 10.2 nightly (tuned\ngfx1100 hipBLASLt-100500 table, upstream as [#755](https://github.com/Niko1221/Strata/pull/755)), median of 3 clean cells per tier (same box; decode is flat in\ncontext - the GDN linear attention is O(1) per token; 1K/4K prefill ran slightly under the 0.1.31\npackaged-ROCm numbers, 32K-128K ahead). \u2020 not measured again: 0.1.14.\n\nOutput speed depends on the text as well: speculative decoding runs faster when more of the drafted tokens are\naccepted, so a different answer to the same prompt moves it by several percent. Run back to back on the 4K prompt,\n0.1.14 writes 88.5 tokens/s and 0.1.12 85.7. The numbers before 0.1.13 (prompts about half as fast):\n[`bench/results/2026-09-24-final`](../bench/results/2026-09-24-final/matrix.md); these:\n[`bench/results/2026-09-28-speed-0114`](../bench/results/2026-09-28-speed-0114/README.md).\n\nIQ3_XXS and IQ3_S at 262K are not measLine truncated
}
],
"response": {
"first": 1.4467779509723186,
"total": 4.02377649769187,
"text": "# Technical Analysis: PolyStrata Engine Design and Implementation\n\n## 1. Executive Summary\n\nPolyStrata is a high-performance inference engine designed to run large language models (LLMs) with **Mixture of Experts (MoE)** architectures on consumer-grade hardware. Its core innovation lies in optimizing the execution of sparse models by dynamically managing the placement of \"expert\" neural network layers between CPU RAM and GPU VRAM.\n\nThe engine prioritizes **context length scalability** and **throughput** over raw peak theoretical performance. It achieves this through a combination of aggressive quantization (down to 2-bit), speculative decoding (MTP), and a sophisticated memory management system that streams Key-Value (KV) caches and maps experts from disk when VRAM is insufficient.\n\n---\n\n## 2. Core Architectural Design\n\n### 2.1 Mixture of Experts (MoE) Management\nUnlike dense models where all parameters are active for every token, MoE models activate only a subset of \"experts\" per layer. PolyStrata treats these experts as distinct, swappable units.\n* **Expert Caching:** The engine maintains a cache of active experts in GPU VRAM. When VRAM is full, less-used experts are evicted to system RAM or mapped directly from disk (`--mmap-experts`).\n* **PCIe Bandwidth Optimization:** The engine calculates the cost of transferring experts over the PCIe bus (`--pcie-frac`) and optimizes the swap strategy to minimize latency during inference.\n\n### 2.2 Quantization Strategy\nPolyStrata supports multiple quantization formats to balance speed, memory usage, and accuracy:\n* **Q2_0 / IQ2_XS:** Extremely low-bit quantization (2-bit). This allows massive models to fit into limited VRAM (e.g., 12GB) but introduces rounding errors.\n* **IQ3_XXS / IQ3_S:** 3-bit quantization, offering a better accuracy/speed trade-off.\n* **Hybrid K8V4:** A novel approach where **Keys** are stored at 8-bit precision and **Values** at 4-bit precision. This reduces KV cache memory by 23% compared to standard 8-bit KV, allowing longer contexts without spilling to RAM, while maintaining better precision than full 4-bit KV.\n\n### 2.3 Speculative Decoding (MTP)\nPolyStrata implements **Multi-Token Prediction (",
"usage": {
"prompt_tokens": 5048,
"completion_tokens": 512,
"total_tokens": 5560,
"prompt_tokens_details": {
"cached_tokens": 0
}
},
"timings": {
"cache_n": 0,
"prompt_n": 5048,
"prompt_ms": 1431.8,
"prompt_per_token_ms": 0.284,
"prompt_per_second": 3525.6,
"predicted_n": 512,
"predicted_ms": 2578.7,
"predicted_per_token_ms": 5.037,
"predicted_per_second": 198.5,
"draft_n": 366,
"draft_n_accepted": 281
},
"err": null,
"pieces": 496
},
"metrics": {
"ok": true,
"err": null,
"ttft_s": 1.447,
"total_s": 4.024,
"prompt_tokens": 5048,
"reused_tokens": 0,
"read_tokens": 5048,
"generated_tokens": 512,
"prompt_tps": 3525.6,
"prompt_tps_source": "engine",
"decode_tps": 198.5,
"decode_tps_source": "engine",
"prompt_ms": 1431.8,
"decode_ms": 2578.7,
"drafts_offered": 366,
"drafts_accepted": 281
}
},
{
"run": 2,
"source": "docs/HOW_IT_WORKS.md",
"messages": [
{
"role": "user",
"content": "Run identifier 2-0. Read the following project documentation and write a detailed technical explanation of its design, tradeoffs, and how someone would use it in practice.\n\n# How does PolyStrata work?\n\nModels like Qwen3.8-Flash-Next normally run on servers with hundreds of gigabytes of graphics memory. Your graphics\ncard has 12-24 GB. PolyStrata makes it fit by **sharing the work across your whole PC** - the same idea as a kitchen, where\nthe things you use all the time stay on the counter and the rest waits in the pantry. Back to the\n[README](../README.md#how-does-it-work).\n\n## Who does what\n\n<p align=\"center\"><img src=\"media/how-it-works.svg\" width=\"860\" alt=\"The model's 24,576 experts: the busiest on the graphics card, all of them in RAM, a lookup table on the SSD\"></p>\n\n- **The model is a team of 24,576 small specialists (\"experts\"),** and each word it writes needs only 10 of them.\n So it doesn't have to have all of them on the graphics card at once.\n- **Your graphics card** does the part of the work needed for every word, and keeps the few thousand experts that\n are asked most often. It keeps learning which ones those are while you use it.\n- **Your RAM** holds every expert. When a word needs one the card doesn't have, **your processor** works on it -\n at the same time as the graphics card, so neither waits for the other.\n- **Your SSD** holds a big lookup table; the model only reads a few small rows of it per word.\n\nThe same in technical terms:\n\n- **GPU (VRAM):** attention and DeltaNet mixers, the gated-residual weights, routers, shared experts, output head, the\n MTP draft layer, the KV cache (from 64K: only its most-read part, the rest streams from RAM), and an **expert\n cache** that fills the rest of VRAM with the most-used experts (it adapts to the conversation while you chat).\n More VRAM matters more than a faster GPU: every extra GB holds ~700 more experts, and every expert on the GPU is one\n the CPU does not have to compute.\n- **RAM:** all 24,576 experts, pinned. The CPU computes the experts that are not on the GPU **in place**, at the same\n time as the GPU works on the cached ones (AVX-512 / AVX2 kernels, ggml's for the i-quants). On a PC with little RAM\n and a big card, the [low-RAM mode](MODELS.md#a-big-graphics-card-and-little-ram) keeps in RAM only what the GPU does\n not hold.\n- **SSD:** the 28.8 GB n-gram table, read a few rows per token through the OS cache.\n\nThis works the same on NVIDIA (CUDA) and AMD (HIP) cards: the same engine, compiled for each.\n\n## Guess, then check\n\n<p align=\"center\"><img src=\"media/guess-and-check.svg\" width=\"860\" alt=\"A small helper guesses the next words; the big model checks them all at once and keeps the right ones\"></p>\n\n- **Guess, then check.** A small, fast helper built into the model guesses the next few words, and the big model\n checks all the guesses in one go. It keeps the ones it agrees with and writes the next word itself - so one step\n often produces several words. The helper only guesses - the big model decides every word - so you get the same\n quality answer, 1.6-1.8x sooner.\n- In technical terms: the model's own MTP layer drafts up to 3 tokens; one pass over all 48 layers checks them, 2.4-3.2\n tokens per pass on average. When the reply repeats the context (code edits, quoted text), **prompt lookup** drafts\n up to 5 tokens from the earlier copy, but only where its measured acceptance and cost say it pays: code edits 6-11%\n faster, other text unchanged. The drafts are checked like the MTP's, so the output is the same.\n\n## Reading long texts\n\n**Long texts are read in big pieces** (up to 8,192 tokens - pieces of words - at a time), which is why a long\ndocument or code base is read at over 1,000 tokens per second. The experts of the next layer stream to the GPU over\nPCIe while the current layer's attention runs. After the first message, PolyStrata keeps the conversation and reads only\nwhat is new, so follow-ups start in seconds.\n\n## More\n\nThe [details](DETAILS.md#how-it-works) explain every part and its numbers, and the\n[paper](paper/Strata-Paper.pdf) tells the whole story, with the measurements behind it.\n\n## Credits\n\n- PolyStrata is built on [Strata](https://github.com/Niko1221/Strata) by Niko1221 and its contributors. The Qwen\n engine, the installer, the server and the web app are that project's work. PolyStrata adds the engine for GLM 5.3\n Flash ([GLM.md](GLM.md)), whose file is from\n [neuralll](https://huggingface.co/neuralll/GLM-5.3-Flash-GSQ-RCO-3.0bit-Q4Kattn-GGUF).\n- Model: [Qwen3.8-Flash-Next](https://huggingface.co/Qwen/Qwen3.8-Flash-Next) by the Qwen team; compressed versions by\n [ISTA-DASLab](https://huggingface.co/ISTA-DASLab/Qwen3.8-Flash-Next-GSQ-RCO-GGUF);\n [Swift 1.5](https://huggingface.co/ukisai/Swift-1.5-Qwen3.8-Flash-Next-GSQ-RCO-GGUF) by UkisAI; the experimental\n [UD-Q4_K_XL](https://huggingface.co/unsloth/Line truncated
}
],
"response": {
"first": 0.5561875235289335,
"total": 2.8235677871853113,
"text": "Based on the provided documentation, here is a detailed technical explanation of the **PolyStrata** architecture, its design philosophy, tradeoffs, and practical usage.\n\n### 1. Core Design Philosophy: Hierarchical Memory & Parallelism\n\nPolyStrata is a runtime engine designed to run large-scale Mixture-of-Experts (MoE) models (specifically **Qwen3.8-Flash-Next**) on consumer-grade hardware with limited VRAM (12\u201324 GB). The core innovation is treating the entire PC as a unified compute resource rather than relying solely on the GPU.\n\nThe architecture is built on three key pillars:\n1. **Expert Caching:** Only the most frequently used \"experts\" (neural network sub-modules) reside in VRAM.\n2. **CPU-GPU Parallelism:** The CPU computes experts not present in VRAM simultaneously with the GPU processing cached experts.\n3. **Speculative Decoding:** A \"guess-and-check\" mechanism accelerates token generation without sacrificing quality.\n\n---\n\n### 2. Technical Architecture Breakdown\n\n#### A. The Model Structure: 24,576 Experts\nThe underlying model, Qwen3.8-Flash-Next, is a massive MoE model with **24,576 experts**. However, for any single token generation, only **10 experts** are activated. This sparsity allows the system to avoid loading all experts into VRAM at once.\n\n#### B. Memory Hierarchy & Data Flow\n\n| Component | Role | Technical Details |\n| :--- | :--- | :--- |\n| **GPU (VRAM)** | **High-Speed Compute & Cache** | Holds: <br>- Attention & DeltaNet mixers<br>- Gated-residual weights, routers, shared experts<br>- Output head & MTP draft layer<br>- KV Cache (partial: only the most-read part of 64K context; rest streams from RAM)<br>- **Expert Cache**: Dynamically fills remaining VRAM with the most-used experts. Adapts during conversation. |\n| **RAM** | **Full Expert Repository** | Holds **all 24,576 experts** (pinned memory).<br>- CPU computes experts *not* in VRAM **in-place**.<br>- Uses AVX-512/AVX2 kernels (ggml for i-quants).<br>- **Low-RAM Mode**: If RAM",
"usage": {
"prompt_tokens": 1696,
"completion_tokens": 512,
"total_tokens": 2208,
"prompt_tokens_details": {
"cached_tokens": 0
}
},
"timings": {
"cache_n": 0,
"prompt_n": 1696,
"prompt_ms": 545.9,
"prompt_per_token_ms": 0.322,
"prompt_per_second": 3106.8,
"predicted_n": 512,
"predicted_ms": 2268.5,
"predicted_per_token_ms": 4.431,
"predicted_per_second": 225.7,
"draft_n": 372,
"draft_n_accepted": 313
},
"err": null,
"pieces": 495
},
"metrics": {
"ok": true,
"err": null,
"ttft_s": 0.556,
"total_s": 2.824,
"prompt_tokens": 1696,
"reused_tokens": 0,
"read_tokens": 1696,
"generated_tokens": 512,
"prompt_tps": 3106.8,
"prompt_tps_source": "engine",
"decode_tps": 225.7,
"decode_tps_source": "engine",
"prompt_ms": 545.9,
"decode_ms": 2268.5,
"drafts_offered": 372,
"drafts_accepted": 313
}
},
{
"run": 2,
"source": "docs/INSTALL.md",
"messages": [
{
"role": "user",
"content": "Run identifier 2-1. Read the following project documentation and write a detailed technical explanation of its design, tradeoffs, and how someone would use it in practice.\n\n# Installing PolyStrata\n\nEverything about installing, starting, updating and configuring PolyStrata, on Windows and Linux, with an NVIDIA or an\nAMD graphics card. The short version is in the [README](../README.md#install); an AI coding assistant can do all of\nthis for you with [AI_SETUP.md](AI_SETUP.md).\n\n> **On this page:** [What you need](#what-you-need) \u00b7 [Windows](#windows) \u00b7 [Linux](#linux) \u00b7\n> [AMD cards](#amd-cards) \u00b7 [Several cards](#two-or-three-cards) \u00b7 [Docker](#docker-linux) \u00b7\n> [Older CPUs](#older-cpus-experimental) \u00b7 [Updating](#updating) \u00b7 [Where things are stored](#where-things-are-stored) \u00b7\n> [Setup's questions](#setups-questions) \u00b7 [Tuning](#tuning-for-your-pc) \u00b7 [All options](#options-without-questions)\n\n## What you need\n\nThis is for Qwen3.8-Flash-Next. GLM 5.3 Flash needs Linux, one NVIDIA card and far more RAM:\n[GLM.md](GLM.md#what-you-need). The three smaller models (Qwen3.6-35B-A3B, Ornith 1.5, Gemma 4 26B-A4B) need Linux\nor Windows, one NVIDIA card and less of everything: [BACKENDS.md](BACKENDS.md#install).\n\n| | |\n| --- | --- |\n| **GPU** | **NVIDIA** RTX 20, 30, 40 or 50 series, **12 GB VRAM or more** (8 GB runs, slowly). Measured on an RTX 5070 and an RTX 3090; RTX 20 (Turing, since 0.1.27) was tested by a contributor on an RTX 2070. **AMD** Radeon RX 7900 XT / XTX, RX 9070 / 9070 XT and Radeon AI PRO R9700 (validated), RX 7800 XT / 7700 XT and RX 9060 XT (validated by their owners), RX 6800 / 6900 series (community-reported), with 12 GB of VRAM or more. See [AMD cards](#amd-cards). |\n| **RAM** | Enough for the size you pick ([which model](MODELS.md#pick-by-ram)); **64 GB** runs every size. A big GPU makes up for less RAM - the [low-RAM mode](MODELS.md#a-big-graphics-card-and-little-ram). |\n| **CPU** | x86-64 with AVX2 (any Intel/AMD desktop CPU from the last ~8 years). AVX-512 (Ryzen 7000/9000) is a bit faster. Older CPUs without AVX2 are experimental and slow: [Older CPUs](#older-cpus-experimental). |\n| **Disk** | ~70-80 GB free for the model, ~6 GB for the MTP layer (+1 GB with images). **Q2_0 on an AVX-512 CPU** also writes a one-time ~40 GB copy of its experts for the fast CPU kernel. On Linux with an AMD card, ROCm takes ~10 GB more when setup installs it. An NVMe SSD is strongly recommended: it makes the first start much faster. |\n| **OS** | Windows 10/11, or Linux (Ubuntu 22.04/24.04 and Debian 12/13 get everything installed automatically). |\n| **Driver** | **NVIDIA:** a current driver, version 580 or newer ([nvidia.com/drivers](https://www.nvidia.com/drivers) or the NVIDIA App). **AMD:** on Linux the kernel's amdgpu driver (no ROCm install needed); on Windows a current AMD Software: Adrenalin Edition driver ([amd.com/support](https://www.amd.com/en/support)). |\n\nThe driver is the only thing you install yourself. Everything else - Python, the engine, the model - is set up for\nyou the first time: Python 3.12 if you have none (for your user account, no admin), a private Python environment in\n`.venv/`, the PolyStrata engine, the model and the MTP draft layer. On NVIDIA it uses the ready-made engine for RTX\n20/30/40/50 and NVIDIA's CUDA libraries from pip (~0.4 GB); if no ready-made engine fits your PC, it offers to install\nthe build tools (Visual Studio Build Tools + CUDA Toolkit on Windows, `build-essential` + CUDA on Ubuntu) and compiles\nthe engine for your GPU (asks first; 20-40 minutes once). More: [details](DETAILS.md#before-you-start).\n\n## Windows\n\n1. [Download this project](https://github.com/VecSzn/PolyStrata/archive/refs/heads/main.zip) and unzip it (or\n `git clone` it).\n2. Double-click **`START-HERE.bat`**.\n3. Answer a few questions - or just press Enter each time for the recommended choice ([the questions](#setups-questions)).\n\nThen it downloads everything (the model is ~70 GB, so the first time takes a while - you can stop and it picks up\nwhere it left off) and **starts the model**. Your browser opens the PolyStrata app at `http://127.0.0.1:8080`.\n\n> **While the model starts, your PC can be slow or stop responding for 1-3 minutes** (longest the first time): PolyStrata\n> loads 35-55 GB into your RAM and locks part of it for the graphics card. That's normal - wait, and don't close the\n> window. The window tells you what it is doing.\n\n**Next time**, just double-click `START-HERE.bat` again: it starts right away (30-90 s to load the model), nothing is\ndownloaded twice. Close its window to stop the model. `SETUP.bat` (the same as `START-HERE.bat --setup`) installs\nanother model or changes the settings. Starting PolyStrata from Task Scheduler at logon needs two task settings, or the\nstart is 24x slower: [Running it at startup](DETAILS.md#running-it-at-startup-task-scheduler).\n\Line truncated
}
],
"response": {
"first": 1.3054853491485119,
"total": 3.7707394436001778,
"text": "# Technical Analysis: PolyStrata Project (Run Identifier 2-1)\n\n## 1. Executive Summary\nPolyStrata is a high-performance, local Large Language Model (LLM) inference engine designed to run quantized models (specifically Qwen3.8-Flash-Next and others) on consumer-grade hardware. It abstracts the complexity of setting up Python environments, CUDA/ROCm drivers, and model weights into a single automated installation process. The system is optimized for low-latency inference using a \"MTP\" (Multi-Token Prediction) draft layer and supports heterogeneous hardware configurations, including multi-GPU setups and older CPUs.\n\n## 2. System Architecture & Design\n\n### 2.1 Core Components\nThe architecture is built around three primary layers:\n1. **The Engine (Backend):** A compiled C++/CUDA (or HIP for AMD) binary responsible for tensor operations. It supports multiple instruction sets (AVX2, AVX-512, AVX, SSE4.2) to accommodate varying CPU capabilities.\n2. **The Model Weights:** Stored in GGUF format, utilizing advanced quantization schemes (e.g., Q2_0, IQ2_XS, IQ3_XXS). These are split into \"experts\" for Mixture-of-Experts (MoE) models.\n3. **The MTP Layer:** A draft mechanism that predicts multiple tokens ahead to accelerate decoding. This layer adds ~6 GB to the storage footprint but significantly improves throughput.\n\n### 2.2 Hardware Abstraction Layer\nPolyStrata employs a dynamic hardware detection system:\n* **NVIDIA:** Uses CUDA libraries. It attempts to load pre-compiled binaries for RTX 20/30/40/50 series. If no binary matches the GPU architecture, it triggers a one-time compilation using Visual Studio Build Tools (Windows) or `build-essential` (Linux).\n* **AMD:** Uses HIP/ROCm. On Linux, it leverages the system kernel driver (`amdgpu`) and installs ROCm wheels into a virtual environment. On Windows, it relies on the Adrenalin driver.\n* **CPU Fallback:** For models with CPU-bound experts, the engine dynamically selects the appropriate instruction set (AVX-512 > AVX2 > AVX > SSE4.2) based on the host CPU.\n\n### 2.3 Memory Management Strategy\n*",
"usage": {
"prompt_tokens": 4370,
"completion_tokens": 512,
"total_tokens": 4882,
"prompt_tokens_details": {
"cached_tokens": 0
}
},
"timings": {
"cache_n": 0,
"prompt_n": 4370,
"prompt_ms": 1292.2,
"prompt_per_token_ms": 0.296,
"prompt_per_second": 3381.8,
"predicted_n": 512,
"predicted_ms": 2466.5,
"predicted_per_token_ms": 4.817,
"predicted_per_second": 207.6,
"draft_n": 359,
"draft_n_accepted": 288
},
"err": null,
"pieces": 497
},
"metrics": {
"ok": true,
"err": null,
"ttft_s": 1.305,
"total_s": 3.771,
"prompt_tokens": 4370,
"reused_tokens": 0,
"read_tokens": 4370,
"generated_tokens": 512,
"prompt_tps": 3381.8,
"prompt_tps_source": "engine",
"decode_tps": 207.6,
"decode_tps_source": "engine",
"prompt_ms": 1292.2,
"decode_ms": 2466.5,
"drafts_offered": 359,
"drafts_accepted": 288
}
},
{
"run": 2,
"source": "docs/DETAILS.md",
"messages": [
{
"role": "user",
"content": "Run identifier 2-2. Read the following project documentation and write a detailed technical explanation of its design, tradeoffs, and how someone would use it in practice.\n\n# PolyStrata - the details\n\nThe technical side of PolyStrata: every measured number, the API, images, all settings and how the engine works.\nNew here? Start with the [README](../README.md); installing step by step is in [INSTALL.md](INSTALL.md), the models in\n[MODELS.md](MODELS.md), common problems in [TROUBLESHOOTING.md](TROUBLESHOOTING.md).\n\n> **On this page:** [Speed](#speed-measured) \u00b7 [Other GPUs](#other-gpus-estimated) \u00b7 [Which model?](#which-model) \u00b7\n> [Requirements](#before-you-start) \u00b7 [Windows](#windows) \u00b7 [Linux](#linux) \u00b7 [API](#using-it) \u00b7\n> [MCP tools](#tools-from-mcp-servers) \u00b7 [MCP server](#manage-strata-from-your-ai-assistant-mcp-server) \u00b7\n> [Images](#images-vision) \u00b7\n> [Troubleshooting](#troubleshooting) \u00b7 [How it works](#how-it-works)\n\n---\n\n## Speed (measured)\n\nRTX 5070 **12 GB**, Ryzen 5 7600 (6 cores), 64 GB DDR5-5200, Windows, engine 0.1.26 with the settings setup writes\n(`--prefill auto`, 8-bit KV above 4K, KV streaming from 64K). One code-agent prompt per length, 256 generated tokens,\nMTP speculative decoding on. \"262K\" is the model's full context window (a 259,943-token prompt). The IQ2_XS row was\nmeasured with Swift 1.5's IQ2_XS, which runs at the original's speed.\n\n**Engine 0.1.36 (#136), the same PC:** Q2_0's prompt experts run on fused int8 tensor-core kernels (RTX 30 and newer):\n4K 1,294 -> 1,570, 32K 2,170 -> 2,653, 128K 2,123 -> 2,468 tokens/s (+16-22%), as close to an FP16 reference as the\nprevious kernels (closer at 32K: teacher-forced KL 0.009 vs 0.012). The decode path's block selection and greedy\nargmax run on thread-block clusters (RTX 50, sm_90+; other cards keep the previous kernels; the same tokens): Q2_0 output at 4K 89 -> 93.5, at 128K\n64.5 -> 76.4 tokens/s. `STRATA_PF_FUSED=0` keeps the previous prompt kernels (byte-identical answers to 0.1.35);\n`STRATA_PF_FUSED=1` also runs the native IQ packs' fused kernels (opt-in: IQ2_XS prompts +12% at 4K, +3% at 32K, the\nIQ3 packs about even; on HIP they run on gfx11 and on gfx1200 / gfx1201, see AMD_HIP.md); `STRATA_QSA_CLUSTER=0` / `STRATA_ARGMAX_MULTI=0` turn the decode kernels off. The tables\nbelow are 0.1.26's.\n\n### Prompt processing (tokens/s)\n\n| Model | 1K | 4K | 32K | 64K | 128K | 262K |\n| --- | ---: | ---: | ---: | ---: | ---: | ---: |\n| **Q2_0** | 536 | 1,299 | 2,171 | 2,126 | 2,107 | 1,304\u2020 |\n| **IQ2_XS** | 534 | 1,256 | 2,092 | 1,754 | 1,752 | 1,181*\u2020 |\n| **IQ3_XXS** | 482 | 1,007 | 1,745 | 1,609 | 1,602 | - |\n| **IQ3_S** | 427 | 913 | 1,624 | 1,640 | 1,443 | - |\n| **Coder** | 656 | 1,583 | 2,177 | 2,236 | 2,208 | 1,034** |\n| **IQ3_S** (AMD RX 7900 XTX, gfx1100) | 760 | 1,275 | 1,641 | 1,594 | 1,494 | - |\n\nEngine 0.1.26; `bench/results/2026-09-29-speed-0126`. The AMD RX 7900 XTX row: engine 0.1.38 on a ROCm\n10.2 nightly with a tuned gfx1100 hipBLASLt-100500 table (upstream as [#755](https://github.com/Niko1221/Strata/pull/755)),\nthe median of 3 clean cells per tier\n(Ryzen 9 7900X, 96 GB; 1K-128K one-shot runs, 256 generated tokens,\ngreedy). At 32K-128K that is 8-28% faster than 0.1.22. \u2020 not measured\nagain: 0.1.22. \\* measured with images on (the image encoder's VRAM reserve leaves fewer experts cached). \\*\\* not\nmeasured again: 0.1.14.\n\n### Output (tokens/s)\n\n| Model | 1K | 4K | 32K | 64K | 128K | 262K |\n| --- | ---: | ---: | ---: | ---: | ---: | ---: |\n| **Q2_0** | 87.3 | 93.0 | 81.8 | 76.2 | 73.7 | 60.3\u2020 |\n| **IQ2_XS** | 79.6 | 78.6 | 76.3 | 63.7 | 62.7 | 52.8\u2020 |\n| **IQ3_XXS** | 61.9 | 61.6 | 58.5 | 57.2 | 49.0 | - |\n| **IQ3_S** | 52.4 | 53.3 | 48.3 | 46.3 | 45.5 | - |\n| **Coder** | 58.9 | 55.1 | 54.9 | 53.2 | 43.0 | 42.8\u2020 |\n| **IQ3_S** (AMD RX 7900 XTX, gfx1100) | 65.1 | 60.4 | 64.4 | 61.8 | 59.2 | - |\n\nEngine 0.1.26, the same runs. The AMD RX 7900 XTX row: engine 0.1.38 on a ROCm 10.2 nightly (tuned\ngfx1100 hipBLASLt-100500 table, upstream as [#755](https://github.com/Niko1221/Strata/pull/755)), median of 3 clean cells per tier (same box; decode is flat in\ncontext - the GDN linear attention is O(1) per token; 1K/4K prefill ran slightly under the 0.1.31\npackaged-ROCm numbers, 32K-128K ahead). \u2020 not measured again: 0.1.14.\n\nOutput speed depends on the text as well: speculative decoding runs faster when more of the drafted tokens are\naccepted, so a different answer to the same prompt moves it by several percent. Run back to back on the 4K prompt,\n0.1.14 writes 88.5 tokens/s and 0.1.12 85.7. The numbers before 0.1.13 (prompts about half as fast):\n[`bench/results/2026-09-24-final`](../bench/results/2026-09-24-final/matrix.md); these:\n[`bench/results/2026-09-28-speed-0114`](../bench/results/2026-09-28-speed-0114/README.md).\n\nIQ3_XXS and IQ3_S at 262K are not measLine truncated
}
],
"response": {
"first": 1.4746413584798574,
"total": 3.9815917275846004,
"text": "# Technical Analysis: PolyStrata Engine (Run Identifier 2-2)\n\n## 1. Executive Summary\nPolyStrata is a high-performance inference engine designed for running large language models (LLMs) with **Mixture of Experts (MoE)** architectures on consumer-grade hardware. Its core innovation lies in optimizing the memory bandwidth bottleneck inherent in MoE models by using aggressive quantization (down to 2-bit), dynamic expert caching, and specialized kernel optimizations for both prompt processing (prefill) and token generation (decode).\n\nThe engine is particularly notable for its handling of **long-context windows** (up to 262K tokens) via KV cache streaming and hybrid precision, allowing models that require 40-50GB+ of VRAM to run on cards with as little as 8-12GB.\n\n---\n\n## 2. Core Design & Architecture\n\n### 2.1 Mixture of Experts (MoE) Management\nUnlike dense models where all parameters are active per token, PolyStrata activates only a subset of \"experts\" per layer.\n* **Expert Caching:** The engine maintains a pool of experts in VRAM. Less frequently used experts are swapped out to system RAM or disk (via `mmap`).\n* **Dynamic Swapping:** The engine dynamically moves experts between VRAM and RAM based on usage frequency (`adapt-swaps`). This allows fitting larger models than the physical VRAM would normally allow.\n* **Low-RAM Mode:** If system RAM is insufficient to hold all experts, the engine maps the expert file directly from disk (`--mmap-experts`), relying on the OS file cache. This trades latency for capacity.\n\n### 2.2 Quantization Strategy\nPolyStrata supports multiple quantization formats to balance speed, memory, and accuracy:\n* **Q2_0:** 2-bit quantization. Highest speed, lowest VRAM usage.\n* **IQ2_XS / IQ3_XXS / IQ3_S:** Intelligent Quantization formats. These use non-uniform bit allocation to preserve accuracy for important weights while keeping the model small.\n* **KV Cache Quantization:**\n * **8-bit (Default):** Balanced precision.\n * **4-bit (Q4_0):** Halves KV cache memory but introduces ~4-12% perplexity increase. Uses Hadamard rotation before rounding to minimize error.\n * **",
"usage": {
"prompt_tokens": 5048,
"completion_tokens": 512,
"total_tokens": 5560,
"prompt_tokens_details": {
"cached_tokens": 0
}
},
"timings": {
"cache_n": 0,
"prompt_n": 5048,
"prompt_ms": 1459.5,
"prompt_per_token_ms": 0.289,
"prompt_per_second": 3458.7,
"predicted_n": 512,
"predicted_ms": 2508.0,
"predicted_per_token_ms": 4.898,
"predicted_per_second": 204.1,
"draft_n": 352,
"draft_n_accepted": 284
},
"err": null,
"pieces": 494
},
"metrics": {
"ok": true,
"err": null,
"ttft_s": 1.475,
"total_s": 3.982,
"prompt_tokens": 5048,
"reused_tokens": 0,
"read_tokens": 5048,
"generated_tokens": 512,
"prompt_tps": 3458.7,
"prompt_tps_source": "engine",
"decode_tps": 204.1,
"decode_tps_source": "engine",
"prompt_ms": 1459.5,
"decode_ms": 2508.0,
"drafts_offered": 352,
"drafts_accepted": 284
}
}
]
@@ -0,0 +1,118 @@
#!/usr/bin/env python3
"""UnbiasedStrata 2, step 9 (PLAN.md section 11): upstream PolyStrata v0.1.45-poly.1 and the fork, back to back on the
same card, same model files, same context, greedy, the same client (upstream's tools/strata_bench.py, --runs 3 --long,
plus the three-document sustained supplement of the 2026-10-17 upstream run). One directory per arm under OUT.
Runs on the pod with upstream's venv: /opt/polystrata-v0.1.45-poly.1/.venv/bin/python us2-step9-run.py OUT [arm ...]"""
import sys, pathlib, subprocess, json, time, hashlib, statistics, os, shutil
ROOT = pathlib.Path('/opt/polystrata-v0.1.45-poly.1')
sys.path.insert(0, str(ROOT / 'tools'))
import strata_bench as bench # noqa: E402
PY = str(ROOT / '.venv/bin/python')
FORK = pathlib.Path('/opt/us2-build')
M = pathlib.Path('/opt/us2-models')
OUT = pathlib.Path(sys.argv[1]); OUT.mkdir(parents=True, exist_ok=True)
FN1 = M / 'IQ3_XXS/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00001-of-00002.gguf'
FN2 = M / 'IQ3_XXS/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00002-of-00002.gguf'
PACK = M / 'pack-iq3-xxs'; MTP = M / 'mtp'
Q36 = M / 'qwen36-mtp/Qwen3.6-35B-A3B-UD-Q3_K_M.gguf'
FN_ENGINE_ARGS = ['--pack', str(PACK), '--native', str(FN1), '--ple-gguf', str(FN2), '--expert-profile', str(PACK / 'expert-profile.bin'),
'--expert-cache', 'auto', '--prefill', 'auto', '--spec', '4', '--spec-min-p', '0.5', '--mtp', str(MTP),
'--max-context', '65536', '--kv', 'int8', '--ple-io', 'ram', '--pool-workers', '15', '--kv-resident', '32768']
def q36_args(profile): return ['--model', str(Q36), '--max-context', '32768', '--expert-profile', profile, '--tail-skip', '6']
UP_POLY = ROOT / 'build/strata-poly'
if not UP_POLY.exists():
UP_POLY = FORK / 'build/bin/strata-poly' # recorded in the arm's provenance if it happens
def sha(p): h = hashlib.sha256(); f = open(p, 'rb'); [h.update(b) for b in iter(lambda: f.read(1 << 22), b'')]; return h.hexdigest()
ARMS = {
'upstream-flash-next': dict(port=18080, model='qwen3.8-flash-next-iq3_xxs', engine=str(ROOT / 'build/strata'),
cfg=lambda d: {'exe': str(ROOT / 'build/strata'), 'cwd': str(ROOT), 'tokenizer': str(PACK / 'tokenizer'), 'model_name': 'qwen3.8-flash-next-iq3_xxs',
'log': str(d / 'engine.log'), 'args': FN_ENGINE_ARGS, 'sampling': {'temperature': 0.6, 'top_p': 0.95, 'top_k': 20, 'min_p': 0.0}, 'fit_max_tokens': True},
cmd=lambda d, cfg: [PY, str(ROOT / 'serve/server.py'), '--engine', 'strata', '--config', str(cfg), '--host', '127.0.0.1', '--port', '18080']),
'fork-flash-next': dict(port=18090, model='qwen3.8-flash-next-iq3_xxs', engine=str(FORK / 'build/bin/strata'),
cfg=lambda d: {'exe': str(FORK / 'build/bin/unbiased-strata'), 'engine': str(FORK / 'build/bin/strata'), 'model_name': 'qwen3.8-flash-next-iq3_xxs', 'args': FN_ENGINE_ARGS},
cmd=lambda d, cfg: [str(FORK / 'build/bin/unbiased-strata'), '--engine', str(FORK / 'build/bin/strata'), '-m', str(FN1), '--host', '127.0.0.1', '--port', '18090',
'--alias', 'qwen3.8-flash-next-iq3_xxs', '--'] + FN_ENGINE_ARGS),
'upstream-qwen36-q3km': dict(port=18080, model='qwen3.6-35b-a3b-ud-q3_k_m', engine=str(UP_POLY),
cfg=lambda d: {'exe': str(UP_POLY), 'cwd': str(ROOT), 'tokenizer': str(M / 'qwen36-mtp/pack-q3km/tokenizer'), 'model_name': 'qwen3.6-35b-a3b-ud-q3_k_m',
'log': str(d / 'engine.log'), 'args': q36_args(str(d / 'expert-profile.txt')), 'sampling': {'temperature': 0.6, 'top_p': 0.95, 'top_k': 20, 'min_p': 0.0}, 'fit_max_tokens': True},
cmd=lambda d, cfg: [PY, str(ROOT / 'serve/server.py'), '--engine', 'strata', '--config', str(cfg), '--host', '127.0.0.1', '--port', '18080']),
'fork-qwen36-q3km': dict(port=18091, model='qwen3.6-35b-a3b-ud-q3_k_m', engine=str(FORK / 'build/bin/strata-poly'),
cfg=lambda d: {'exe': str(FORK / 'build/bin/unbiased-strata'), 'engine': str(FORK / 'build/bin/strata-poly'), 'model_name': 'qwen3.6-35b-a3b-ud-q3_k_m', 'args': q36_args(str(d / 'expert-profile.txt'))},
cmd=lambda d, cfg: [str(FORK / 'build/bin/unbiased-strata'), '--engine', str(FORK / 'build/bin/strata-poly'), '-m', str(Q36), '--host', '127.0.0.1', '--port', '18091',
'--alias', 'qwen3.6-35b-a3b-ud-q3_k_m', '--'] + q36_args(str(d / 'expert-profile.txt'))),
}
order = sys.argv[2:] or list(ARMS)
def stat(v):
v = [x for x in v if isinstance(x, (int, float))] # the fork streams no usage block, so prompt_tokens may be None
return {'median': statistics.median(v), 'min': min(v), 'max': max(v), 'n': len(v)} if v else None
def summarize(d):
c = json.loads(next((d / 'community').rglob('results.json')).read_text()); r = c['results']
s = json.loads((d / 'sustained.json').read_text())
rows = r['chat']['requests'] + [q for v in r['prompts'].values() for q in v['requests']] + [q for v in r['agent']['sessions'] for q in v] + [x['metrics'] for x in s]
checks = {'requests': len(rows), 'all_successful': all(x['ok'] for x in rows), 'skipped': r['skipped'], 'failures': r['failures']}
sust = {k: stat(x['metrics'][k] for x in s) for k in ['decode_tps', 'prompt_tps', 'ttft_s', 'total_s']}
off = sum(x['metrics'].get('drafts_offered') or 0 for x in s)
sust['draft_acceptance_pct'] = 100 * sum(x['metrics'].get('drafts_accepted') or 0 for x in s) / off if off else None
per = {}
for rel in sorted({x['source'] for x in s}):
xs = [x['metrics'] for x in s if x['source'] == rel]
per[rel] = {k: stat(x[k] for x in xs) for k in ['prompt_tokens', 'decode_tps', 'prompt_tps', 'ttft_s', 'total_s']}
summary = {'checks': checks, 'sustained': sust, 'chat': r['chat'].get('decode_tps'), 'chat_ttft_s': r['chat'].get('ttft_s'),
'prefill': {k: v['prompt_tps'] for k, v in r['prompts'].items()}, 'prefill_ttft_s': {k: v['ttft_s'] for k, v in r['prompts'].items()},
'agent': {k: r['agent'].get(k) for k in ('turn_decode_tps', 'turn_ttft_s', 'turn_prompt_tps') if r['agent'].get(k) is not None}, 'per_document': per}
(d / 'summary.json').write_text(json.dumps(summary, indent=1) + '\n'); return summary
def run_arm(name):
a = ARMS[name]; d = OUT / name; d.mkdir(parents=True, exist_ok=True)
cfg = d / 'server.json'; cfg.write_text(json.dumps(a['cfg'](d), indent=1) + '\n')
cmd = a['cmd'](d, cfg); (d / 'server-command.json').write_text(json.dumps(cmd, indent=1) + '\n')
prov = {'arm': name, 'engine_binary': a['engine'], 'engine_sha256': sha(a['engine']), 'fork_commit': subprocess.run(['git', '-C', str(FORK), 'rev-parse', 'HEAD'], capture_output=True, text=True).stdout.strip(),
'nvidia_smi': subprocess.run(['nvidia-smi', '--query-gpu=name,driver_version,memory.total', '--format=csv,noheader'], capture_output=True, text=True).stdout.strip(),
'cpu_quota': (open('/sys/fs/cgroup/cpu/cpu.cfs_quota_us').read().strip() + '/' + open('/sys/fs/cgroup/cpu/cpu.cfs_period_us').read().strip()) if os.path.exists('/sys/fs/cgroup/cpu/cpu.cfs_quota_us') else 'n/a',
'started_utc': time.strftime('%Y-%m-%dT%H:%M:%SZ', time.gmtime())}
(d / 'provenance.json').write_text(json.dumps(prov, indent=1) + '\n')
base = f"http://127.0.0.1:{a['port']}"
log = open(d / 'server.log', 'w')
proc = subprocess.Popen(cmd, cwd=ROOT, stdout=log, stderr=subprocess.STDOUT)
ok = False
try:
if not bench.wait_ready(base, '', proc, 1800, lambda s: print(f'[{name}] {s}', flush=True)):
raise RuntimeError('server failed to start; see server.log')
(d / 'health.json').write_text(json.dumps(bench.http_json(base, '/health'), indent=1))
bcmd = [PY, str(ROOT / 'tools/strata_bench.py'), '--url', base, '--config', str(cfg), '--runs', '3', '--long', '--out', str(d / 'community')]
(d / 'benchmark-command.json').write_text(json.dumps(bcmd, indent=1))
t0 = time.time(); subprocess.run(bcmd, cwd=ROOT, check=True); bench_s = time.time() - t0
rows = []
for run in range(3):
for i, rel in enumerate(['docs/HOW_IT_WORKS.md', 'docs/INSTALL.md', 'docs/DETAILS.md']):
body = (ROOT / rel).read_text()[:14000]
messages = [{'role': 'user', 'content': f'Run identifier {run}-{i}. Read the following project documentation and write a detailed technical explanation of its design, tradeoffs, and how someone would use it in practice.\n\n{body}'}]
response = bench.chat(base, '', messages, 512, False)
row = {'run': run, 'source': rel, 'messages': messages, 'response': response, 'metrics': bench.digest(response)}
rows.append(row); (d / 'sustained.json').write_text(json.dumps(rows, indent=1))
print(f'[{name}] SUSTAINED {rel} {run} {json.dumps(row["metrics"])}', flush=True)
if not row['metrics']['ok']: raise RuntimeError('sustained request failed')
ok = True
(d / 'complete.json').write_text(json.dumps({'complete': True, 'bench_seconds': bench_s, 'finished_utc': time.strftime('%Y-%m-%dT%H:%M:%SZ', time.gmtime())}, indent=1))
finally:
bench.stop_server(proc)
for _ in range(30):
if proc.poll() is not None: break
time.sleep(1)
log.close()
subprocess.run(['pkill', '-x', 'unbiased-strata']); subprocess.run(['pkill', '-x', 'strata']); subprocess.run(['pkill', '-x', 'strata-poly']); time.sleep(5)
(d / 'server-exit.json').write_text(json.dumps({'returncode': proc.poll()}))
if ok:
print(f'[{name}] SUMMARY ' + json.dumps({k: summarize(d)[k] for k in ('chat', 'prefill', 'sustained')}, default=str)[:1500], flush=True)
if os.environ.get('US2_SUMMARIZE_ONLY'):
for name in order: print(f'[{name}] SUMMARY ' + json.dumps({k: summarize(OUT / name)[k] for k in ('chat', 'prefill', 'sustained')}, default=str)[:1500], flush=True)
sys.exit(0)
for name in order:
print(f'===== {name} {time.strftime("%H:%M:%S")} =====', flush=True)
run_arm(name)
print('ALL ARMS DONE', flush=True)
+2 -2
View File
@@ -9,8 +9,8 @@ with correct text, streaming, a tool call and reasoning, through `frontend/tests
| File | Source | Size (bytes) | SHA-256 | Engine | Boxes | Status |
| --- | --- | --- | --- | --- | --- | --- |
| `Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00001-of-00002.gguf` + `-00002-of-00002.gguf`, with `pack-iq3-xxs/` and `mtp/` made by upstream's `tools/iq_pack.py` and `tools/mtp_rt.py` | Niko1221 Strata GSQ-RCO release; pack and MTP built 2026-10-05 (`artifacts.sha256` on the pod) | 47,039,860,096 + 28,800,138,432 | shards unhashed; pack `dense.bin` `d2af3d83…`, mtp `dense.bin` `c724dc0b…` (full hashes in `bench/unbiased/*/engine-info.txt`) | `strata` | RTX 3090 pod, A6000 VM | works (2026-10-17: A6000 `bench/unbiased/2026-10-17-a6000-flash-next-iq3xxs-step6/`, RTX 3090 pod `…-3090pod-flash-next-iq3xxs-step6/`; the greedy answers of the two boxes are identical, and identical to upstream PolyStrata v0.1.45-poly.1 on the same files on the pod: `…-3090pod-…/upstream-compare/`; pi completed the multi-step coding task against it on the pod, `…-3090pod-flash-next-iq3xxs-step7-pi/`, and the request-shape checks pass, `…-step7-shapes/`) |
| `Qwen3.6-35B-A3B-UD-Q3_K_M.gguf` (MTP draft block in the file) | `unsloth/Qwen3.6-35B-A3B-MTP-GGUF` @ `5bc3e238` | 17,104,402,720 | `8966dd0cd8c543c4228490a2a8b0e0814fc4f1e6a8e199ceed4de6754ae7b8e1` | `strata-poly` | pod, A6000 VM | works (2026-10-17, RTX 3090 pod: `bench/unbiased/2026-10-17-3090pod-qwen36-ud-q3km-mtp-step6/`; 211 to 227 tok/s decode on short prompts, 88% of drafts accepted); A6000 `…-a6000-qwen36-ud-q3km-mtp-step6/`, 214 to 235 tok/s); the measured configuration of PLAN.md section 6 |
| `Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00001-of-00002.gguf` + `-00002-of-00002.gguf`, with `pack-iq3-xxs/` and `mtp/` made by upstream's `tools/iq_pack.py` and `tools/mtp_rt.py` | Niko1221 Strata GSQ-RCO release; pack and MTP built 2026-10-05 (`artifacts.sha256` on the pod) | 47,039,860,096 + 28,800,138,432 | shards unhashed; pack `dense.bin` `d2af3d83…`, mtp `dense.bin` `c724dc0b…` (full hashes in `bench/unbiased/*/engine-info.txt`) | `strata` | RTX 3090 pod, A6000 VM | works (2026-10-17: A6000 `bench/unbiased/2026-10-17-a6000-flash-next-iq3xxs-step6/`, RTX 3090 pod `…-3090pod-flash-next-iq3xxs-step6/`; the greedy answers of the two boxes are identical, and identical to upstream PolyStrata v0.1.45-poly.1 on the same files on the pod: `…-3090pod-…/upstream-compare/`; pi completed the multi-step coding task against it on the pod, `…-3090pod-flash-next-iq3xxs-step7-pi/`, and the request-shape checks pass, `…-step7-shapes/`; step 9 upstream-vs-fork measurement on the pod, `…-3090pod-step9/`: fork faster on every workload) |
| `Qwen3.6-35B-A3B-UD-Q3_K_M.gguf` (MTP draft block in the file) | `unsloth/Qwen3.6-35B-A3B-MTP-GGUF` @ `5bc3e238` | 17,104,402,720 | `8966dd0cd8c543c4228490a2a8b0e0814fc4f1e6a8e199ceed4de6754ae7b8e1` | `strata-poly` | pod, A6000 VM | works (2026-10-17, RTX 3090 pod: `bench/unbiased/2026-10-17-3090pod-qwen36-ud-q3km-mtp-step6/`; 211 to 227 tok/s decode on short prompts, 88% of drafts accepted); A6000 `…-a6000-qwen36-ud-q3km-mtp-step6/`, 214 to 235 tok/s); the measured configuration of PLAN.md section 6; step 9 upstream-vs-fork on the pod, `…-3090pod-step9/`: decode within noise, 16K prefill 2.3 % slower, to explain |
| `Qwen3.6-35B-A3B-UD-IQ4_XS.gguf` (MTP draft block in the file; `/Volumes/models/qwen3.6/MTP/…-IQ4_XS-MTP.gguf` locally) | `unsloth/Qwen3.6-35B-A3B-MTP-GGUF` @ `5bc3e238` | 18,209,036,576 | `df27a780435b7b45c2597536112ea3cb091f8544c3d0c3318d9f4258b31f7adf` | `strata-poly` | pod, A6000 VM | works (2026-10-17: A6000 `bench/unbiased/2026-10-17-a6000-qwen36-ud-iq4xs-mtp-step6/`, 207 to 215 tok/s decode on short prompts; RTX 3090 pod `…-3090pod-qwen36-ud-iq4xs-mtp-step6/`, 205 to 245 tok/s; pi completed a multi-step coding task against it on the A6000, `…-step7-pi/`); chosen as the local-use quant |
| `Qwen3.6-35B-A3B-UD-IQ4_XS.gguf` (no draft block) | `unsloth/Qwen3.6-35B-A3B-GGUF` | 17,730,509,792 | `649d7508507b84638732c4f52c24c8b15843c6dca2f3ff793ae07c14a67ebbb3` | `strata-poly` | pod | on disk, untried: without the draft block the engine runs without speculation |
| `Qwen3.6-35B-A3B-UD-Q3_K_M.gguf` (no draft block) | `unsloth/Qwen3.6-35B-A3B-GGUF` | 16,600,710,112 | `1b715841683f960bd9a49f008181bd910ee169b78d4cf465b6fde7f4d929ff99` | `strata-poly` | pod | on disk, untried; downloaded by mistake for the row above, kept to compare |