Files
leleka/README.md
T
Pavlo Ratushnyi 056ab3d689 Retire the oracles, generators and scripts that only worked against the vendored Strata tree (STRA-406)
The vendored Strata tree engine/strata is removed for good (owner decision 2026-11-23): Leleka never builds or runs it, the vanilla
benchmark builds from its own checkout, the comparison measurements are finished and the CUDA ports are frozen. Everything below
compiled or read that tree, so it cannot run without it and is retired (the tree stays in git history, see third_party/strata/UPSTREAM.md).
Checked-in fixtures, golden JSON, sealed PTX, seal plans and MANIFEST hashes are untouched and keep being replayed by the cargo tests.

Drift guard
- crates/experimental-ref/tests/literal_port.rs: include_str! of the Original .cu files compared with the checked-in experimental ports.

Oracle generators and builders (they compile or extract from the Strata C++/Python sources; their outputs are the checked-in goldens)
- crates/experimental-ref/oracle/gen_{cvec,kv,remote,stream}_golden.{cpp,sh}, gen_seal_additions.py and the cuda_runtime stub they used
- crates/sampler-ref/oracle/build_oracle.sh, gen_fixtures.cpp, gen_sampling_keys.py, stub/ (run_port_host_tests.sh and the fixtures stay)
- crates/serving-policy/oracle/ (build_oracle.sh, gen_{host,cvec,vision}_fixtures.cpp)
- crates/context/tests/rope_plan_golden/gen_* (plan, rope, kv pool)
- crates/engine-core/src/conversation/golden/gen*.{sh,cpp} and stub/
- crates/cuda-driver/oracle/gen_prefill_ring_trace.py and drivers/prefill_ring_trace.cpp (extracted prefill.cpp), check_cu_syntax.sh
- crates/engine-qwen35-cuda/tests/stra161_reference/reference.py (fixtures.json and the Rust constants stay)
- control-plane/tests/golden/gen_goldens.py, scripts/offline/ (Python differentials and golden generators against the Strata Python tools)

Source-compiling CUDA oracles and builders
- scripts/build-cuda-{projection-family,q5,q6,qsa}-oracle.sh with scripts/cuda-{projection-family,q5,q6,qsa}-oracle/ (include the Original .cu; sha256 pins of them)
- scripts/build-original-verify-ptx.sh, scripts/q8/rebuild_quantizer_ptx.sh, scripts/decode-sm120/make_iq_prefix.py (needs engine/strata/include)
- scripts/cuda-stubs/ (check-cu.py and literal_diff.py need the strata headers and the Original sources; the stub headers served only them)
- tools/chain-probe/build.sh, tools/kernel-ab/{cpp,aa.sh,smoke.sh,time_smoke.sh} (the C++ comparator is built from the Strata CPU kernels; verify_manifest.py stays)
- scripts/e2e/codex/speed/verify-hc-down-kernel-microbench-vs-upstream/ (compiles the upstream kernel from the tree)

Engine builds and Python smokes that need the tree
- scripts/build-cpu.sh, scripts/build-static-cuda.sh, scripts/check-keyless-gpu.sh, scripts/test-static-cuda-profile.py (CMake of engine/strata)
- scripts/compare-real-tokenizer.py, scripts/smoke-mtp-pack.py (reads src/core/mtp.cpp and a bench manifest), scripts/prepare-keyless-routing.py and its test
- scripts/smoke-native-pack.py became scripts/native-pack-fixture.py: the synthetic GGUF fixtures the four other smokes import stay, the iq_pack.py oracle comparison goes

Gates and CI
- scripts/check-local.sh: no live Python oracle differentials, no literal_port note, no check-cu, no build-cpu, no retired test scripts
- .github/workflows/linux.yml: the keyless-cuda, static-cuda-package and hosted-cuda-package jobs (they built the engine from the tree) and their dispatch
  inputs, and the two oracle smoke steps; .github/workflows/port.yml: the Python oracle environment and the llama.cpp fetch of port-oracles
  (the sampler host shim still runs)
- limits.json and scripts/check_limits_test.py exclude third_party/strata/ instead of engine/strata/

Documentation and comments: README.md names third_party/strata and the pin; deploy/README.md marks the retired build and smoke commands; comments
in Rust, Python and Markdown that named engine/strata/... now name "Strata 41cf05a0, ..."; the gpu-bringup scratch-copy test no longer copies the
removed include directories. Stale engine/strata paths in sealed .cu, .ptx, seal-plan and MANIFEST files are left as they are (hashes may depend on the bytes).
2026-11-23 21:19:11 +01:00

8.7 KiB

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 (pinned at upstream 41cf05a0; the vendored copy was removed, see third_party/strata/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: spec node release/RELEASE-NOTES-5090-v0.1.md; every gate and its evidence: spec node 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: spec node deploy.md, spec node 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 (spec node 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 (spec node 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 (spec node 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_tokens are 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.json logs); a repeating event is sampled (a burst, then one line per 10 s with a suppressed count), 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|legacy and LELEKA_LOG_DEBUG=1 (adds the length of redacted text) are read by every process. A binary started by hand keeps the plain lines that scripts/e2e parses.
  • One record per request (requests.log, about 0.5 KB): request id (also the x-leleka-request-id response 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), and leleka 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. report shows what it would contain and writes only with --yes; you attach the file yourself. See leleka --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-runtime is its facade), engine-core (pure engine domain), cuda-driver (CUDA Driver API, sealed PTX), leleka-memory (memory governor), obs (logging), deploy (the leleka binary), model-format, tokenizer, sampler and CPU kernels.
  • control-plane/, desktop-core/ — the HTTP/Responses gateway (leleka-api) and the engine/daemon processes.
  • third_party/strata/ — the Strata MIT licence texts, the pinned chat template and golden, and UPSTREAM.md (pin 41cf05a0, local patches, where the removed vendored tree is in history). The Strata source tree itself is not in the repository.
  • deploy/, scripts/ — profiles, service templates, release packager (scripts/release/), test and measurement tooling (Python is allowed there, never in serving).
  • PROJECT_CHARTER.md, the LeaseVibe spec (imported repository documentation) — requirements, provenance, decisions, gates and measurements. Architecture: spec node 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 (spec node release/5090-v0.1-checklist.md)

Licence

MIT (LICENSE). A commercial licence is available on request. Third-party notices: spec node release/licence-and-secrets-audit-5090-v0.1.md; the Strata reference is MIT (third_party/strata/LICENSE, printed by leleka engine license).