Files
strata-ctl/Cargo.toml
T
adm 5bafd000c8 Respond to code review: sampling defaults, abort race, hardening + README
Bug fixes (from review/README.md):
- Apply config sampling defaults field-by-field, so an absent temperature no
  longer means greedy; expose top_k/min_p/repetition_penalty on ChatRequest;
  top_k=0 is "disabled" (-> 64), not greedy.
- Fix cross-request abort race: Engine::request_stop() sets the cancel flag only;
  the owning generate loop does STOP+drain itself, instead of a spawned abort()
  that could hit a later request holding the lock.
- Initialize tracing-subscriber (RUST_LOG, default info); events were dropped.
- TempFilesGuard removes materialized images on every exit path (error/panic/drop);
  build_prompt runs in spawn_blocking off the async worker; ureq image fetch gets a
  15s timeout, a 32MB cap and a basic SSRF guard (literal loopback/private hosts).
- Non-blocking shutdown (STOP+QUIT without taking the request lock first) and a
  bounded drain_to_done that marks the engine dead on timeout.

Operational hardening:
- Graceful shutdown on SIGTERM as well as SIGINT.
- Warn when binding a non-loopback address (no auth, allowed_hosts not enforced).
- Configurable startup/silence timeouts (optional config keys, default 600s).

Docs:
- Add README.md (English): what strata-ctl is, why Rust for stable server use,
  architecture, usage, honest status, and credits to Strata / Niko1221.

76 tests green + 2 real-file ignored; clippy clean; cargo fmt applied.
Deferred (heavy): automatic engine restart after a crash.
2026-11-24 18:42:56 +01:00

29 lines
855 B
TOML

[package]
name = "strata-ctl"
version = "0.1.0"
edition = "2021"
description = "Rust control layer for the Strata inference engine: OpenAI-compatible HTTP API over the engine's line protocol"
license = "MIT"
[dependencies]
anyhow = "1"
thiserror = "2"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
tokio = { version = "1", features = ["rt-multi-thread", "process", "io-util", "sync", "time", "macros", "signal", "net"] }
tracing = "0.1"
axum = "0.8"
futures = "0.3.34"
tokio-stream = "0.1.19"
tokenizers = "0.23.2"
minijinja = { version = "3.1.0", features = ["serde"] }
image = "0.25.10"
base64 = "0.23.1"
ureq = "3.5.2"
tracing-subscriber = { version = "0.3.23", features = ["env-filter"] }
[dev-dependencies]
http-body-util = "0.1.5"
tokio = { version = "1", features = ["full"] }
tower = { version = "0.5", features = ["util"] }