|
| 1 | +/** |
| 2 | + * Centralized model configuration for all AI providers. |
| 3 | + * Update these defaults when new models are released. |
| 4 | + */ |
| 5 | + |
| 6 | +import {ApiKeyType} from './agent'; |
| 7 | + |
| 8 | +// Default model names for each provider |
| 9 | +export const GEMINI_DEFAULT_MODEL = 'gemini-2.5-flash'; |
| 10 | +export const OPENAI_DEFAULT_MODEL = 'gpt-5-mini-2025-08-07'; |
| 11 | +export const CLAUDE_DEFAULT_MODEL = 'claude-haiku-4-5-20251001'; |
| 12 | +export const OLLAMA_DEFAULT_MODEL = 'ministral-3'; |
| 13 | + |
| 14 | +/** |
| 15 | + * Model option for UI dropdowns and selection. |
| 16 | + */ |
| 17 | +export interface ModelOption { |
| 18 | + id: string; |
| 19 | + displayName: string; |
| 20 | + apiType: ApiKeyType; |
| 21 | +} |
| 22 | + |
| 23 | +/** |
| 24 | + * Suggested Gemini models. |
| 25 | + */ |
| 26 | +export const GEMINI_MODELS: ModelOption[] = [ |
| 27 | + { |
| 28 | + id: 'gemini-2.5-flash', |
| 29 | + displayName: 'Gemini 2.5 Flash', |
| 30 | + apiType: ApiKeyType.GEMINI_API_KEY, |
| 31 | + }, |
| 32 | + { |
| 33 | + id: 'gemini-2.5-pro', |
| 34 | + displayName: 'Gemini 2.5 Pro', |
| 35 | + apiType: ApiKeyType.GEMINI_API_KEY, |
| 36 | + }, |
| 37 | +]; |
| 38 | + |
| 39 | +/** |
| 40 | + * Suggested OpenAI models. |
| 41 | + */ |
| 42 | +export const OPENAI_MODELS: ModelOption[] = [ |
| 43 | + { |
| 44 | + id: 'gpt-5-mini', |
| 45 | + displayName: 'GPT-5 mini', |
| 46 | + apiType: ApiKeyType.OPENAI_API_KEY, |
| 47 | + }, |
| 48 | +]; |
| 49 | + |
| 50 | +/** |
| 51 | + * Suggested Claude models. |
| 52 | + */ |
| 53 | +export const CLAUDE_MODELS: ModelOption[] = [ |
| 54 | + { |
| 55 | + id: 'claude-haiku-4-5-20251001', |
| 56 | + displayName: 'Claude Haiku 4.5', |
| 57 | + apiType: ApiKeyType.CLAUDE_API_KEY, |
| 58 | + }, |
| 59 | +]; |
| 60 | + |
| 61 | +/** |
| 62 | + * Suggested models grouped by provider. |
| 63 | + */ |
| 64 | +export const MODEL_OPTIONS: Record<ApiKeyType, ModelOption[]> = { |
| 65 | + [ApiKeyType.GEMINI_API_KEY]: GEMINI_MODELS, |
| 66 | + [ApiKeyType.OPENAI_API_KEY]: OPENAI_MODELS, |
| 67 | + [ApiKeyType.CLAUDE_API_KEY]: CLAUDE_MODELS, |
| 68 | + [ApiKeyType.OLLAMA_CUSTOM_URL]: [], // Ollama models are user-configured |
| 69 | +}; |
| 70 | + |
| 71 | +/** |
| 72 | + * Get the default model name for a given API type. |
| 73 | + */ |
| 74 | +export function getDefaultModelForApiType(apiType: ApiKeyType): string { |
| 75 | + switch (apiType) { |
| 76 | + case ApiKeyType.GEMINI_API_KEY: |
| 77 | + return GEMINI_DEFAULT_MODEL; |
| 78 | + case ApiKeyType.OPENAI_API_KEY: |
| 79 | + return OPENAI_DEFAULT_MODEL; |
| 80 | + case ApiKeyType.CLAUDE_API_KEY: |
| 81 | + return CLAUDE_DEFAULT_MODEL; |
| 82 | + case ApiKeyType.OLLAMA_CUSTOM_URL: |
| 83 | + return OLLAMA_DEFAULT_MODEL; |
| 84 | + default: |
| 85 | + return GEMINI_DEFAULT_MODEL; |
| 86 | + } |
| 87 | +} |
| 88 | + |
| 89 | +/** |
| 90 | + * All default models by provider, for reference. |
| 91 | + */ |
| 92 | +export const DEFAULT_MODELS = { |
| 93 | + [ApiKeyType.GEMINI_API_KEY]: GEMINI_DEFAULT_MODEL, |
| 94 | + [ApiKeyType.OPENAI_API_KEY]: OPENAI_DEFAULT_MODEL, |
| 95 | + [ApiKeyType.CLAUDE_API_KEY]: CLAUDE_DEFAULT_MODEL, |
| 96 | + [ApiKeyType.OLLAMA_CUSTOM_URL]: OLLAMA_DEFAULT_MODEL, |
| 97 | +} as const; |
0 commit comments