Repository navigation
Add built-in ClinePass and Ollama Cloud provider presets - #12
codeking-ai merged 3 commits into
Conversation
…x to presets - Load user-defined provider presets from ~/.cligate/provider-presets.json at module init; validated entries merge additively after built-ins and become first-class (add-key form, model mapping, discovery, protocols, pricing). Invalid entries are skipped with warnings; built-in ids are protected from collision. - Migrate Zhipu/Moonshot/MiniMax from bespoke classes to declarative presets served by the generic OpenAI-compatible provider. Existing api-keys.json entries keep working (same ids, base URLs, pricing). New preset field validateModel: Zhipu key validation probes a 1-token chat request instead of GET /models (which Zhipu does not serve). - Zhipu/Moonshot/MiniMax gain tier maps + static model lists: non-native models now remap via tiers instead of passing through verbatim. - Fix settings-page normalizeModelMappingProvider: stop folding zhipu/moonshot/minimax into 'openai' — provider identity in the mapping UI is now 1:1 with runtime resolveModel(providerType, ...). - Add docs/CUSTOM_PROVIDERS.md and unit tests for the loader, the migration, and the normalization fix. Co-Authored-By: Claude Code <noreply@anthropic.com>
…2026) Model ids verified against OpenRouter vendor listings (z-ai, moonshotai, minimax) and official pricing pages (platform.kimi.ai, platform.minimax.io, docs.z.ai). - zhipu: glm-5.3 family (flagship glm-5.3, standard glm-5.2, fast glm-5.3-flash); drop retired glm-5-turbo/glm-4-plus/glm-4-air* - moonshot: kimi-k3 flagship, kimi-k2.6 standard, kimi-k2.7-code highspeed fast; drop retired kimi-k2.5/kimi-k2-thinking - minimax: MiniMax-M3 flagship, M2.7 standard; fix M2.7-highspeed input price (0.60, was 0.30) - pricing tables synced: new cacheRead rates and 2026 prices; glm-4.7-flash/glm-4-flash are free Co-Authored-By: Claude Code <noreply@anthropic.com>
- clinepass: Cline's flat subscription for open-weight models via api.cline.bot/api/v1 (OpenAI chat-compatible; ids carry the mandatory cline-pass/ slug prefix, so a single native prefix covers passthrough). Pricing entries are the upstream reference rates used for quota measurement, not per-token billing. - ollama-cloud: hosted models at ollama.com/v1 (the local Ollama runtime keeps the `ollama` id — this preset is the cloud-only path). Passthrough combines exact family prefixes (gpt-oss, glm, kimi, deepseek, ...) with a `:` match for tag-style ids like gpt-oss:120b, so explicitly requested catalog ids are never tier-remapped. - i18n labels (EN/ZH), docs built-in id list, preset test coverage. Co-Authored-By: Claude Code <noreply@anthropic.com>
|
Thanks! Verified the ClinePass catalog and reference pricing against https://docs.cline.bot/getting-started/clinepass — model slugs and rates match exactly. Preset tests pass. Merging (after #11). One issue to fix in a follow-up: several Ollama Cloud model ids don't match the live catalog.
If Ollama doesn't alias the untagged names, any request remapped to the reasoning tier will fail with model-not-found. Please update Minor: since cloud model availability shifts often (ClinePass already deprecated several models), it may be worth relying on |
Summary
Follow-up to #11 (user-defined provider presets): adds two popular subscriptions as built-in presets, so they work out of the box without a hand-written JSON file.
clinepass— ClinePass (Cline subscription)Cline's flat subscription ($9.99/mo) for open-weight models (GLM, Kimi, DeepSeek, MiMo, MiniMax, Qwen) served from
https://api.cline.bot/api/v1. OpenAI chat-compatible only upstream (no native Anthropic endpoint) — Claude Code still works through the generic provider's Anthropic⇄chat bridge. Every model id carries the mandatorycline-pass/slug prefix, so passthrough is a single prefix rule.pricingholds the upstream reference rates (used for quota measurement — the subscription is flat).ollama-cloud— Ollama CloudHosted models at
https://ollama.com/v1(OpenAI-compatible,/modelsavailable). The local Ollama runtime keeps the existingollamaid — this preset is the cloud-only path, henceollama-cloud. Cloud model ids mix bare vendor names (glm-5.3,kimi-k3) and tag-style ones (gpt-oss:120b), so passthrough combines exact family prefixes (gpt-oss— deliberately notgpt, or incoming gpt-5.x from Codex would stop remapping — plus glm/kimi/deepseek/minimax/gemma/mistral/nemotron/qwen/llama/phi/granite) with a:substring match.Both presets land automatically in the add-key form, model mapping (own tier maps), discovery, and pricing via the existing data-driven preset pipeline — no new provider classes.
Test plan
tests/unit/provider-presets.test.js: extended with clinepass/ollama-cloud cases — native passthrough (cline-pass/*, bare +:-tagged ids), tier remap of non-native ids (claude-sonnet-4-6→ tier model;gpt-5.4NOT swallowed by a baregptprefix), both addable with the Anthropic bridge and no native/responses.tests/unit/provider-presets.test.jsformat list +tests/unit/provider-user-presets.test.jsbuilt-in id list updated.npm run test:unit: no new failures vs master.🤖 Generated with Claude Code