Pavlo RatushnyiandClaude Sonnet 5.5 a73d090601 kar ple cache: evict from a recency queue instead of scanning the whole row map (turn-5 decode stall)
Once the 1,048,576-slot device row cache is full, KarPleCache::gather picked the victim of every missed row with a scan of all
entries (filter + min_by_key), and assign_slots collected every entry into a Vec per prompt chunk. A decode token with a new trigram
misses its 8 trigram-head rows (input_hash::rows), so it cost 8 full scans: ~53 ms per such token in window.ple at turn 5 of the
245k session (the cache fills only then), against 0.14 ms before.

Residents keeps the row map plus a queue of (age, row) items, pushed at every age change and valid while the map still holds the
row at that age. oldest() reads the front of the queue: O(victims + skipped), with the full scan only as the fallback when the
queue gives fewer rows than asked (the caller then refuses the chunk, as before). The planning and publishing of a gather are now
the pure functions plan_gather/publish_gather so the tests drive the production code.

The cache only decides which slot holds which row, so the decoded values are unchanged. Tests: gather victims, slots and final state
equal to the scan implementation on random sequences (4 cache sizes, 6000 gathers each, every gathered row is its own row); chunks
and gathers interleaved keep every row in its own slot and every victim among the oldest untouched rows; eviction in a full cache of
200,000 rows examines <= 40 items per miss (the scan: 200,000); the queue stays bounded.
Measured (laptop, release, full 1,048,576-row cache): old scan 7.3 ms per missed row, queue 61 ns (ignored timing probe).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 03:27:11 +01:00

Leleka / Strata Next

Leleka is the independent Rust NVIDIA inference runtime being developed from this repository. The complete tracked Strata Next source tree was imported from paveldhq/strata-next commit 1263e88f8947b9796924eb7e8d8d7af08b589049; see docs/upstream.md for the pinned Strata engine provenance. The imported desktop application, Rust control plane, deployment code, model tooling, tests, and reference engine are all here.

The migration is staged: Leleka must eventually run without a Strata process, Strata source, Python, or a separately installed CUDA Toolkit on the target host. Until the replacement passes the same protocol, model-quality, and operational gates, Strata remains the behavior baseline. No model family or performance gain is claimed for Leleka until its real-model gates pass.

Repository layout

  • crates/backend-api/ — Leleka's versioned Rust backend contract.
  • crates/tokenizer/ — the Qwen35 byte-level BPE tokenizer extracted as a backend-independent Rust crate.
  • desktop/, desktop-core/ — current desktop application and its Rust core.
  • control-plane/ — current Rust API, Responses handling, and worker supervisor.
  • engine/strata/ — pinned upstream Strata reference; retained during migration.
  • gpu/ — experimental optimization components, including KAR.
  • integrations/, manifests/, deploy/, scripts/ — client integration, model profiles, packaging, and development/test tooling.
  • PROJECT_CHARTER.md, docs/ — requirements, provenance, decisions, and performance/quality gates.

Model weights, request captures, credentials, local logs, and generated build artifacts remain outside Git or under ignored paths.

Current Leleka scope

Leleka currently has a versioned backend contract and a standalone Qwen35 BPE tokenizer crate. The existing Rust control plane now consumes that shared tokenizer crate instead of maintaining a second copy; its oracle-parity tests remain in the workspace. Leleka still has no independent inference backend or CUDA integration, so this does not yet serve a model independently. The desktop app and the rest of the control plane remain available as migration source in this repository.

Development

Run the Rust workspace tests and lint:

cargo test --workspace --locked
cargo clippy --workspace --all-targets --all-features -- -D warnings

For the Linux release requirements, see PROJECT_CHARTER.md and the independent engine design.

S
Description
No description provided
Readme MIT
77 MiB
Languages
Rust 69.4%
Python 12.1%
Cuda 10.1%
Shell 4%
C++ 2.3%
Other 1.8%