Expand description
Engine API — LLM engine introspection + config writes + routing control.
Provides access to the oxi-sdk model catalog (providers, models, search) and write operations that persist to config.toml (model, API key, routing).
Routing statistics (RoutingStats) are shared between this API and
AgentRuntime via an Arc, so model usage is recorded end-to-end.
Structs§
- Engine
Api - Engine API facade — model catalog introspection + config writes + routing.
- Engine
Config Response - Current engine configuration + credential status + routing.
- Fallback
Event - Single fallback event record.
- Model
Info - Summary of a model from the catalog.
- Provider
Info - Summary of an LLM provider.
- Routing
Config Snapshot - Snapshot of routing configuration (read-only API response).
- Routing
Stats - In-memory routing statistics, shared between
EngineApiandAgentRuntime. Uses simple RwLock for thread-safe reads/writes. - Routing
Stats Snapshot - Model usage statistics.
- Routing
Update - Request body for
PUT /api/engine/routing. - Validate
KeyResult - Result of an API key validation attempt.
Enums§
- Input
Modality - Input modality for a model.
- Provider
Category - Provider category for UI grouping.
Functions§
- estimate_
cost - Estimate cost in USD for a model given token usage. Uses oxi-sdk’s model_db for per-model pricing.
- record_
usage_ to_ stats