Skip to main content

Module knobs

Module knobs 

Source
Expand description

Runtime configuration knobs.

A knob is a named, typed runtime setting — a kernel-selection toggle or a heuristic threshold. Its value is resolved, in priority order, from an explicit programmatic override, then the process environment, then a compiled-in default.

Knobs are declared with [declare_knob!] and register themselves into a stack-wide inventory (this crate is the lowest in the stack, so linalg and everything above can declare). The inventory lets every knob be listed and documented from one place, and set through the API on targets where environment variables are unavailable (e.g. wasm).

A knob is the lowest, deployer-facing layer of configuration; it is not a substitute for settings that must travel with a model.

Re-exports§

pub use inventory;

Structs§

Knob
A declared knob. Construct via [declare_knob!] rather than directly so it is registered for listing.
KnobInfo
Type-erased description of a declared knob, collected stack-wide for listing and documentation.

Traits§

KnobValue
A type usable as a knob value: parseable from the string sources (env / API) and renderable for listing.

Functions§

all
All declared knobs, sorted by name.
clear_str
Drop a knob’s programmatic override by name. Returns false if not declared.
list
Render all declared knobs as a human-readable list.
set_str
Set a knob by name from a raw string — the environment-style source, for hosts where environment variables are unavailable (e.g. wasm). Returns false if no knob by that name is declared.