llmix-rs
llmix-rs is the Rust binding for the current LLMix orchestration contract.
The crate is usable today, but it should still be treated as beta. The public surface is aligned to the current Python and TypeScript bindings, while downstream production adoption is still earlier-stage in Rust.
What the crate covers
- Async call orchestration through a user-supplied dispatch callback
- Two-tier response cache with shared cache-key fixture parity
- Circuit breaker, kill switch, retry, singleflight, key-pool rotation, and AIMD semaphore
- Provider kwargs normalization for OpenAI, Anthropic, Gemini, OpenRouter, and
sno-gpu - Thinking-token stripping
- Config Registry runtime manager and publisher for committed preset snapshots
- Low-level MDA Source Mode config helpers with
load_configandload_config_preset - Optional provider modules for OpenAI-compatible, Anthropic, Gemini, and
sno-gpuHTTP dispatch
Feature flags
- Default features: core crate only
redis: enable Redis-backed L2 response cacheproviders-openai: enable the OpenAI chat provider adapterproviders-sno-gpu: enable thesno-gpuprovider adapterproviders-anthropic: enable the Anthropic chat provider adapterproviders-gemini: enable the Gemini chat provider adapterhelpers-*: legacy aliases that forward to the matchingproviders-*feature
Minimal example
use ;
use json;
async
The same callback shape works when you replace the inline closure with your own async function or an adapter around a provider-specific client.
Config Registry
The Rust crate now exposes ConfigRegistryPublisher and
ConfigRegistryManager as the preferred preset runtime path.
use ;
#
The registry contract stays aligned across Python, TypeScript, and Rust:
.mdaSource Mode stays as the authoring format- publishing creates immutable snapshot revisions
current.jsonis the only live switch- runtime reads committed snapshot artifacts instead of mutable authoring MDA
That lets Rust stay aligned with Python and TypeScript without putting cross-language MDA parsing on the runtime hot path.
The manager also exposes the active revision and reload health metadata so service code can report which snapshot is live and whether a reload failed.
load_config and load_config_preset remain available as low-level helpers
for authoring tools, tests, and migration work. They now hard-require .mda
files and reject legacy .yaml / .yml preset paths.
Optional provider modules
The core crate does not require provider SDKs. If you want a batteries-included HTTP adapter, enable one of the providers-* features and wire the corresponding helper into PipelineConfig::new(...).
These provider adapters are deliberately optional because the LLMix contract is the orchestration layer, not a mandatory SDK abstraction.
Shared parity tests
The Rust crate consumes the same fixtures used by the rest of the repo under tests/fixtures/.
cargo test --all-featuresruns the local parity and unit suites- live provider tests are opt-in and only run when
LLMIX_RUN_LIVE_TESTS=1 - provider-specific live tests also require the matching provider credentials in the environment
Monorepo location
The crate lives at rust/llmix-rs/ in the main LLMix monorepo alongside the Python and TypeScript bindings.