Skip to content

Add built-in ClinePass and Ollama Cloud provider presets - #12

Merged
codeking-ai merged 3 commits into
codeking-ai:masterfrom
m-musikhin:feature/builtin-providers-clinepass-ollama-cloud
Oct 15, 2026
Merged

codeking-ai merged 3 commits into
codeking-ai:masterfrom
m-musikhin:feature/builtin-providers-clinepass-ollama-cloud

Conversation

@m-musikhin

Copy link
Copy Markdown
Contributor

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 mandatory cline-pass/ slug prefix, so passthrough is a single prefix rule. pricing holds the upstream reference rates (used for quota measurement — the subscription is flat).

ollama-cloud — Ollama Cloud

Hosted models at https://ollama.com/v1 (OpenAI-compatible, /models available). The local Ollama runtime keeps the existing ollama id — this preset is the cloud-only path, hence ollama-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 not gpt, 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.4 NOT swallowed by a bare gpt prefix), both addable with the Anthropic bridge and no native /responses.
  • tests/unit/provider-presets.test.js format list + tests/unit/provider-user-presets.test.js built-in id list updated.
  • Full npm run test:unit: no new failures vs master.

🤖 Generated with Claude Code

m-musikhin and others added 3 commits October 14, 2026 00:55
…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>
@codeking-ai

Copy link
Copy Markdown
Owner

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. GET https://ollama.com/v1/models currently returns:

preset id live id
deepseek-v4-pro (used as the reasoning tier) deepseek-v4-pro:0813
gemma4 gemma4:31b
nemotron-3-nano nemotron-3-nano:30b

If Ollama doesn't alias the untagged names, any request remapped to the reasoning tier will fail with model-not-found. Please update models, tiers.reasoning and the matching pricing keys. The live list also includes mistral-large-3:675b, which could be added.

Minor: since cloud model availability shifts often (ClinePass already deprecated several models), it may be worth relying on /models discovery for ollama-cloud rather than a long static list.

@codeking-ai
codeking-ai merged commit 399590d into codeking-ai:master Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants