Expand description
Lightweight (cheap/fast) model routing for auxiliary features.
Structs§
- Lightweight
Route Resolution - Result of resolving which model a lightweight feature should use.
- Model
Route - A resolved provider-and-model pair that identifies a specific LLM endpoint.
Enums§
- Lightweight
Feature - Features that may use a lightweight (cheaper, faster) model instead of the primary model to reduce cost and latency.
- Lightweight
Route Source - Indicates how a lightweight route was resolved.
Functions§
- auto_
lightweight_ model - Automatically select a lightweight model for the given provider and active model.
- create_
provider_ for_ model_ route - Instantiate an
LLMProviderfor the given model route. - lightweight_
model_ choices - Return the list of available lightweight model choices for the given provider.
- main_
model_ route - Build a
ModelRoutefor the primary model from runtime configuration. - resolve_
api_ key_ for_ model_ route - Resolve the API key for a model route, using the runtime key when the route targets the same provider as the main model, or falling back to environment variables otherwise.
- resolve_
api_ key_ for_ model_ route_ with_ mode - Resolve a lightweight route key using the configured secure-storage mode.
- resolve_
lightweight_ route - Resolve the best model route for a given lightweight feature.