feat: dynamic model discovery from vercel ai gateway (#1353)

This commit is contained in:
josh 2025-12-14 21:26:49 +00:00 committed by GitHub
parent 2b0b42d144
commit b1da86062e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
74 changed files with 7426 additions and 2277 deletions

View file

@ -1,21 +1,89 @@
export const DEFAULT_CHAT_MODEL: string = "chat-model";
// Curated list of top models from Vercel AI Gateway
export const DEFAULT_CHAT_MODEL = "google/gemini-2.5-flash-lite";
export type ChatModel = {
id: string;
name: string;
provider: string;
description: string;
};
export const chatModels: ChatModel[] = [
// Anthropic
{
id: "chat-model",
name: "Grok Vision",
description: "Advanced multimodal model with vision and text capabilities",
id: "anthropic/claude-haiku-4.5",
name: "Claude Haiku 4.5",
provider: "anthropic",
description: "Fast and affordable, great for everyday tasks",
},
{
id: "chat-model-reasoning",
name: "Grok Reasoning",
description:
"Uses advanced chain-of-thought reasoning for complex problems",
id: "anthropic/claude-sonnet-4.5",
name: "Claude Sonnet 4.5",
provider: "anthropic",
description: "Best balance of speed, intelligence, and cost",
},
{
id: "anthropic/claude-opus-4.5",
name: "Claude Opus 4.5",
provider: "anthropic",
description: "Most capable Anthropic model",
},
// OpenAI
{
id: "openai/gpt-4.1-mini",
name: "GPT-4.1 Mini",
provider: "openai",
description: "Fast and cost-effective for simple tasks",
},
{
id: "openai/gpt-5.2",
name: "GPT-5.2",
provider: "openai",
description: "Most capable OpenAI model",
},
// Google
{
id: "google/gemini-2.5-flash-lite",
name: "Gemini 2.5 Flash Lite",
provider: "google",
description: "Ultra fast and affordable",
},
{
id: "google/gemini-3-pro-preview",
name: "Gemini 3 Pro",
provider: "google",
description: "Most capable Google model",
},
// xAI
{
id: "xai/grok-4.1-fast-non-reasoning",
name: "Grok 4.1 Fast",
provider: "xai",
description: "Fast with 30K context",
},
// Reasoning models (extended thinking)
{
id: "anthropic/claude-3.7-sonnet-thinking",
name: "Claude 3.7 Sonnet",
provider: "reasoning",
description: "Extended thinking for complex problems",
},
{
id: "xai/grok-code-fast-1-thinking",
name: "Grok Code Fast",
provider: "reasoning",
description: "Reasoning optimized for code",
},
];
// Group models by provider for UI
export const modelsByProvider = chatModels.reduce(
(acc, model) => {
if (!acc[model.provider]) {
acc[model.provider] = [];
}
acc[model.provider].push(model);
return acc;
},
{} as Record<string, ChatModel[]>
);