Skip to content

feat(models): refresh preset provider catalog and model lists - #1781

Merged
bobleer merged 7 commits into
GCWing:mainfrom
bobleer:feat/refresh-model-provider-presets
Jul 26, 2026
Merged

feat(models): refresh preset provider catalog and model lists#1781
bobleer merged 7 commits into
GCWing:mainfrom
bobleer:feat/refresh-model-provider-presets

Conversation

@bobleer

@bobleer bobleer commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

Aligns the built-in AI provider presets with providers' current offerings, using opencode's data source (models.dev) as the reference catalog.

Model list updates

Provider Before After
Anthropic claude-opus-4-6, claude-sonnet-4-6 claude-opus-5, claude-fable-5, claude-sonnet-5, claude-haiku-4-5
Gemini gemini-3.1-pro-preview, gemini-3.1-flash-lite-preview gemini-3.1-pro-preview, gemini-3.6-flash, gemini-3.5-flash-lite
Zhipu glm-5, glm-4.7 glm-5.2, glm-5.1, glm-5
Qwen Qwen3.5-Plus, Qwen3.5-Flash qwen3.7-plus, qwen3.7-max, qwen3.6-flash
Moonshot kimi-k2.5, kimi-k2, kimi-k2-thinking kimi-k3, kimi-k2.7-code, kimi-k2.6, kimi-for-coding
MiniMax MiniMax-M2.7-highspeed, MiniMax-M2.5-highspeed MiniMax-M3, MiniMax-M2.7, MiniMax-M2.7-highspeed
Volcengine doubao-seed-2-0-* + doubao-seed-2-1-pro-260628
SiliconFlow (empty) GLM-5.2 / DeepSeek-V4 presets

Endpoint aggregation (国内/海外 + API/Coding Plan)

Each provider now aggregates its regional and plan-specific endpoints under one template via baseUrlOptions:

  • Zhipu: bigmodel.cn (OpenAI/Anthropic/Coding Plan) + Z.AI intl (OpenAI/Anthropic/Coding Plan)
  • Qwen: DashScope cn/intl + Coding Plan cn/intl + Coding Plan Anthropic
  • MiniMax: minimaxi.com (cn) / minimax.io (intl), Anthropic + OpenAI-compatible each
  • Moonshot: moonshot.cn / moonshot.ai (OpenAI + Anthropic each) + Kimi For Coding
  • Volcengine: cn-beijing Ark + Ark Coding Plan + BytePlus intl
  • SiliconFlow: siliconflow.cn (OpenAI/Anthropic) + siliconflow.com intl
  • DeepSeek: OpenAI endpoint + official Anthropic endpoint

Supporting changes

  • providerCatalog.ts: URL catalog extended so template inference recognizes the new endpoints
  • i18n: new URL-option labels for zh-CN / zh-TW / en-US; installer locales synced via sync-model-i18n.cjs
  • Reasoning: Claude 5 family recognized for adaptive (effort) reasoning in web-ui gating; claude-fable mapped to the same thinking capability as claude-mythos in the Anthropic adapter (effort-only, no budget_tokens)
  • URL quirks: enable_thinking now also applies to dashscope-intl / siliconflow.com; tool_stream also applies to api.z.ai
  • CLI provider selector presets updated to match

Testing

  • vitest run src/infrastructure/config — 150 tests pass
  • tsc --noEmit (web-ui) — clean
  • cargo test -p bitfun-ai-adapters — 151+ tests pass
  • cargo check -p bitfun-cli — clean
  • All locale JSON files validated

