Skip to content

Qwen3.8-Flash-Next on any consumer hardware: one-click install for Windows / Linux. Strata inference engine, OpenAI/Anthropic API on localhost, optional image input.

C++

bench: community report, RTX 5090 + Ryzen 9 9950X3D, IQ3_S at the full 262K window; prefill auto:32768 A/B; conversation-cache 32 GiB demo (#440)

Ambolio263c99b96d3f
diff --git a/bench/results/2026-10-02-community-rtx-5090-iq3s/README.md b/bench/results/2026-10-02-community-rtx-5090-iq3s/README.md
new file mode 100644
index 000000000..2aab5b092
--- /dev/null
+++ b/bench/results/2026-10-02-community-rtx-5090-iq3s/README.md
@@ -0,0 +1,131 @@
+# Community-format benchmark: RTX 5090, Ryzen 9 9950X3D, IQ3_S at 262K
+
+Measured on 2026-10-02 on the production box (the server that serves this Claude Code session).
+Reproduces the community method (`docs/COMMUNITY_BENCHMARKS.md`, as used in PRs #389/#417/#418/#433)
+against the live `:8080` without restarting it. Main limitation: the GPU also served the live agent
+session during the runs, and TTFT is measured at the client on a FIFO server, so it includes queue time.
+
+## Hardware and software
+
+- NVIDIA GeForce RTX 5090, 32,607 MiB; driver 617.14; Windows 11 Home (WDDM). Second GPU (RTX 4090)
+ idle, not used.
+- AMD Ryzen 9 9950X3D (Zen 5, AVX-512), 96 GB RAM. Engine picked 15 expert-pool workers + host thread.
+- Engine 0.1.33 release binary (`BUILD.json`: CUDA 13.0, sm_75/86/89/120+PTX); serve wrapper 0.1.30.
+
+## Model and configuration
+
+Qwen3.8-Flash-Next GSQ-RCO **IQ3_S** (2 GGUF shards + PLE shard), pack `Strata-data/packs/iq3_s`,
+expert-profile `Strata/data/expert-profile.bin`, MTP `Strata-data/mtp/rt`, vision on CPU (16 threads).
+
+```text
+--pack packs/iq3_s --native ...-00001-of-00002.gguf --ple-gguf ...-00002-of-00002.gguf
+--expert-profile expert-profile.bin --expert-cache auto --prefill auto --spec 4 --mtp mtp/rt
+--max-context 262144 --kv int8 --kv-resident 65536 --vision --vram-reserve-mib 100
+--conversation-cache-mib 32768 --conversation-cache-slots 8 --pcie-frac 0.35 --spec-min-p 0.70
+```
+
+Startup: expert cache **12,331 slots (23.41 GiB)**; the prompt path borrows 2,465 slots (4.69 GiB);
+free VRAM after load **489 MiB** (min during the whole sweep: 489 MiB).
+
+## Method
+
+[`bench.py`](bench.py): prompts built from this repository's text (as `tools/needle_bench.py` does),
+a fresh slice per run — **0 runs with prefix reuse** (`cache_n = 0` in every measured run). Greedy,
+thinking off, 256 output tokens, 1 warm-up + 3 measured per cell. Throughput from the engine's own
+clock (the response's `timings`, llama.cpp names). TTFT from one streaming run per cell, client-side.
+Recall: [`tools/needle_bench.py`](../../../tools/needle_bench.py) `--lengths 32k,128k,256k --depths 10,50,90`.
+Per-run data: [`runs.json`](runs.json), [`needles.json`](needles.json); raw stdout: `bench.out`, `needles.out`.
+
+## Results
+
+| Prompt | prompt tok/s (median, range) | decode tok/s (median, range) | TTFT s (client, incl. queue) | draft accept | expert cache hit | KV in VRAM |
+| ---: | --- | --- | ---: | ---: | ---: | ---: |
+| 1,024 | 961 (876–973) | 136.2 (127.0–150.6) | 4.19 | 76% | 92–97% | 99.6% |
+| 4,096 | 2,473 (2,319–2,480) | 141.8 (139.1–145.6) | 1.6 | 76% | 95–97% | 99.3% |
+| 32,768 | 4,168 (4,051–4,286) | 142.2 (137.5–146.7) | 12.67 | 77% | 98% | 97.0% |
+| 131,072 | 4,450 (4,360–4,593) | 127.2 (117.9–129.0) | 42.31 | 75% | 94–98% | 94–95% |
+
+Needle recall: **9 of 9 found** — 32k (30,839–30,840 tokens), 128k (124,019–124,021),
+256k (**261,669–261,670 tokens**, the edge of the 262,144 window) at depths 10/50/90.
+
+## Against the published rows
+
+- Official IQ3_S row (RTX 5070 12 GB, engine 0.1.26): prompt 427/913/1,624/1,640/1,443 at 1K–128K,
+ decode 52.4→45.5. This box: **2.7–3.1× prompt, ~2.8× decode**.
+- Community RTX 5090 IQ2_XS (Core Ultra 9 285K, Linux, 0.1.29): decode 179.4/175.7/165.0 at 4K/32K/128K.
+ This box with IQ3_S (≈2× the expert bytes, Windows/WDDM): 141.8/142.2/127.2.
+- PR #389 (2× TITAN RTX, IQ3_S at 262K): prompt 841/1,620/1,786, decode 58–79. This box: ~2.5× prompt, ~2× decode.
+- PR #417 (one RTX PRO 4500, IQ3_S): decode 106–124, prefill 3,102–3,281 at 64–128K. This box is ahead of one
+ 4500 and approaches their two-card figures (decode 153–159, prefill 5.6–5.8k).
+- PR #433 (RTX 5090 + Ryzen 9 5950X, AVX2-only, UD-Q4_K_XL): prefill 2.0–2.2k at 14.7K. Not directly
+ comparable (quantization, CPU); our 9950X3D has AVX-512 and shows no such prefill ceiling.
+
+## Observations
+
+- **Decode spread at short prompts: 127.0–150.6 (18%)** with only 489 MiB VRAM free — the WDDM stall
+ signature PR #279 describes (stalls appear run-to-run when the desktop competes for the last VRAM).
+ At 128K the spread narrows to 9%.
+- Draft acceptance on this synthetic text: 75–77% (the live agent session runs 83–85%).
+- The conversation cache kept the live session through the whole sweep: 109–111k-token restores in
+ 118–277 ms while 19 bench conversations evicted each other (parked=8, evictions 26→28).
+- KV streaming hit 94–99.6% of block reads in VRAM at `--kv-resident 65536`.
+
+## A/B after `--prefill auto:32768` (same day, after a restart)
+
+The config changed `--prefill auto` → `auto:32768`; the engine log then shows
+`prompt chunk auto: 32768 tokens` and the prompt path borrows 7,736 cache slots (14.64 GiB) instead
+of 2,465 (4.69 GiB). Same script, same machine, same session; per-run data: [`runs-prefill32k.json`](runs-prefill32k.json),
+stdout `bench-prefill32k.out` (the baseline per-run JSON was overwritten by this run; its per-run
+lines are in `bench.out`).
+
+| Prompt | prompt tok/s before → after | decode tok/s before → after |
+| ---: | --- | --- |
+| 1,024 | 961 → 999 | 136.2 → 144.4 |
+| 4,096 | 2,473 → 2,439 | 141.8 → 148.6 |
+| 32,768 | 4,168 → **5,045 (+21%)** | 142.2 → 142.2 |
+| 131,072 | 4,450 → **6,004 (+35%)** | 127.2 → 125.4 |
+
+A real session re-prefill of 138,132 tokens ran at **5,719 tok/s** right after the restart. Decode
+is unchanged (within noise); no WDDM stalls appeared (min free VRAM during the sweep: 485 MiB).
+The engine printed a startup warning — "0 MiB of VRAM free with everything loaded … add
+`--vram-reserve-mib 612`" — which reflects the bigger prompt-path loan peaking during prompt
+processing, not the idle state; it stays a watch-item, not an applied change.
+
+The gain is larger than PR #282's +15% (measured at 32K with IQ2_XS) because IQ3_S experts are
+bigger, so crossing PCIe four times per prompt costs more — consistent with their NVFP4 note
+(+47% with 2× expert size).
+
+## The conversation cache: the flag most installs leave off
+
+The engine's default is `--conversation-cache-mib 0` — **off** (`src/program/generate.cpp:349-351`,
+with 4 slots and a 2,560 MiB RAM floor). With the default, every follow-up in an agent-style session
+re-reads the whole conversation at prompt speed. Our production config runs
+`--conversation-cache-mib 32768 --conversation-cache-slots 8`; [`conversation_cache_demo.py`](conversation_cache_demo.py)
+measures what that buys — two ~65k-token document conversations interleaved (A1, B1, A2, B2, A3),
+greedy, 128 output tokens, fresh text window per run:
+
+| Request | Prompt tokens | Reused | Fresh read | Wall time |
+| --- | ---: | ---: | ---: | ---: |
+| A1 doc A, first turn | 66,209 | 0 | 66,209 | 12.63 s |
+| B1 doc B, first turn | 64,946 | 0 | 64,946 | 11.69 s |
+| A2 follow-up on A | 66,258 | 66,202 | 56 | **1.17 s** |
+| B2 follow-up on B | 64,994 | 64,939 | 55 | **1.03 s** |
+| A3 follow-up on A again | 66,310 | 66,251 | 59 | **0.61 s** |
+
+The engine's own lines: `restored 66,251 tokens (checkpoint) in 82.4 ms`; the live Claude Code
+session (160,978 tokens at the time) restored in **185.9 ms**; and after an LRU eviction the partial
+path still worked — `prompt 56,060 tokens = 30,560 reused + 25,500 read in 5,098 ms (5,002 tok/s)`.
+A follow-up costs 0.6–1.2 s instead of 11–13 s: **10–20×**, and the cache persists across client
+sessions (a rerun minutes later restored the conversations the first run had parked).
+
+Capacity on this box: parked bytes run ~30 KB/token (a 162,150-token conversation snapshot is
+3.85 GB); with 32 GiB the cache held 8 conversations totalling ~20.8 GB, including the 160k-token
+agent session, with the 2,560 MiB RAM floor never hit (96 GB installed). On the default 4 GiB budget
+these conversations would evict each other every turn — which is what makes the flag the difference
+between "the agent re-reads the world each turn" and "the agent remembers".
+
+## Correctness and limitations
+
+Needle recall is the only quality check. One machine, single stream, greedy, prompts are repo text
+(not code-agent prompts). TTFT includes FIFO queue behind the live session's requests (the 128K TTFT
+42.3 s vs 29.4 s of pure prefill). The engine was not restarted; all flags are the production ones.
diff --git a/bench/results/2026-10-02-community-rtx-5090-iq3s/TRIMMED.md b/bench/results/2026-10-02-community-rtx-5090-iq3s/TRIMMED.md
new file mode 100644
index 000000000..a86967ebf
--- /dev/null
+++ b/bench/results/2026-10-02-community-rtx-5090-iq3s/TRIMMED.md
@@ -0,0 +1,13 @@
+# Trimmed files
+
+Ported from PR #440 for 0.1.40.2. Raw dumps, logs and binaries were left out to keep the repository small;
+the README, summaries, configs and per-run results are unchanged. The files below were in the original PR.
+
+4 files, 0.0 MB:
+
+| file | bytes | why |
+|---|---:|---|
+| `bench-prefill32k.out` | 1,961 | log/raw dump |
+| `bench.out` | 1,964 | log/raw dump |
+| `demo.out` | 447 | log/raw dump |
+| `needles.out` | 504 | log/raw dump |
diff --git a/bench/results/2026-10-02-community-rtx-5090-iq3s/bench.py b/bench/results/2026-10-02-community-rtx-5090-iq3s/bench.py
new file mode 100644
index 000000000..6df4bedc1
--- /dev/null
+++ b/bench/results/2026-10-02-community-rtx-5090-iq3s/bench.py
@@ -0,0 +1,159 @@
+"""Speed sweep against the live :8080, in the docs/COMMUNITY_BENCHMARKS.md format.
+
+Prompts are built from this repository's text the way tools/needle_bench.py does, with a fresh
+slice per run so no prompt is reused (cache_n must stay 0; a run that shows reuse is reported).
+Greedy, thinking off, 256 output tokens, 1 warm-up + 3 measured runs per cell. Throughput comes
+from the engine's own clock (the response's `timings`, llama.cpp names); TTFT is measured at the
+client on one streaming run per cell (the server is a FIFO, so TTFT can include queue time).
+Decode runs under 75% of the cell median are flagged as possible WDDM stalls (PR #279).
+
+ python bench/results/2026-10-02-community-rtx-5090-iq3s/bench.py
+"""
+from __future__ import annotations
+
+import json
+import re
+import statistics
+import subprocess
+import sys
+import threading
+import time
+import urllib.request
+from pathlib import Path
+
+ROOT = Path(__file__).resolve().parents[3] # the Strata runtime folder
+sys.path.insert(0, str(ROOT / "tools"))
+from needle_bench import haystack, CHARS_PER_TOKEN # noqa: E402
+
+URL = "http://127.0.0.1:8080/v1/chat/completions"
+MODEL = "qwen3.8-flash-next-iq3_s"
+LOG = ROOT / "strata-iq3_s.log"
+LENGTHS = [1024, 4096, 32768, 131072]
+MAX_NEW = 256
+OUT = Path(__file__).with_name("runs.json")
+
+TAIL = re.compile(r"(decode expert cache hit rate: [\d.]+%[^\n]*|KV streaming: [\d.]+%[^\n]*)")
+
+
+def post(payload: dict, timeout: float = 1800.0) -> dict:
+ req = urllib.request.Request(URL, data=json.dumps(payload).encode(),
+ headers={"Content-Type": "application/json"})
+ with urllib.request.urlopen(req, timeout=timeout) as r:
+ return json.load(r)
+
+
+def make_prompt(n_tokens: int, off: int) -> str:
+ n_chars = int(n_tokens * CHARS_PER_TOKEN)
+ text = haystack(n_chars + off + 4096)[off:off + n_chars]
+ return (text + "\n\nQuestion: In at least 150 words, summarize what kinds of files the text "
+ "above is made of and what they are for. Name three of them.\n")
+
+
+def log_tails(n_lines: int = 400) -> dict:
+ try:
+ lines = LOG.read_text(encoding="utf-8", errors="replace").splitlines()[-n_lines:]
+ except OSError:
+ return {}
+ hits = [m for l in lines for m in TAIL.findall(l)]
+ out = {}
+ for h in hits[::-1]:
+ if h.startswith("decode") and "hit" not in out:
+ out["hit"] = h
+ if h.startswith("KV") and "kv" not in out:
+ out["kv"] = h
+ if len(out) == 2:
+ break
+ return out
+
+
+def one_run(n_tokens: int, off: int) -> dict:
+ body = {"model": MODEL, "max_tokens": MAX_NEW, "temperature": 0,
+ "chat_template_kwargs": {"enable_thinking": False},
+ "messages": [{"role": "user", "content": make_prompt(n_tokens, off)}]}
+ t0 = time.time()
+ r = post(body)
+ t = r.get("timings") or {}
+ u = r.get("usage") or {}
+ return {"prompt_target": n_tokens, "prompt_tokens": u.get("prompt_tokens"),
+ "cache_n": t.get("cache_n"), "generated": t.get("predicted_n") or u.get("completion_tokens"),
+ "prompt_tok_s": t.get("prompt_per_second"), "decode_tok_s": t.get("predicted_per_second"),
+ "draft_n": t.get("draft_n"), "draft_ok": t.get("draft_n_accepted"),
+ "total_s": round(time.time() - t0, 2), "wall_s": round(t.get("prompt_ms", 0) / 1000 + t.get("predicted_ms", 0) / 1000, 2),
+ **log_tails()}
+
+
+def ttft_run(n_tokens: int, off: int) -> float | None:
+ body = {"model": MODEL, "max_tokens": MAX_NEW, "temperature": 0, "stream": True,
+ "chat_template_kwargs": {"enable_thinking": False},
+ "messages": [{"role": "user", "content": make_prompt(n_tokens, off)}]}
+ req = urllib.request.Request(URL, data=json.dumps(body).encode(),
+ headers={"Content-Type": "application/json"})
+ t0 = time.time()
+ with urllib.request.urlopen(req, timeout=1800) as r:
+ for raw in r:
+ line = raw.decode("utf-8", "replace").strip()
+ if not line.startswith("data: ") or line == "data: [DONE]":
+ continue
+ try:
+ d = json.loads(line[6:])["choices"][0].get("delta") or {}
+ except (KeyError, ValueError):
+ continue
+ if d.get("content") or d.get("reasoning_content"):
+ return round(time.time() - t0, 2)
+ return None
+
+
+class Vram(threading.Thread):
+ def __init__(self) -> None:
+ super().__init__(daemon=True)
+ self.stop_at, self.mins = time.time() + 100000, []
+
+ def run(self) -> None:
+ while time.time() < self.stop_at:
+ try:
+ s = subprocess.run(["nvidia-smi", "-i", "0", "--query-gpu=memory.free",
+ "--format=csv,noheader,nounits"], capture_output=True, text=True, timeout=10)
+ self.mins.append(int(s.stdout.strip()))
+ except Exception:
+ pass
+ time.sleep(5)
+
+
+def main() -> int:
+ vram = Vram()
+ vram.start()
+ rows = []
+ for L in LENGTHS:
+ for i in range(4): # run 0 = warm-up, not counted
+ row = one_run(L, i * 1_000_003 + L)
+ row["length"], row["run"], row["warmup"] = L, i, i == 0
+ rows.append(row)
+ print(f"{L:>7} run {i}: prompt {row['prompt_tok_s']} tok/s, decode {row['decode_tok_s']} tok/s, "
+ f"cache_n {row['cache_n']}, gen {row['generated']}, {row['total_s']} s", flush=True)
+ rows.append({"length": L, "ttft_s": ttft_run(L, 4 * 1_000_003 + L), "stream_ttft": True})
+ print(f"{L:>7} TTFT {rows[-1]['ttft_s']} s", flush=True)
+ vram.stop_at = time.time()
+ time.sleep(0.2)
+
+ print("\n| Prompt | prompt tok/s (3 runs) | decode tok/s (3 runs) | TTFT s | draft accept |")
+ print("| --- | --- | --- | --- | --- |")
+ for L in LENGTHS:
+ m = [r for r in rows if r.get("length") == L and not r.get("warmup") and not r.get("stream_ttft")]
+ p = [r["prompt_tok_s"] for r in m if r["prompt_tok_s"]]
+ d = [r["decode_tok_s"] for r in m if r["decode_tok_s"]]
+ tt = next((r["ttft_s"] for r in rows if r.get("length") == L and r.get("stream_ttft")), None)
+ dr = sum(r["draft_ok"] or 0 for r in m) / max(1, sum(r["draft_n"] or 0 for r in m))
+ med = statistics.median(d) if d else 0
+ stall = [r["decode_tok_s"] for r in m if r["decode_tok_s"] and r["decode_tok_s"] < 0.75 * med]
+ print(f"| {L:,} | {statistics.median(p):,.0f} ({min(p):,.0f}-{max(p):,.0f}) | "
+ f"{med:,.1f} ({min(d):,.1f}-{max(d):,.1f}) | {tt} | {dr:.0%} |"
+ + (f" STALL: {stall}" if stall else ""))
+ reused = [r for r in rows if not r.get("warmup") and not r.get("stream_ttft") and r.get("cache_n")]
+ print(f"\nruns with prompt reuse (cache_n>0): {len(reused)}; VRAM free min during sweep: {min(vram.mins)} MiB")
+ OUT.write_text(json.dumps(rows, indent=1), encoding="utf-8")
+ print(f"wrote {OUT}")
+ return 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/bench/results/2026-10-02-community-rtx-5090-iq3s/config.json b/bench/results/2026-10-02-community-rtx-5090-iq3s/config.json
new file mode 100644
index 000000000..bdf518bf2
--- /dev/null
+++ b/bench/results/2026-10-02-community-rtx-5090-iq3s/config.json
@@ -0,0 +1,57 @@
+{
+ "exe": "E:\\Modelos\\Multimodal\\Strata\\engine\\strata.exe",
+ "args": [
+ "--pack",
+ "E:\\Modelos\\Multimodal\\Strata-data\\packs\\iq3_s",
+ "--native",
+ "E:\\Modelos\\Multimodal\\Strata-data\\models\\IQ3_S\\Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00001-of-00002.gguf",
+ "--ple-gguf",
+ "E:\\Modelos\\Multimodal\\Strata-data\\models\\IQ3_S\\Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00002-of-00002.gguf",
+ "--expert-profile",
+ "E:\\Modelos\\Multimodal\\Strata\\data\\expert-profile.bin",
+ "--expert-cache",
+ "auto",
+ "--prefill",
+ "auto:32768",
+ "--spec",
+ "4",
+ "--mtp",
+ "E:\\Modelos\\Multimodal\\Strata-data\\mtp\\rt",
+ "--max-context",
+ "262144",
+ "--kv",
+ "int8",
+ "--kv-resident",
+ "65536",
+ "--vision",
+ "--vram-reserve-mib",
+ "100",
+ "--conversation-cache-mib",
+ "32768",
+ "--conversation-cache-slots",
+ "8",
+ "--pcie-frac",
+ "0.35",
+ "--spec-min-p",
+ "0.70"
+ ],
+ "cwd": "E:\\Modelos\\Multimodal\\Strata",
+ "tokenizer": "E:\\Modelos\\Multimodal\\Strata-data\\packs\\iq3_s\\tokenizer",
+ "model_name": "qwen3.8-flash-next-iq3_s",
+ "log": "E:\\Modelos\\Multimodal\\Strata\\strata-iq3_s.log",
+ "lib_dirs": [
+ "E:\\Modelos\\Multimodal\\Strata\\.venv\\Lib\\site-packages\\nvidia\\cu13\\bin\\x86_64"
+ ],
+ "port": 8080,
+ "fit_max_tokens": true,
+ "gpu": 0,
+ "gpus_asked": true,
+ "vision": {
+ "exe": "E:\\Modelos\\Multimodal\\Strata\\engine\\strata-vision.exe",
+ "mmproj": "E:\\Modelos\\Multimodal\\Strata-data\\models\\mmproj-Qwen3.8-Flash-Next-BF16.gguf",
+ "model": "E:\\Modelos\\Multimodal\\Strata-data\\models\\IQ3_S\\Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00001-of-00002.gguf",
+ "gpu": false,
+ "max_tokens": 300,
+ "threads": 16
+ }
+}
\ No newline at end of file
diff --git a/bench/results/2026-10-02-community-rtx-5090-iq3s/conversation_cache_demo.py b/bench/results/2026-10-02-community-rtx-5090-iq3s/conversation_cache_demo.py
new file mode 100644
index 000000000..3f301b6d3
--- /dev/null
+++ b/bench/results/2026-10-02-community-rtx-5090-iq3s/conversation_cache_demo.py
@@ -0,0 +1,79 @@
+"""Conversation-cache demo: two long agent-style conversations interleaved through the live server.
+
+The engine's `--conversation-cache-mib` defaults to 0 (off): every follow-up re-reads the whole
+conversation. With 32 GiB / 8 slots (our production config), a follow-up restores the parked K/V
+instead. This script runs five requests — doc A, doc B, follow-up on A, follow-up on B, second
+follow-up on A — and reports, per request, the reused tokens (`usage.prompt_tokens_details.cached_tokens`),
+the freshly read tokens and the wall time, plus the engine's own `restored/parked` log lines.
+
+ python bench/results/2026-10-02-community-rtx-5090-iq3s/conversation_cache_demo.py
+"""
+from __future__ import annotations
+
+import json
+import re
+import sys
+import time
+import urllib.request
+from pathlib import Path
+
+ROOT = Path(__file__).resolve().parents[3]
+sys.path.insert(0, str(ROOT / "tools"))
+from needle_bench import haystack, CHARS_PER_TOKEN # noqa: E402
+
+URL = "http://127.0.0.1:8080/v1/chat/completions"
+MODEL = "qwen3.8-flash-next-iq3_s"
+LOG = ROOT / "strata-iq3_s.log"
+DOC_TOKENS = 60_000
+
+
+def ask(messages) -> dict:
+ body = {"model": MODEL, "max_tokens": 128, "temperature": 0,
+ "chat_template_kwargs": {"enable_thinking": False}, "messages": messages}
+ req = urllib.request.Request(URL, data=json.dumps(body).encode(), headers={"Content-Type": "application/json"})
+ t0 = time.time()
+ with urllib.request.urlopen(req, timeout=1200) as r:
+ out = json.load(r)
+ u = out["usage"]
+ return {"prompt_tokens": u["prompt_tokens"], "cached_tokens": (u.get("prompt_tokens_details") or {}).get("cached_tokens", 0),
+ "completion_tokens": u["completion_tokens"], "seconds": round(time.time() - t0, 2),
+ "answer": (out["choices"][0]["message"].get("content") or "")[:120]}
+
+
+def main() -> int:
+ base = int(time.time()) % 20_000_000 # a fresh text window per run, printed for reproducibility
+ print(f"haystack window base: {base}")
+ n = int(DOC_TOKENS * CHARS_PER_TOKEN)
+ doc_a = haystack(n + base)[base:]
+ doc_b = haystack(n + base + 5_000_003)[base + 5_000_003:]
+ q = "\n\nIn three sentences: what kinds of files make up the text above?"
+ fu1 = "\n\nAnd which of those file types would I edit to change compiler flags?"
+ fu2 = "\n\nGive one concrete example of a line you would change there."
+
+ conv_a, conv_b, rows = [], [], []
+ steps = ["A1 fresh doc A", "B1 fresh doc B", "A2 follow-up on A", "B2 follow-up on B",
+ "A3 follow-up on A again"]
+ for name in steps:
+ conv = conv_a if name.startswith("A") else conv_b
+ if name.startswith("A1"):
+ conv.append(("user", doc_a + q))
+ elif name.startswith("B1"):
+ conv.append(("user", doc_b + q))
+ else:
+ conv.append(("user", fu1 if name[1] == "2" else fu2))
+ msgs = list(conv)
+ mark = len(LOG.read_text(encoding="utf-8", errors="replace"))
+ r = ask([{"role": m[0], "content": m[1]} for m in msgs])
+ conv.append(("assistant", r["answer"]))
+ new = [l for l in re.findall(r"strata serve: (?:conversation cache:|prompt) [^\n]*", LOG.read_text(encoding="utf-8", errors="replace")[mark:])]
+ r["step"], r["engine_lines"] = name, new
+ rows.append(r)
+ print(f"{name:24} prompt {r['prompt_tokens']:>7,} reused {r['cached_tokens']:>7,} "
+ f"fresh {r['prompt_tokens'] - r['cached_tokens']:>6,} {r['seconds']:>6.2f} s", flush=True)
+ Path(__file__).with_name("demo.json").write_text(json.dumps(rows, indent=1), encoding="utf-8")
+ print("wrote demo.json")
+ return 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/bench/results/2026-10-02-community-rtx-5090-iq3s/demo.json b/bench/results/2026-10-02-community-rtx-5090-iq3s/demo.json
new file mode 100644
index 000000000..a216778d0
--- /dev/null
+++ b/bench/results/2026-10-02-community-rtx-5090-iq3s/demo.json
@@ -0,0 +1,57 @@
+[
+ {
+ "prompt_tokens": 66209,
+ "cached_tokens": 0,
+ "completion_tokens": 84,
+ "seconds": 12.63,
+ "answer": "The text consists of CUDA C++ source files that implement specialized GPU kernels for a machine learning inference engin",
+ "step": "A1 fresh doc A",
+ "engine_lines": [
+ "strata serve: prompt 66209 tokens = 0 reused + 66209 read in 11615 ms (5700.3 tok/s), 84 generated in 872 ms (96.4 tok/s), drafts accepted 37 of 48, 3 checkpoints"
+ ]
+ },
+ {
+ "prompt_tokens": 64946,
+ "cached_tokens": 0,
+ "completion_tokens": 83,
+ "seconds": 11.69,
+ "answer": "The text consists of CUDA C++ source files implementing high-performance GPU kernels for a specialized inference engine,",
+ "step": "B1 fresh doc B",
+ "engine_lines": [
+ "strata serve: prompt 64946 tokens = 0 reused + 64946 read in 10823 ms (6000.9 tok/s), 83 generated in 730 ms (113.8 tok/s), drafts accepted 38 of 55, 2 checkpoints"
+ ]
+ },
+ {
+ "prompt_tokens": 66258,
+ "cached_tokens": 66202,
+ "completion_tokens": 66,
+ "seconds": 1.17,
+ "answer": "You would not edit any of the provided `.cu` source files to change compiler flags, as these files contain only C++ and ",
+ "step": "A2 follow-up on A",
+ "engine_lines": [
+ "strata serve: prompt 66258 tokens = 66202 reused + 56 read in 518 ms (108.2 tok/s), 66 generated in 513 ms (128.6 tok/s), drafts accepted 37 of 40, 4 checkpoints"
+ ]
+ },
+ {
+ "prompt_tokens": 64994,
+ "cached_tokens": 64939,
+ "completion_tokens": 75,
+ "seconds": 1.03,
+ "answer": "You would not edit any of the provided `.cu` or `.hpp` files to change compiler flags, as these files contain source cod",
+ "step": "B2 follow-up on B",
+ "engine_lines": [
+ "strata serve: prompt 64994 tokens = 64939 reused + 55 read in 375 ms (146.5 tok/s), 75 generated in 510 ms (147.0 tok/s), drafts accepted 41 of 45, 3 checkpoints"
+ ]
+ },
+ {
+ "prompt_tokens": 66310,
+ "cached_tokens": 66251,
+ "completion_tokens": 11,
+ "seconds": 0.61,
+ "answer": "You cannot change compiler flags in the provided `.cu",
+ "step": "A3 follow-up on A again",
+ "engine_lines": [
+ "strata serve: prompt 66310 tokens = 66251 reused + 59 read in 363 ms (162.5 tok/s), 11 generated in 110 ms (99.6 tok/s), drafts accepted 3 of 6, 5 checkpoints"
+ ]
+ }
+]
\ No newline at end of file
diff --git a/bench/results/2026-10-02-community-rtx-5090-iq3s/needles.json b/bench/results/2026-10-02-community-rtx-5090-iq3s/needles.json
new file mode 100644
index 000000000..848ed5752
--- /dev/null
+++ b/bench/results/2026-10-02-community-rtx-5090-iq3s/needles.json
@@ -0,0 +1,83 @@
+[
+ {
+ "length": "32k",
+ "depth": 10,
+ "prompt_tokens": 30839,
+ "seconds": 18.4,
+ "found": true,
+ "word": "meadow-copper-504",
+ "answer": "meadow-copper-504"
+ },
+ {
+ "length": "32k",
+ "depth": 50,
+ "prompt_tokens": 30839,
+ "seconds": 7.6,
+ "found": true,
+ "word": "falcon-quartz-940",
+ "answer": "falcon-quartz-940"
+ },
+ {
+ "length": "32k",
+ "depth": 90,
+ "prompt_tokens": 30840,
+ "seconds": 12.0,
+ "found": true,
+ "word": "willow-cobalt-696",
+ "answer": "willow-cobalt-696"
+ },
+ {
+ "length": "128k",
+ "depth": 10,
+ "prompt_tokens": 124021,
+ "seconds": 27.7,
+ "found": true,
+ "word": "falcon-saffron-138",
+ "answer": "falcon-saffron-138"
+ },
+ {
+ "length": "128k",
+ "depth": 50,
+ "prompt_tokens": 124019,
+ "seconds": 24.8,
+ "found": true,
+ "word": "quartz-tundra-528",
+ "answer": "quartz-tundra-528"
+ },
+ {
+ "length": "128k",
+ "depth": 90,
+ "prompt_tokens": 124019,
+ "seconds": 24.8,
+ "found": true,
+ "word": "quartz-glacier-192",
+ "answer": "quartz-glacier-192"
+ },
+ {
+ "length": "256k",
+ "depth": 10,
+ "prompt_tokens": 261669,
+ "seconds": 56.8,
+ "found": true,
+ "word": "tundra-falcon-946",
+ "answer": "tundra-falcon-946"
+ },
+ {
+ "length": "256k",
+ "depth": 50,
+ "prompt_tokens": 261669,
+ "seconds": 41.9,
+ "found": true,
+ "word": "willow-glacier-745",
+ "answer": "willow-glacier-745"
+ },
+ {
+ "length": "256k",
+ "depth": 90,
+ "prompt_tokens": 261670,
+ "seconds": 69.9,
+ "found": true,
+ "word": "falcon-juniper-150",
+ "answer": "falcon-juniper-150"
+ }
+]
\ No newline at end of file
diff --git a/bench/results/2026-10-02-community-rtx-5090-iq3s/runs-prefill32k.json b/bench/results/2026-10-02-community-rtx-5090-iq3s/runs-prefill32k.json
new file mode 100644
index 000000000..fdaa78e09
--- /dev/null
+++ b/bench/results/2026-10-02-community-rtx-5090-iq3s/runs-prefill32k.json
@@ -0,0 +1,294 @@
+[
+ {
+ "prompt_target": 1024,
+ "prompt_tokens": 997,
+ "cache_n": 0,
+ "generated": 256,
+ "prompt_tok_s": 856.7,
+ "decode_tok_s": 140.9,
+ "draft_n": 167,
+ "draft_ok": 129,
+ "total_s": 3.01,
+ "wall_s": 2.98,
+ "kv": "KV streaming: 99.63% of 1023444 block reads hit VRAM, 15.2 MiB read from RAM",
+ "hit": "decode expert cache hit rate: 94.6% (133526 hits / 141192 lookups)",
+ "length": 1024,
+ "run": 0,
+ "warmup": true
+ },
+ {
+ "prompt_target": 1024,
+ "prompt_tokens": 1090,
+ "cache_n": 0,
+ "generated": 256,
+ "prompt_tok_s": 962.5,
+ "decode_tok_s": 144.4,
+ "draft_n": 164,
+ "draft_ok": 122,
+ "total_s": 5.37,
+ "wall_s": 2.91,
+ "kv": "KV streaming: 99.64% of 1115856 block reads hit VRAM, 16.3 MiB read from RAM",
+ "hit": "decode expert cache hit rate: 95.0% (135386 hits / 142471 lookups)",
+ "length": 1024,
+ "run": 1,
+ "warmup": false
+ },
+ {
+ "prompt_target": 1024,
+ "prompt_tokens": 1053,
+ "cache_n": 0,
+ "generated": 238,
+ "prompt_tok_s": 999.1,
+ "decode_tok_s": 135.5,
+ "draft_n": 139,
+ "draft_ok": 103,
+ "total_s": 6.62,
+ "wall_s": 2.81,
+ "kv": "KV streaming: 99.61% of 991476 block reads hit VRAM, 15.7 MiB read from RAM",
+ "hit": "decode expert cache hit rate: 97.1% (128594 hits / 132494 lookups)",
+ "length": 1024,
+ "run": 2,
+ "warmup": false
+ },
+ {
+ "prompt_target": 1024,
+ "prompt_tokens": 1038,
+ "cache_n": 0,
+ "generated": 256,
+ "prompt_tok_s": 1090.3,
+ "decode_tok_s": 146.7,
+ "draft_n": 166,
+ "draft_ok": 125,
+ "total_s": 2.71,
+ "wall_s": 2.7,
+ "kv": "KV streaming: 99.63% of 1059732 block reads hit VRAM, 15.7 MiB read from RAM",
+ "hit": "decode expert cache hit rate: 97.2% (138090 hits / 142069 lookups)",
+ "length": 1024,
+ "run": 3,
+ "warmup": false
+ },
+ {
+ "length": 1024,
+ "ttft_s": 0.84,
+ "stream_ttft": true
+ },
+ {
+ "prompt_target": 4096,
+ "prompt_tokens": 4116,
+ "cache_n": 0,
+ "generated": 220,
+ "prompt_tok_s": 2663.2,
+ "decode_tok_s": 144.3,
+ "draft_n": 137,
+ "draft_ok": 108,
+ "total_s": 3.1,
+ "wall_s": 3.07,
+ "kv": "KV streaming: 99.18% of 1571328 block reads hit VRAM, 51.6 MiB read from RAM",
+ "hit": "decode expert cache hit rate: 96.4% (114517 hits / 118753 lookups)",
+ "length": 4096,
+ "run": 0,
+ "warmup": true
+ },
+ {
+ "prompt_target": 4096,
+ "prompt_tokens": 4597,
+ "cache_n": 0,
+ "generated": 256,
+ "prompt_tok_s": 2760.3,
+ "decode_tok_s": 148.6,
+ "draft_n": 150,
+ "draft_ok": 124,
+ "total_s": 3.4,
+ "wall_s": 3.39,
+ "kv": "KV streaming: 99.20% of 1774644 block reads hit VRAM, 57.3 MiB read from RAM",
+ "hit": "decode expert cache hit rate: 98.0% (132334 hits / 135025 lookups)",
+ "length": 4096,
+ "run": 1,
+ "warmup": false
+ },
+ {
+ "prompt_target": 4096,
+ "prompt_tokens": 3636,
+ "cache_n": 0,
+ "generated": 252,
+ "prompt_tok_s": 2439.3,
+ "decode_tok_s": 154.1,
+ "draft_n": 176,
+ "draft_ok": 136,
+ "total_s": 3.15,
+ "wall_s": 3.13,
+ "kv": "KV streaming: 99.38% of 1848588 block reads hit VRAM, 46.5 MiB read from RAM",
+ "hit": "decode expert cache hit rate: 98.5% (138730 hits / 140896 lookups)",
+ "length": 4096,
+ "run": 2,
+ "warmup": false
+ },
+ {
+ "prompt_target": 4096,
+ "prompt_tokens": 3717,
+ "cache_n": 0,
+ "generated": 256,
+ "prompt_tok_s": 1971.2,
+ "decode_tok_s": 143.5,
+ "draft_n": 179,
+ "draft_ok": 124,
+ "total_s": 3.68,
+ "wall_s": 3.67,
+ "kv": "KV streaming: 99.39% of 1953336 block reads hit VRAM, 47.8 MiB read from RAM",
+ "hit": "decode expert cache hit rate: 97.8% (145646 hits / 148905 lookups)",
+ "length": 4096,
+ "run": 3,
+ "warmup": false
+ },
+ {
+ "length": 4096,
+ "ttft_s": 1.54,
+ "stream_ttft": true
+ },
+ {
+ "prompt_target": 32768,
+ "prompt_tokens": 30727,
+ "cache_n": 0,
+ "generated": 256,
+ "prompt_tok_s": 4948.0,
+ "decode_tok_s": 151.8,
+ "draft_n": 179,
+ "draft_ok": 138,
+ "total_s": 7.98,
+ "wall_s": 7.9,
+ "kv": "KV streaming: 96.71% of 1879392 block reads hit VRAM, 249.3 MiB read from RAM",
+ "hit": "decode expert cache hit rate: 98.3% (140788 hits / 143264 lookups)",
+ "length": 32768,
+ "run": 0,
+ "warmup": true
+ },
+ {
+ "prompt_target": 32768,
+ "prompt_tokens": 32590,
+ "cache_n": 0,
+ "generated": 256,
+ "prompt_tok_s": 5177.8,
+ "decode_tok_s": 142.2,
+ "draft_n": 167,
+ "draft_ok": 129,
+ "total_s": 8.18,
+ "wall_s": 8.09,
+ "kv": "KV streaming: 97.13% of 1860900 block reads hit VRAM, 215.5 MiB read from RAM",
+ "hit": "decode expert cache hit rate: 98.4% (139612 hits / 141852 lookups)",
+ "length": 32768,
+ "run": 1,
+ "warmup": false
+ },
+ {
+ "prompt_target": 32768,
+ "prompt_tokens": 35328,
+ "cache_n": 0,
+ "generated": 256,
+ "prompt_tok_s": 4743.0,
+ "decode_tok_s": 148.6,
+ "draft_n": 174,
+ "draft_ok": 134,
+ "total_s": 9.25,
+ "wall_s": 9.17,
+ "kv": "KV streaming: 97.23% of 1873248 block reads hit VRAM, 209.4 MiB read from RAM",
+ "hit": "decode expert cache hit rate: 98.2% (140098 hits / 142723 lookups)",
+ "length": 32768,
+ "run": 2,
+ "warmup": false
+ },
+ {
+ "prompt_target": 32768,
+ "prompt_tokens": 31602,
+ "cache_n": 0,
+ "generated": 256,
+ "prompt_tok_s": 5045.3,
+ "decode_tok_s": 138.6,
+ "draft_n": 175,
+ "draft_ok": 125,
+ "total_s": 8.19,
+ "wall_s": 8.11,
+ "kv": "KV streaming: 96.85% of 1922544 block reads hit VRAM, 244.0 MiB read from RAM",
+ "hit": "decode expert cache hit rate: 98.5% (144333 hits / 146585 lookups)",
+ "length": 32768,
+ "run": 3,
+ "warmup": false
+ },
+ {
+ "length": 32768,
+ "ttft_s": 33.4,
+ "stream_ttft": true
+ },
+ {
+ "prompt_target": 131072,
+ "prompt_tokens": 127870,
+ "cache_n": 0,
+ "generated": 256,
+ "prompt_tok_s": 6290.3,
+ "decode_tok_s": 124.4,
+ "draft_n": 169,
+ "draft_ok": 126,
+ "total_s": 22.68,
+ "wall_s": 22.39,
+ "kv": "KV streaming: 94.32% of 1885536 block reads hit VRAM, 431.4 MiB read from RAM",
+ "hit": "decode expert cache hit rate: 95.8% (137036 hits / 143081 lookups)",
+ "length": 131072,
+ "run": 0,
+ "warmup": true
+ },
+ {
+ "prompt_target": 131072,
+ "prompt_tokens": 136629,
+ "cache_n": 0,
+ "generated": 256,
+ "prompt_tok_s": 6003.5,
+ "decode_tok_s": 122.4,
+ "draft_n": 154,
+ "draft_ok": 117,
+ "total_s": 25.14,
+ "wall_s": 24.85,
+ "kv": "KV streaming: 94.71% of 1842372 block reads hit VRAM, 392.7 MiB read from RAM",
+ "hit": "decode expert cache hit rate: 97.7% (137139 hits / 140394 lookups)",
+ "length": 131072,
+ "run": 1,
+ "warmup": false
+ },
+ {
+ "prompt_target": 131072,
+ "prompt_tokens": 140708,
+ "cache_n": 0,
+ "generated": 256,
+ "prompt_tok_s": 6067.4,
+ "decode_tok_s": 125.4,
+ "draft_n": 154,
+ "draft_ok": 121,
+ "total_s": 25.55,
+ "wall_s": 25.23,
+ "kv": "KV streaming: 95.13% of 1823952 block reads hit VRAM, 357.9 MiB read from RAM",
+ "hit": "decode expert cache hit rate: 97.9% (135935 hits / 138879 lookups)",
+ "length": 131072,
+ "run": 2,
+ "warmup": false
+ },
+ {
+ "prompt_target": 131072,
+ "prompt_tokens": 114782,
+ "cache_n": 0,
+ "generated": 256,
+ "prompt_tok_s": 5746.6,
+ "decode_tok_s": 125.6,
+ "draft_n": 165,
+ "draft_ok": 122,
+ "total_s": 22.3,
+ "wall_s": 22.01,
+ "kv": "KV streaming: 94.25% of 1879356 block reads hit VRAM, 435.4 MiB read from RAM",
+ "hit": "decode expert cache hit rate: 98.0% (140392 hits / 143233 lookups)",
+ "length": 131072,
+ "run": 3,
+ "warmup": false
+ },
+ {
+ "length": 131072,
+ "ttft_s": 25.06,
+ "stream_ttft": true
+ }
+]
\ No newline at end of file