serve_tuning (settings document, validation, effective settings), Command::Reconfigure in the Original serve loop with rollback,
Backend::reconfigure, gRPC Runtime.Reconfigure, POST /v1/reconfigure, telemetry.settings; tests for each layer.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The Codex tic-tac-toe run (job 943) ended after 4 minutes: the model wrote the whole index.html in one tool call, hit the
runtime's 4096-token output cap three times (tool call unterminated -> response.failed 'tool parameter is incomplete', then
'incomplete: max_output_tokens' -> turn.failed -> Codex exit 1). The Original server has no such cap (max_tokens 0 = the rest
of the context). RuntimeServer, the engine request check, strata-next's runtime default, the leleka-deploy generated config
and the examples now use leleka_backend_api::MAX_OUTPUT_TOKENS = 32768. /v1/status keeps the Python server's key set when no
prefix cache exists (http_surface golden regressed with the prefix-cache merge).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- leleka-runtime: memory_governor glue (startup plan with refusal, KAR memfd lock/residency guard, VRAM check, load-ledger stages,
inventory classes), prefix budget from the governor (auto/explicit clamped), shed directive applied per request and per prefill chunk,
engine-side admission (503 memory_pressure text), page-cache release of the shards after the resident bank load, cgroup-aware
available_memory.
- backend-api: Backend::memory_report (default None) and ScriptedEngine support; proto Snapshot.memory_json; desktop-core runtime_rpc and
runtime-client carry it.
- control-plane: MemoryView, /v1/status `memory`, /metrics `memory`, 503 memory_pressure + Retry-After gate before queueing, engine-side
refusal text mapped to the same 503; tests incl. a 600-request model-free soak (threads/fds/RSS flat).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
RuntimeServer and the engine Proxy remembered every accepted request id for the life of
an epoch and refused work after 256 (generation_capacity), which an agent session
exhausts quickly. Both now use leleka_backend_api::RecentIds (16384 most recent ids, FIFO).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
backend_worker drives any leleka_backend_api::Backend through the GenerationCommand
channel strata-next already uses. It maps the rendered prompt to the engine contract
(verified round trip of the ids), re-tokenizes text deltas with a byte-equality check,
recognises the stop literals, maps finish reasons, cancels on client disconnect,
guarantees a terminal event when the engine dies, and re-attaches by itself. What the
text contract cannot carry is refused. 23 HTTP tests over a scripted engine cover
Responses (JSON/SSE), Chat, tools, text.format, cancellation and engine faults.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Behind the scripted feature: scripted generations, cancel, faults (stream that ends
without a terminal event, failed and unasked-cancelled terminals), simulated engine
restart with stale handles. Not enabled by any production crate.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
backend-api carries SamplingOptions; backend.rs plans each request with the
validated SamplingParams instead of refusing temperature != 0; the output stage
bypasses the compact argmax for an armed request and draws with the bit-exact
host reference (counter = fed-token position, penalty history = prompt+generated).
MTP with sampling is refused explicitly. Desktop RPC only bounds temperature.
Docs: docs/sampler-reference.md (verified vs open).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>