AI Gateway adds confidence-based decision fallbacks
Key point
The new beta feature escalates requests to a fallback model when primary answers fail user-defined confidence thresholds, billing both stages.
Details
AI Gateway now supports confidence-based decision fallbacks, allowing requests to escalate to a secondary model if the primary model's answer fails a user-defined confidence condition. This beta feature enables more robust decision-making by combining multiple signals, such as probability ranges for Boolean questions or thresholds for Choice and Score questions.
Configuration and Behavior
Fallbacks are configured by adding a conditional object to providerOptions.gateway.models. Existing fallbacks that catch outright errors remain unaffected. If the question field is omitted, the condition applies to every question of the matching type; for example, { "confidenceBelow": 0.6 } triggers an escalation for any Choice or Score answer below 0.6.
Cost Implications
Because a triggered fallback executes a second decision process, both stages are billed. Users should account for this additional cost when setting low confidence thresholds that may frequently trigger escalations.
This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.
Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.