Structs§
- Provider
Fallback Info - Info about a model_provider fallback that occurred during a request.
- Reliable
Model Provider - ModelProvider wrapper with retry + auth-key rotation. The model_provider Vec exists for tests to exercise multi-provider failover; production wiring always passes a single primary. Per-model failover chains are also test-only — the schema no longer surfaces them.
Functions§
- is_
auth_ error - Check if an error indicates an authentication/authorization failure. Used by channels to evict cached model_providers whose OAuth tokens may have expired so the next request triggers a fresh credential resolution.
- is_
context_ window_ exceeded - is_
non_ retryable - Check if an error is non-retryable (client errors that won’t resolve with retries).
- is_
tool_ schema_ error - Check if an error is a tool schema validation failure (e.g. Groq returning
“tool call validation failed: attempted to call tool ‘…’ which was not in request”).
These errors should NOT be classified as non-retryable because the model_provider’s
built-in fallback logic (
compatible.rs::is_native_tool_schema_unsupported) can recover by switching to prompt-guided tool instructions. - scope_
provider_ fallback - Run the given future within a provider-fallback scope.
Both
record_provider_fallback(inside ReliableModelProvider) andtake_last_provider_fallback(post-loop channel code) must execute within this scope for the data to be visible. - take_
last_ provider_ fallback - Take (consume) the last model_provider fallback info, if any.
Must be called within a
scope_provider_fallbackscope.