diff --git a/src/api/services/provider-presets.ts b/src/api/services/provider-presets.ts index d055e4a8..510246e4 100644 --- a/src/api/services/provider-presets.ts +++ b/src/api/services/provider-presets.ts @@ -17,8 +17,8 @@ export interface ProviderPreset { apiKeyPlaceholder: string; apiKeyHint: string; category: PresetCategory; - /** Set to false for local providers that don't need API key (default: true) */ - requiresApiKey?: boolean; + /** Whether API key is required (default: true, set false for local providers) */ + requiresApiKey: boolean; /** Additional env vars for thinking mode, etc. */ extraEnv?: Record; /** Enable always thinking mode */ @@ -44,6 +44,7 @@ export const PROVIDER_PRESETS: ProviderPreset[] = [ apiKeyPlaceholder: 'sk-or-...', apiKeyHint: 'Get your API key at openrouter.ai/keys', category: 'recommended', + requiresApiKey: true, }, { id: 'ollama', @@ -68,6 +69,7 @@ export const PROVIDER_PRESETS: ProviderPreset[] = [ apiKeyPlaceholder: 'ghp_...', apiKeyHint: 'Get your API key from Z.AI', category: 'alternative', + requiresApiKey: true, }, { id: 'glmt', @@ -79,6 +81,7 @@ export const PROVIDER_PRESETS: ProviderPreset[] = [ apiKeyPlaceholder: 'ghp_...', apiKeyHint: 'Same API key as GLM', category: 'alternative', + requiresApiKey: true, extraEnv: { ANTHROPIC_TEMPERATURE: '0.2', ANTHROPIC_MAX_TOKENS: '65536', @@ -99,6 +102,7 @@ export const PROVIDER_PRESETS: ProviderPreset[] = [ apiKeyPlaceholder: 'sk-...', apiKeyHint: 'Get your API key from Moonshot AI', category: 'alternative', + requiresApiKey: true, alwaysThinkingEnabled: true, }, { @@ -111,6 +115,7 @@ export const PROVIDER_PRESETS: ProviderPreset[] = [ apiKeyPlaceholder: 'YOUR_AZURE_API_KEY', apiKeyHint: 'Create resource at ai.azure.com, get API key from Keys tab', category: 'alternative', + requiresApiKey: true, }, { id: 'mm', @@ -122,6 +127,7 @@ export const PROVIDER_PRESETS: ProviderPreset[] = [ apiKeyPlaceholder: 'YOUR_MINIMAX_API_KEY_HERE', apiKeyHint: 'Get your API key at platform.minimax.io', category: 'alternative', + requiresApiKey: true, }, { id: 'deepseek', @@ -133,6 +139,7 @@ export const PROVIDER_PRESETS: ProviderPreset[] = [ apiKeyPlaceholder: 'sk-...', apiKeyHint: 'Get your API key at platform.deepseek.com', category: 'alternative', + requiresApiKey: true, }, { id: 'qwen', @@ -144,6 +151,7 @@ export const PROVIDER_PRESETS: ProviderPreset[] = [ apiKeyPlaceholder: 'sk-...', apiKeyHint: 'Get your API key from Alibaba Cloud Model Studio', category: 'alternative', + requiresApiKey: true, }, { id: 'ollama-cloud', @@ -155,6 +163,7 @@ export const PROVIDER_PRESETS: ProviderPreset[] = [ apiKeyPlaceholder: 'YOUR_OLLAMA_CLOUD_API_KEY', apiKeyHint: 'Get your API key at ollama.com', category: 'alternative', + requiresApiKey: true, }, ]; diff --git a/src/commands/api-command.ts b/src/commands/api-command.ts index 2e740ba6..df38438e 100644 --- a/src/commands/api-command.ts +++ b/src/commands/api-command.ts @@ -191,7 +191,9 @@ async function handleCreate(args: string[]): Promise { apiKey = parsedArgs.apiKey; } else { console.log(info('No API key required for local Ollama')); - apiKey = 'ollama'; // Placeholder token matching template + // Sentinel value 'ollama' matches config/base-ollama.settings.json template + // This is not a valid API key, just a placeholder for local-only providers + apiKey = 'ollama'; } } else if (!apiKey) { const keyPrompt = preset?.apiKeyHint ? `API Key (${preset.apiKeyHint})` : 'API Key'; diff --git a/ui/public/icons/ollama.svg b/ui/public/icons/ollama.svg index cc887e3d..c5e666a0 100644 --- a/ui/public/icons/ollama.svg +++ b/ui/public/icons/ollama.svg @@ -1 +1 @@ -Ollama \ No newline at end of file +Ollama