Fallback
The fallback provider adds resilience by trying multiple clients in sequence.
Basic Example
client<llm> SuperDuperClient {
provider fallback
options {
strategy [
ClientA
ClientB
ClientC
]
}
}
If ClientA fails, it tries ClientB. If that fails, it tries ClientC.
Options
| Option | Type | Required | Description |
|---|---|---|---|
strategy | List[string] | Yes | Client names to try in order |
With Retry Policy
A retry policy on the fallback client tests the fallback after the entire strategy has failed.
client<llm> SuperDuperClient {
provider fallback
retry_policy MyRetryPolicy
options {
strategy [
ClientA
ClientB
ClientC
]
}
}
Nesting Fallbacks
Fallbacks can be nested inside each other:
client<llm> SuperDuperClient {
provider fallback
options {
strategy [
ClientA
ClientB
ClientC
]
}
}
client<llm> MegaClient {
provider fallback
options {
strategy [
SuperDuperClient
ClientD
]
}
}
Calling MegaClient:
- Tries
SuperDuperClient(which tries A → B → C) - If all fail, tries
ClientD