Menu

AI Gateway adds confidence-based decision fallbacks - Vercel
📰

AI Gateway adds confidence-based decision fallbacks - Vercel

Vercel News·Rohan Taneja·5 days ago
#YmO89ZB5
#vercel#gateway#model#fallback#choice
Reading 0:00
15s threshold

AI Gateway can now escalate a decision request to a fallback model when the primary model's answer trips a confidence condition you set .

Conditions can be combined, so an escalation can depend on more than one signal. The plain model names you already list in models keep catching outright errors, so existing fallbacks are unaffected. Confidence conditions cover Choice and Score questions. Boolean questions escalate on a probability range instead.

Set the fallback by adding one conditional object to providerOptions.gateway.models . Requests without it keep their existing behavior.

import { gateway } from '@ai-sdk/gateway' ;

import { experimental_decide as decide } from 'ai' ;

const result = await decide ( {

model : gateway .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.