Crate metrale_server

Crate metrale_server 

Source
Expand description

2026-09-26: Library target of metrale-server: the modules that the integration tests, the k3_tokenizer_check example and cargo test -p metrale-server --lib use without building the met binary.

Owner: server. Invariants: every module declared here is also declared in main.rs.

Modules§

auth
2026-09-26: Bearer-token validation for the HTTP API’s --require-auth gate.
env_config
2026-09-26: Strict parsing of the numeric process-scoped METRALE_* settings: the rate limits (rate_limiter), the response store and the conversation store.
rate_limiter
2026-09-26: Per-identity token-bucket rate limiter for /v1/* requests: one bucket metered in requests and one in tokens, each refilling linearly with elapsed time up to its burst.
reasoning_parser
2026-09-26: Split a model’s completed output into reasoning and answer, per reasoning-block format.
refusal
2026-09-26: Heuristic refusal detector: a prefix matcher over the assistant’s opening text.
tokenizer
2026-09-26: ChatTokenizer: a Hugging Face tokenizer, the chat template prompts are rendered with (minijinja, or the DeepSeek-V4 message encoder), and a streaming decoder.