Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Control plane
For small, experimental sharded fixtures, model ensure-sharded-preview MANIFEST --source-dir DIR --output FILE.kar --levels N acquires and verifies the sources, creates a KAR-2 preview, and verifies it again. It reuses an existing archive only when its payload, provenance, source identity, and requested level count verify. model smoke-fixture --output FILE.kar creates a deterministic model-free archive, and model checksum-kar-preview FILE.kar TENSOR LEVEL independently decodes it on CPU for comparison with the CUDA smoke tool. The 64 MiB input limit remains; these commands cannot prepare the target model for serving.
The repository pins Rust 1.99.0 in rust-toolchain.toml. rustup selects it automatically from this checkout. The strata-next executable defaults to serve and also supports doctor, model fetch MANIFEST --output DIR, model verify MANIFEST --output DIR, model inspect FILE.gguf, model index FILE.gguf [--hash], model derive-iq3-identity FILE.gguf, model derive-mixed-identity FILE.gguf, model derive-sharded-identity MANIFEST --source-dir DIR, model prepare-f32-preview FILE.gguf --output FILE.kar --levels N, model prepare-iq3-preview FILE.gguf --output FILE.kar --levels N, model prepare-mixed-preview FILE.gguf --output FILE.kar --levels N, model prepare-sharded-preview MANIFEST --source-dir DIR --output FILE.kar --levels N, model inspect-kar FILE.kar, model verify-kar FILE.kar [--manifest SPEC --source-dir DIR], model verify-iq3-preview FILE.kar --source FILE.gguf, model verify-mixed-preview FILE.kar --source FILE.gguf, model verify-sharded-preview FILE.kar --manifest SPEC --source-dir DIR, model extract-tokenizer FILE.gguf --output DIR, model tokenize TOKENIZER_DIR TEXT [--special], and model detokenize TOKENIZER_DIR IDS. Use model tokenize TOKENIZER_DIR --stdin [--special] for long text or control bytes. The IQ3, mixed, and sharded identity commands hash virtual F32 streams with bounded memory. Preview preparation commands write provenance sidecars, which the corresponding verification commands recompute and check against the archives. No preview archive is approved for serving. model inspect-kar checks bounded KAR-2 metadata, header CRC, directory digest, tensor shapes, and section bounds; model verify-kar also scans payload CRC-32 checksums. With a manifest and source directory it verifies each physical source shard and the archive's concatenated source digest. Neither command decodes KAR weights or measures quality. scripts/check-local.sh runs formatting, Clippy, Rust tests, protocol replay, and the CPU engine tests.
The Rust control plane provides process health, worker readiness, status, and graceful shutdown. It can start a Strata engine worker and records worker readiness only after the engine emits READY <max-context>. An abandoned internal generation sends STOP and drains its terminal response before the next request; shutdown during generation sends STOP before QUIT. With tokenizer assets configured, POST /v1/responses can perform a restricted non-streaming text generation with reasoning.effort: "none". It returns 503 while the worker is unavailable, 501 for unsupported live features or a missing tokenizer, and never fabricates a model response. Worker restart is not yet implemented.
Run locally with cargo run --manifest-path control-plane/Cargo.toml. It binds to 127.0.0.1:8081 by default; set STRATA_BIND to another socket address if needed. Check /health, /ready, and /status.
Set STRATA_CONFIG to a JSON file using config.example.json as a template. The file supports bind and an engine object with executable, args, tokenizer_dir, and startup_timeout_s (1–3600 seconds, default 600). STRATA_BIND, STRATA_ENGINE_EXE, STRATA_ENGINE_ARGS_JSON, STRATA_TOKENIZER_DIR, and STRATA_STARTUP_TIMEOUT_S override their file counterparts. The control plane supplies --serve itself. The tokenizer directory must contain the native assets extracted from the model.
Without an engine configuration, /ready returns HTTP 503 and /status reports unconfigured. A configured worker reports starting, then ready with max_context, or failed if startup, the readiness handshake, or the process fails. /ready returns HTTP 200 only when the worker and native tokenizer are configured and ready for the restricted text preview. During shutdown the worker reports stopping and receives QUIT. Startup has a timeout; the control plane never advertises readiness before the engine handshake.
Run the local contract checks with cargo test --manifest-path control-plane/Cargo.toml --locked. The tests use a small fake engine process and need no GPU or model. The supervisor test sends a token-ID GEN command through the worker pipe, reads T and DONE, and rejects a request that exceeds the ready worker's context. The Responses trace builder checks ordered SSE events, terminal completion, unchanged tool arguments, and JSON Schema output validation. The synthetic replay can be run as JSON or SSE:
cargo run --manifest-path control-plane/Cargo.toml --locked --bin replay-responses -- benchmarks/fixtures/responses/structured-tool.json
cargo run --manifest-path control-plane/Cargo.toml --locked --bin replay-responses -- --sse benchmarks/fixtures/responses/structured-tool.json
See API contract for the supported subset and remaining integration work.