Skip to content

Commit 97091c8

Browse files
authored
Do not route Fable randomly to Vercel (#3959)
1 parent 22afa8b commit 97091c8

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

  • apps/web/src/lib/ai-gateway/providers/vercel

apps/web/src/lib/ai-gateway/providers/vercel/index.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import { VERCEL_ROUTING_REDIS_KEY } from '@/lib/redis-keys';
2424
import { getRandomNumber } from '@/lib/ai-gateway/getRandomNumber';
2525
import { getVercelModels } from '@/lib/ai-gateway/providers/gateway-models-cache';
2626
import type { AnthropicProviderOptions } from '@ai-sdk/anthropic';
27+
import { isFableModel } from '@/lib/ai-gateway/providers/anthropic.constants';
2728

2829
const getVercelRoutingPercentage = createCachedFetch(
2930
async () => {
@@ -55,6 +56,13 @@ export async function shouldRouteToVercel(
5556
return false;
5657
}
5758

59+
if (isFableModel(requestedModel)) {
60+
console.debug(
61+
"[shouldRouteToVercel] not routing to Vercel because the Fable->Opus fallback doesn't seem to work"
62+
);
63+
return false;
64+
}
65+
5866
console.debug('[shouldRouteToVercel] randomizing user to either OpenRouter or Vercel');
5967
const [routingPercentage, vercelModels] = await Promise.all([
6068
getVercelRoutingPercentage(),

0 commit comments

Comments
 (0)