diff --git a/config/base-ollama-cloud.settings.json b/config/base-ollama-cloud.settings.json new file mode 100644 index 00000000..a574e88b --- /dev/null +++ b/config/base-ollama-cloud.settings.json @@ -0,0 +1,10 @@ +{ + "env": { + "ANTHROPIC_BASE_URL": "https://ollama.com", + "ANTHROPIC_AUTH_TOKEN": "YOUR_OLLAMA_CLOUD_API_KEY_HERE", + "ANTHROPIC_MODEL": "glm-4.7:cloud", + "ANTHROPIC_DEFAULT_OPUS_MODEL": "qwen3-coder:480b", + "ANTHROPIC_DEFAULT_SONNET_MODEL": "glm-4.7:cloud", + "ANTHROPIC_DEFAULT_HAIKU_MODEL": "minimax-m2.1:cloud" + } +} diff --git a/config/base-ollama.settings.json b/config/base-ollama.settings.json new file mode 100644 index 00000000..8c14903e --- /dev/null +++ b/config/base-ollama.settings.json @@ -0,0 +1,10 @@ +{ + "env": { + "ANTHROPIC_BASE_URL": "http://localhost:11434", + "ANTHROPIC_AUTH_TOKEN": "ollama", + "ANTHROPIC_MODEL": "qwen3-coder", + "ANTHROPIC_DEFAULT_OPUS_MODEL": "gpt-oss:120b", + "ANTHROPIC_DEFAULT_SONNET_MODEL": "gpt-oss:20b", + "ANTHROPIC_DEFAULT_HAIKU_MODEL": "qwen3-coder" + } +} diff --git a/src/api/services/provider-presets.ts b/src/api/services/provider-presets.ts index 82223565..7a70a61a 100644 --- a/src/api/services/provider-presets.ts +++ b/src/api/services/provider-presets.ts @@ -43,6 +43,17 @@ export const PROVIDER_PRESETS: ProviderPreset[] = [ apiKeyHint: 'Get your API key at openrouter.ai/keys', category: 'recommended', }, + { + id: 'ollama', + name: 'Ollama (Local)', + description: 'Local open-source models via Ollama (32K+ context recommended)', + baseUrl: 'http://localhost:11434', + defaultProfileName: 'ollama', + defaultModel: 'qwen3-coder', + apiKeyPlaceholder: 'ollama', + apiKeyHint: 'Install Ollama from ollama.com - no API key needed for local', + category: 'recommended', + }, // Alternative providers { id: 'glm', @@ -131,6 +142,17 @@ export const PROVIDER_PRESETS: ProviderPreset[] = [ apiKeyHint: 'Get your API key from Alibaba Cloud Model Studio', category: 'alternative', }, + { + id: 'ollama-cloud', + name: 'Ollama Cloud', + description: 'Ollama.com cloud models (glm-4.7:cloud, qwen3-coder:480b)', + baseUrl: 'https://ollama.com', + defaultProfileName: 'ollama-cloud', + defaultModel: 'glm-4.7:cloud', + apiKeyPlaceholder: 'YOUR_OLLAMA_CLOUD_API_KEY', + apiKeyHint: 'Get your API key at ollama.com', + category: 'alternative', + }, ]; /** Get preset by ID */ diff --git a/src/commands/api-command.ts b/src/commands/api-command.ts index 1c51b9fa..a96707a0 100644 --- a/src/commands/api-command.ts +++ b/src/commands/api-command.ts @@ -426,7 +426,7 @@ async function showHelp(): Promise { console.log(''); console.log(subheader('Options')); console.log( - ` ${color('--preset ', 'command')} Use provider preset (openrouter, glm, glmt, kimi, foundry, mm, deepseek, qwen)` + ` ${color('--preset ', 'command')} Use provider preset (openrouter, ollama, glm, glmt, kimi, foundry, mm, deepseek, qwen)` ); console.log(` ${color('--base-url ', 'command')} API base URL (create)`); console.log(` ${color('--api-key ', 'command')} API key (create)`); @@ -438,6 +438,12 @@ async function showHelp(): Promise { console.log( ` ${color('openrouter', 'command')} OpenRouter - 349+ models (Claude, GPT, Gemini, Llama)` ); + console.log( + ` ${color('ollama', 'command')} Ollama - Local open-source models (no API key)` + ); + console.log( + ` ${color('ollama-cloud', 'command')} Ollama Cloud - glm-4.7:cloud, qwen3-coder:480b` + ); console.log(` ${color('glm', 'command')} GLM - Claude via Z.AI`); console.log(` ${color('glmt', 'command')} GLMT - GLM with Thinking mode`); console.log(` ${color('kimi', 'command')} Kimi - Moonshot AI reasoning model`); diff --git a/src/commands/help-command.ts b/src/commands/help-command.ts index effb55a4..3d7540f4 100644 --- a/src/commands/help-command.ts +++ b/src/commands/help-command.ts @@ -127,6 +127,8 @@ Run ${color('ccs config', 'command')} for web dashboard`.trim(); ['ccs glm', 'GLM 4.6 (API key required)'], ['ccs glmt', 'GLM with thinking mode'], ['ccs kimi', 'Kimi for Coding (API key)'], + ['ccs ollama', 'Local Ollama (http://localhost:11434)'], + ['ccs ollama-cloud', 'Ollama Cloud (API key required)'], ['', ''], // Spacer ['ccs api create', 'Create custom API profile'], ['ccs api remove', 'Remove an API profile'],