Stripped from vercel/chatbot (Apache 2.0): - Dropped @vercel/* packages and AI Gateway - Removed artifacts feature (code/text/sheet/image side panel) - Switched AI provider to @ai-sdk/openai-compatible -> EGBE LiteLLM - Replaced Vercel Blob upload with data URLs - Dropped Redis resumable streams and rate limiter (in-memory now) - Added Dockerfile (Next.js standalone) + entrypoint that runs migrations - Wired DATABASE_URL, EGBE_AI_API_URL/KEY, NEXT_PUBLIC_BASE_URL for app-deploy.sh
88 lines
2.2 KiB
TypeScript
88 lines
2.2 KiB
TypeScript
export const DEFAULT_CHAT_MODEL = "claude-sonnet";
|
|
|
|
export type ModelCapabilities = {
|
|
tools: boolean;
|
|
vision: boolean;
|
|
reasoning: boolean;
|
|
};
|
|
|
|
export type ChatModel = {
|
|
id: string;
|
|
name: string;
|
|
provider: string;
|
|
description: string;
|
|
};
|
|
|
|
export const chatModels: ChatModel[] = [
|
|
{
|
|
id: "claude-sonnet",
|
|
name: "Claude Sonnet 4.6",
|
|
provider: "anthropic",
|
|
description: "Anthropic's flagship model — balanced reasoning and speed",
|
|
},
|
|
{
|
|
id: "claude-haiku",
|
|
name: "Claude Haiku 4.5",
|
|
provider: "anthropic",
|
|
description: "Fast and cheap Anthropic model",
|
|
},
|
|
{
|
|
id: "gpt-5.4",
|
|
name: "GPT-5.4",
|
|
provider: "openai",
|
|
description: "OpenAI's flagship",
|
|
},
|
|
{
|
|
id: "gpt-5.4-mini",
|
|
name: "GPT-5.4 Mini",
|
|
provider: "openai",
|
|
description: "Fast and cheap OpenAI model",
|
|
},
|
|
{
|
|
id: "kimi-k2.6",
|
|
name: "Kimi K2.6",
|
|
provider: "moonshotai",
|
|
description: "Moonshot AI flagship",
|
|
},
|
|
{
|
|
id: "minimax-m2.7",
|
|
name: "MiniMax M2.7",
|
|
provider: "minimax",
|
|
description: "MiniMax open-source model",
|
|
},
|
|
{
|
|
id: "qwen3-coder",
|
|
name: "Qwen3 Coder",
|
|
provider: "alibaba",
|
|
description: "Code-specialized model",
|
|
},
|
|
];
|
|
|
|
export const titleModel = chatModels.find((m) => m.id === "claude-haiku")!;
|
|
|
|
export const allowedModelIds = new Set(chatModels.map((m) => m.id));
|
|
|
|
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[]>
|
|
);
|
|
|
|
export const modelCapabilities: Record<string, ModelCapabilities> = {
|
|
"claude-sonnet": { tools: true, vision: true, reasoning: true },
|
|
"claude-haiku": { tools: true, vision: true, reasoning: false },
|
|
"gpt-5.4": { tools: true, vision: true, reasoning: true },
|
|
"gpt-5.4-mini": { tools: true, vision: true, reasoning: false },
|
|
"kimi-k2.6": { tools: true, vision: false, reasoning: false },
|
|
"minimax-m2.7": { tools: true, vision: false, reasoning: false },
|
|
"qwen3-coder": { tools: true, vision: false, reasoning: false },
|
|
};
|
|
|
|
export function getActiveModels(): ChatModel[] {
|
|
return chatModels;
|
|
}
|