The golden moves from a lib test to control-plane/tests/output_golden (its own process: the cases switch the process-wide tool-call recovery). 130 synthetic cases, 260 captures. The expected captures in output_events.json were recorded on08afbf216(cbc1a9587plus the first harness) in a temporary worktree and are checked against the new code; none was recorded on it, and none differs. What is stronger: ids are numbered by first appearance as <kind>_ID<k> and keep their numeric suffix (call_ID3_1), and two_calls_of_one_response_have_different_call_ids pins the call ids Codex pairs outputs by; a vocabulary with multi-byte tokens (a euro sign, an emoji, a token that holds the whole </think> marker, a token that ends in the middle of it) and raw byte tokens; characters cut at length and at stop in the live text, the live tool stream, the reasoning preview and the structured stream; a lone continuation byte in reasoning and in the answer; reasoning_tokens pinned for the marker inside a token and across two tokens; a second </think> in the answer and in a tool argument; reasoning closed and the answer cut inside a call; the tool-call recovery on and off in the live tool stream, the buffered stream and the buffered answer; non-ASCII call arguments; a terminal token followed by more tokens with reasoning, tools and structured output on; an id outside the vocabulary in the middle of the script (the code before S23 fails at DONE, the new code at the offending token; the failure code, the message and every byte of the response are the same); a source that closes without DONE; Finish::Cancel. Timing: a gated worker proves the first reasoning delta, text delta and whole call reach the client before DONE, and a client that leaves closes the source in five stream modes. Not covered end to end: STRATA_DEBUG_FAILED_OUTPUT (read once per process through a OnceLock; the keep_raw paths get unit tests in leleka-gateway-domain).
Leleka
Leleka is a Rust/CUDA inference runtime for coding agents. Release 0.1 serves one model, Qwen3.8-Flash-Next IQ3_S (KAR level-2 PLE, MTP speculative
decode), on one RTX 5090 (32 GB) at 262,144 tokens of context, to Codex CLI and other clients over the Responses, Chat Completions and Messages APIs.
It is a Rust/CUDA port of the Original mode17 serve path of Strata (reference copy in engine/strata/, pinned at
upstream 41cf05a0, see docs/upstream.md). Serving needs no Python and no CUDA toolkit on the host.
Status of 0.1. It runs real Codex sessions to completion and decodes about 155 tok/s on the 245k-token benchmark of the 5090 server (section "Numbers").
It is not a formally quality-gated profile, only the RTX 5090 is supported, and the limits below are real. Release notes: docs/release/RELEASE-NOTES-5090-v0.1.md;
every gate and its evidence: docs/release/5090-v0.1-checklist.md.
Requirements
| GPU | RTX 5090 (sm_120, 32 GB), driver >= 595 (measured with 595.99.02). Any other GPU: not supported in 0.1 (an RTX 3080 laptop profile exists, experimental, not run for this release) |
| host | Linux x86_64, glibc >= 2.39 (measured: Ubuntu 26.04), >= 100 GiB RAM, a fast local NVMe, about 140 GB for the model volume |
| libraries | libcuda.so.1 (driver) and libcublas.so.12 (CUDA 12; leleka up fetches the pinned 12.9.1.4 redistributable if missing) |
| model | Qwen3.8-Flash-Next IQ3_S + KAR archive + MTP pack, digests pinned in the binary (leleka verify). Obtaining and using the model under its own licence is the user's responsibility. |
Install and run
From the unpacked release (leleka-0.1.0-COMMIT12-5090-linux-x86_64.tar.xz; check SHA256SUMS, ./bin/leleka version shows the commit and the Strata pin):
./bin/leleka up --dry-run --assets /data/leleka # preflight + plan + the exact engine command; changes nothing
sudo ./install.sh --assets /data/leleka # prepare, install, start the systemd service, wait for /ready (or --foreground)
./bin/leleka status # ready?, uptime, restarts, GPU/RAM/throughput, expert tier ON/OFF
curl -H "Authorization: Bearer $(cat STATE/api-key)" http://127.0.0.1:8081/v1/models
The API listens on loopback only (use an SSH tunnel); the key is in STATE/api-key. Codex CLI: wire_api = "responses", base_url = "http://127.0.0.1:8081/v1", web_search = "disabled".
Details, every flag, upgrade and rollback: docs/deploy.md, docs/unattended.md (running it as a boot-time service: scripts/ops/, installed by the owner of the machine, never by the release).
Upgrade: stop the service, keep a copy of STATE/*.json, unpack the new release, run its install.sh with the same flags. Rollback: restore the copies and run the previous release's install.sh.
Numbers (measured, paired, one workload)
Decode tok/s on the frozen 245k-token corpus (5 turns x 300 output tokens, greedy, RTX 5090, Ryzen 9 9950X3D), ours against vanilla Strata 0.2.6 on fresh boots, vanilla in its good
huge-page state (docs/experiments/baseline-pair-5090.md, section 10, 3 balanced blocks): ours 155.4 (sd 2.4), vanilla v1 (its shipped lossy defaults) 137.0 (ahead of it in 3 of 3 blocks, +13.5 %),
vanilla v2 (lossless-comparable) 144.7 (ahead in 2 of 3 blocks, +9.2 %; vanilla v2 is bimodal and ran 171.2 once, 10.8 % faster than ours). Later changes: the faster draft attention is bitwise identical and
shortens a round by 2.7 % (tok/s +0.5 % +- 0.6 %, not significant); the window policy default +1.1 % +- 1.2 % (not resolved, no speedup claimed); the single-copy memory layout
(docs/kar-sparse-memfd.md) is identical in output (2057/2057 logprob rows, 1036/1036 draft traces) and frees 36.6 GiB of RAM at 245k (MemAvailable 8.5 to 45.1 GiB; tok/s +0.58 %, n.s.).
These are decode speeds of a benchmark, not agent-task times.
Quality and limits
- Not bit-identical to the Original; deviations are inside the Original's own rounding envelope where tested (
docs/quality-gate.md), and there is no 245k port-versus-Original equality gate yet (STRA-337). KAR level-2 PLE, chain kernels, prefill chunk 8192, request-end prefix checkpoints and the adaptive expert tier have no 256k gate. All evidence is greedy. - Lossy modes are off: route tail skip gave +15 % decode but failed its quality gate; keyless KV failed too. Tool calls are the model's: malformed ones are refused, not repaired.
- One generation at a time (queue of 16); images and
reasoning_budget_tokensare refused; RTX 3080 and Windows are not part of 0.1; no multi-hour soak on the release commit (post-release feedback). - Cold start is dominated by reading the 55 GB archive from disk; with the O_DIRECT loader and the sparse copy the measured times are in the release notes.
Observability
What the service is doing, and why a request was slow or failed, is in its logs; nothing needs a debugger, and nothing leaves the machine.
- Logs.
STATE/logs/{leleka,engine,gateway,api,requests}.log, one JSON object per line: UTC timestamp (ms), level, component, event, flat fields. The supervisor rotates them by size (leleka.jsonlogs); a repeating event is sampled (a burst, then one line per 10 s with asuppressedcount), so a failure loop cannot fill the disk. Prompts and answers are never written; the API key and tokens are scrubbed from every line.LELEKA_LOG_LEVEL,LELEKA_LOG_FORMAT=json|text|legacyandLELEKA_LOG_DEBUG=1(adds the length of redacted text) are read by every process. A binary started by hand keeps the plain lines thatscripts/e2eparses. - One record per request (
requests.log, about 0.5 KB): request id (also thex-leleka-request-idresponse header), session tag, dialect, model, profile, prompt / cached / output tokens, queue wait, time to first token, prefill and decode tok/s, finish reason, error class, whether the engine was lost meanwhile, GPU clock, temperature and throttle reasons. The engine writes its own line for the same id (tokens per speculative round, expert-tier share served from VRAM / PCIe / CPU). - Commands.
leleka logs --tail 100 --since 1h --level warn,leleka logs --request ID(API and engine lines of one request, joined),leleka status/leleka verify --quick(request statistics of the last quarter hour, failures), andleleka report: a sanitized support bundle (versions, commit, Strata pin, profile, expert tier ON/OFF with digest, hardware, service health, request statistics, the last 50 request records, recent warnings) in one JSON file.reportshows what it would contain and writes only with--yes; you attach the file yourself. Seeleleka --help. - Metrics.
GET /metrics?format=prometheus: request counters by endpoint and outcome, histograms (time to first token, duration, queue wait, tokens, tok/s), engine restarts and uptime, queue depth, VRAM and host memory, GPU clocks / temperature / power / throttle reasons, PCIe MB/s, speculative tokens per round, expert-tier entries by tier. Every label value comes from a fixed list.
Repository layout
crates/— the runtime:engine-qwen35-cuda(the engine;leleka-runtimeis its facade),engine-core(pure engine domain),cuda-driver(CUDA Driver API, sealed PTX),leleka-memory(memory governor),obs(logging),deploy(thelelekabinary), model-format, tokenizer, sampler and CPU kernels.control-plane/,desktop-core/— the HTTP/Responses gateway (strata-next) and the engine/daemon processes.engine/strata/— the pinned upstream Strata, the reference (unmodified by Leleka).deploy/,scripts/— profiles, service templates, release packager (scripts/release/), test and measurement tooling (Python is allowed there, never in serving).PROJECT_CHARTER.md,docs/— requirements, provenance, decisions, gates and measurements. Architecture:docs/architecture/hexagonal.md.
Model weights, request captures, credentials, logs and generated artifacts stay outside Git.
Development
cargo test --workspace --locked
cargo clippy --workspace --all-targets --all-features -- -D warnings
scripts/release/package-5090.sh check # the release gates; `package` builds the release set (docs/release/5090-v0.1-checklist.md)
Licence
MIT (LICENSE). A commercial licence is available on request. Third-party notices: docs/release/licence-and-secrets-audit-5090-v0.1.md; the Strata reference is MIT (engine/strata/LICENSE).