bowen628 added 3 commits July 26, 2026 19:15
Align built-in provider presets with current provider offerings
(referencing opencode's models.dev catalog):

- Update preset model names to current generations (Claude 5 family,
  GLM-5.x, Kimi K3, Qwen 3.7, MiniMax M3, DeepSeek V4, Doubao Seed 2.1,
  Gemini 3.5/3.6)
- Aggregate China/international endpoints and API/coding-plan endpoints
  under each provider via baseUrlOptions (Zhipu+Z.AI, DashScope+intl,
  MiniMax cn/io, Moonshot cn/ai + Kimi For Coding, SiliconFlow cn/com,
  Volcengine + BytePlus + coding plan, DeepSeek Anthropic endpoint)
- Extend provider URL catalog for template inference from new endpoints
- Localize new base URL option notes (zh-CN, zh-TW, en-US; installer synced)
- Recognize Claude 5 family adaptive reasoning (web-ui gating and
  Anthropic adapter thinking capability for claude-fable)
- Extend URL quirks to intl endpoints (dashscope-intl, siliconflow.com,
  api.z.ai tool_stream)
- Update CLI provider selector presets
The sync-model-i18n script only writes en.json and zh.json; the new
keys it introduced broke locale key parity with zh-TW.json in the
i18n audit. Add the 14 missing keys, sourced from the web-ui zh-TW
locale where available.
- Send Authorization: Bearer to Anthropic-compatible endpoints whose
  vendors document ANTHROPIC_AUTH_TOKEN auth: Z.AI, Moonshot /anthropic
  gateway, Kimi For Coding (previously only bigmodel.cn; the new Z.AI
  preset would have failed auth with x-api-key)
- Drop kimi-for-coding from the shared Moonshot model list; it only
  exists on the api.kimi.com/coding endpoint and 404s on the default
  moonshot.cn API
- Recognize dashscope-intl in the Qwen ASR base-url detection
- Localize installer advancedShow/advancedHide (was hardcoded English
  in zh via the sync script) and refresh the stale glm placeholder
@bobleer

bobleer commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator Author

Applied review fixes in 9dc52a8:

  • Bearer auth for Z.AI / Moonshot /anthropic / Kimi For Coding endpoints (vendors document ANTHROPIC_AUTH_TOKEN; the Z.AI anthropic preset would previously 401 with x-api-key)
  • Dropped kimi-for-coding from the shared Moonshot list (only valid on api.kimi.com/coding)
  • Qwen ASR detection now recognizes dashscope-intl
  • Localized installer advancedShow/advancedHide and refreshed the stale glm-4.7 placeholder

Also fb33921 fixed the CI i18n audit failure (installer zh-TW key parity).

…W installer i18n

Second-pass review follow-ups:
- The bearer-auth branch previously dropped the anthropic-version header
  for all bearer endpoints; keep sending it to Z.AI / Moonshot / Kimi
  gateways (Anthropic protocol requires it) while leaving bigmodel.cn's
  shipped behavior untouched
- Tighten the Kimi match to api.kimi.com/coding
- Teach sync-model-i18n.cjs to generate zh-TW.json (with zh-TW literals
  for installer-only strings) so installer locale parity cannot silently
  break again; re-synced zh-TW from the web-ui source of truth
@bobleer

bobleer commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator Author

Second review pass complete; follow-ups in e2baaf4:

  • Bearer gateways (Z.AI / Moonshot /anthropic / Kimi For Coding) now also receive anthropic-version — the previous fix inherited bigmodel.cn's omit-version behavior, which is kept unchanged only for bigmodel.cn
  • api.kimi.com match tightened to api.kimi.com/coding
  • sync-model-i18n.cjs now generates zh-TW.json too, so installer locale key parity can't silently break on future key additions

Reviewer also verified migration safety for existing users: saved model configs (old model names, custom URLs) are untouched user data; provider grouping is independent of the expanded URL catalog; the catalog-based display-name migration only fills unnamed configs and strictly improves inferred names (e.g. api.z.ai previously inferred as "z").

bowen628 added 2 commits July 26, 2026 20:01
The presets are duplicated across the web UI, the installer, the URL
catalog and three locale bundles, and every drift between them has
shipped either a request-time failure or an untranslated label. Assert
the invariants instead of re-checking them by hand: catalog coverage
both ways, note keys resolving to distinct labels in every locale, base
URL shape matching what each adapter appends, and no URL owned by two
providers.

Verified by mutation: dropping a catalog URL, deleting a locale key and
appending /v1 to an Anthropic base URL each fail a distinct assertion.
Third review pass (endpoint fact-check + Rust request tracing + frontend
flow), all endpoints live-probed:

- Note the Kimi For Coding model IDs on that base URL option; the plan
  serves k3 / kimi-for-coding, which are disjoint from the Moonshot API
  model list the provider block otherwise offers
- Point the Moonshot and Anthropic help links at the hosts they now
  redirect to (platform.kimi.ai, platform.claude.com)
- Normalize per-model reasoning drafts when the base URL dropdown
  changes the wire format, matching what the request-format dropdown
  already did; otherwise an adaptive mode or thinking budget could
  persist against a format that cannot express it
- Installer: only a preset URL implies its format. A hand-typed proxy
  URL no longer snaps the format back to the template default, which
  would write an OpenAI config against an Anthropic-only endpoint
- Installer: fall back to a note key's last segment instead of printing
  the whole dotted path when a translation is missing

Cover the auth split with tests: Z.AI / Moonshot / Kimi document bearer
tokens, while DeepSeek and MiniMax document x-api-key, so the two groups
must not be unified. Also pin the Claude 5 thinking capabilities and
assert vendor model names never take the Claude-specific paths.
@bobleer

bobleer commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator Author

Third review pass — three independent lenses (endpoint fact-check, Rust request-construction tracing, frontend flow + existing-user data). Fixes in 2789f19, plus a regression test in 4f079f9.

Every endpoint was live-probed; no 404-class errors. Notably the Volcengine coding-plan path ark.cn-beijing.volces.com/api/coding/v3 is correct (an alternative host suggested elsewhere, coding.volcengineapi.com, does not resolve at all), and doubao-seed-2-1-pro-260628 is real. Model IDs otherwise follow the models.dev catalog.

Fixed:

  • Kimi For Coding serves a disjoint model set (k3 / kimi-for-coding), so its base-URL option now names them
  • Moonshot and Anthropic help links pointed at hosts that now redirect (→ platform.kimi.ai, platform.claude.com)
  • The base-URL dropdown changed the wire format without normalizing per-model reasoning drafts, unlike the request-format dropdown; an adaptive mode or thinking budget could persist against a format that cannot express it
  • Installer: a hand-typed proxy URL snapped the format back to the template default, writing an OpenAI config against an Anthropic-only endpoint
  • Installer: a missing translation printed the whole dotted key

Deliberately not changed, since two reviewers disagreed and the evidence settles it: DeepSeek and MiniMax /anthropic stay on x-api-key (DeepSeek documents ANTHROPIC_API_KEY; MiniMax has shipped that way since before this PR) rather than joining the bearer group. That distinction is now covered by tests so it can't be 'fixed' by accident. Likewise tool_stream on api.z.ai is intentional parity — the Anthropic builder already sends it to bigmodel.cn, the same backend.

Also added providerPresets.test.ts, which asserts the invariants that kept drifting: catalog coverage both ways, note keys resolving to distinct labels in all three locales, base-URL shape matching what each adapter appends, and no URL owned by two providers. Mutation-tested — dropping a catalog URL, deleting a locale key and appending /v1 to an Anthropic base URL each fail a distinct assertion.

Verification: web-ui 154 tests + tsc clean, installer tsc clean, cargo test -p bitfun-ai-adapters 185 pass, i18n audit 23/0.

@bobleer
bobleer merged commit 1d8e1db into GCWing:main Jul 26, 2026
5 checks passed
1688mengdie pushed a commit to 1688mengdie/BitFun that referenced this pull request Jul 26, 2026
…#1781)

* feat(models): refresh preset provider catalog and model lists

Align built-in provider presets with current provider offerings
(referencing opencode's models.dev catalog):

- Update preset model names to current generations (Claude 5 family,
  GLM-5.x, Kimi K3, Qwen 3.7, MiniMax M3, DeepSeek V4, Doubao Seed 2.1,
  Gemini 3.5/3.6)
- Aggregate China/international endpoints and API/coding-plan endpoints
  under each provider via baseUrlOptions (Zhipu+Z.AI, DashScope+intl,
  MiniMax cn/io, Moonshot cn/ai + Kimi For Coding, SiliconFlow cn/com,
  Volcengine + BytePlus + coding plan, DeepSeek Anthropic endpoint)
- Extend provider URL catalog for template inference from new endpoints
- Localize new base URL option notes (zh-CN, zh-TW, en-US; installer synced)
- Recognize Claude 5 family adaptive reasoning (web-ui gating and
  Anthropic adapter thinking capability for claude-fable)
- Extend URL quirks to intl endpoints (dashscope-intl, siliconflow.com,
  api.z.ai tool_stream)
- Update CLI provider selector presets

* fix(i18n): backfill installer zh-TW keys added by model i18n sync

The sync-model-i18n script only writes en.json and zh.json; the new
keys it introduced broke locale key parity with zh-TW.json in the
i18n audit. Add the 14 missing keys, sourced from the web-ui zh-TW
locale where available.

* fix(models): address review findings on new provider endpoints

- Send Authorization: Bearer to Anthropic-compatible endpoints whose
  vendors document ANTHROPIC_AUTH_TOKEN auth: Z.AI, Moonshot /anthropic
  gateway, Kimi For Coding (previously only bigmodel.cn; the new Z.AI
  preset would have failed auth with x-api-key)
- Drop kimi-for-coding from the shared Moonshot model list; it only
  exists on the api.kimi.com/coding endpoint and 404s on the default
  moonshot.cn API
- Recognize dashscope-intl in the Qwen ASR base-url detection
- Localize installer advancedShow/advancedHide (was hardcoded English
  in zh via the sync script) and refresh the stale glm placeholder

* fix(models): keep anthropic-version on new bearer gateways; sync zh-TW installer i18n

Second-pass review follow-ups:
- The bearer-auth branch previously dropped the anthropic-version header
  for all bearer endpoints; keep sending it to Z.AI / Moonshot / Kimi
  gateways (Anthropic protocol requires it) while leaving bigmodel.cn's
  shipped behavior untouched
- Tighten the Kimi match to api.kimi.com/coding
- Teach sync-model-i18n.cjs to generate zh-TW.json (with zh-TW literals
  for installer-only strings) so installer locale parity cannot silently
  break again; re-synced zh-TW from the web-ui source of truth

* test(models): lock provider preset invariants

The presets are duplicated across the web UI, the installer, the URL
catalog and three locale bundles, and every drift between them has
shipped either a request-time failure or an untranslated label. Assert
the invariants instead of re-checking them by hand: catalog coverage
both ways, note keys resolving to distinct labels in every locale, base
URL shape matching what each adapter appends, and no URL owned by two
providers.

Verified by mutation: dropping a catalog URL, deleting a locale key and
appending /v1 to an Anthropic base URL each fail a distinct assertion.

* fix(models): correct verified endpoint facts and format-switch handling

Third review pass (endpoint fact-check + Rust request tracing + frontend
flow), all endpoints live-probed:

- Note the Kimi For Coding model IDs on that base URL option; the plan
  serves k3 / kimi-for-coding, which are disjoint from the Moonshot API
  model list the provider block otherwise offers
- Point the Moonshot and Anthropic help links at the hosts they now
  redirect to (platform.kimi.ai, platform.claude.com)
- Normalize per-model reasoning drafts when the base URL dropdown
  changes the wire format, matching what the request-format dropdown
  already did; otherwise an adaptive mode or thinking budget could
  persist against a format that cannot express it
- Installer: only a preset URL implies its format. A hand-typed proxy
  URL no longer snaps the format back to the template default, which
  would write an OpenAI config against an Anthropic-only endpoint
- Installer: fall back to a note key's last segment instead of printing
  the whole dotted path when a translation is missing

Cover the auth split with tests: Z.AI / Moonshot / Kimi document bearer
tokens, while DeepSeek and MiniMax document x-api-key, so the two groups
must not be unified. Also pin the Claude 5 thinking capabilities and
assert vendor model names never take the Claude-specific paths.

* style(models): rustfmt the new anthropic request tests

---------

Co-authored-by: bowen628 <bowen628@noreply.gitcode.com>
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.

1 participant