feat: fetch provider models from the UI and one-click add to the composer picker - #446
Open
Lambda-zhou wants to merge 2 commits into
Open
feat: fetch provider models from the UI and one-click add to the composer picker#446Lambda-zhou wants to merge 2 commits into
Lambda-zhou wants to merge 2 commits into
Conversation
- New _models_candidates.py: ported from cc-switch model_fetch.rs, generates candidate
URLs with compat suffix / version segment / full-URL handling
- registry.py: fetch_provider_models() listing models per provider (Bedrock via boto3,
Vertex via Google AI API, Anthropic/Gemini/Ollama/OpenAI via HTTP candidate iteration)
- manager.py: fetch_models() merging stored/form/env field values
- app.py: POST /v1/providers/{name}/models endpoint (read-only, does not persist)
- api.ts: fetchProviderModels() + ProviderModelInfo type
- ProviderSetup.tsx: "Fetch models" button + model list UI (loading/error/empty states)
- ProviderSetup.test.tsx: makePs() gains the new state fields
Lambda-zhou
added a commit
to Lambda-zhou/openworker
that referenced
this pull request
Aug 7, 2026
…wyng#440) - Merge PR#446: add fetch models functionality (provider model discovery) - Merge PR#440: complete Chinese localization across all GUI surfaces - ProviderSetup.tsx: 3-way merge (base=01b6f83, ours=andrewyng#446, theirs=i18n-zh) - 53 i18n files applied to surfaces/gui/src/ - Windows build: release.yml supports .exe/.msi via Tauri + PyInstaller - Trigger Windows build: Actions > Release > Run workflow (workflow_dispatch)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
reason why I did this:
openworker的总体是很棒的,多日的使用下来感觉比较便利就是没有中文版本难推广给我的朋友们使用,本来要做一个中文版本的pull request的发现有人做了,就尝试在设定这块下功夫。
起因:很多时候人们(比如我)并不会去买官方的订阅而是去找一些免费的,不知名的平台获取订阅,因为这样带来的成本较低,这就会带来没办法用官方的url的问题,而openworker也解决了这个问题能够提供自己的订阅url,在导入的时候我在想为什么我们不进一步直接通过接口获取models,这样能够减免很多不必要的选择模型然后输入模型的时间。此外也在一定程度上降低了人们使用的门槛,部分人可能只是知道这个平台的模型不错,但是并不知道具体的模型型号或者编号是多少,所以我就做了这个,希望openworker能够适合更多的人。Anyway,我希望openworker能够变得越来越好,我也在等待openworker的zh-cn版本,这样我就可以推广给身边的人,让他们也享受到ai带来的便利。
Summary
This PR adds two features that make it much faster to wire up a provider with a custom model list:
Fetch models from the UI — a
Fetch modelsbutton on the provider setup panel that queries the provider's real model list instead of relying on the bundled matrix. The model-candidate URL generation is ported from cc-switch'smodel_fetch.rs, so it handles the same edge cases: known compatibility suffixes, version segments, and custom endpoints.One-click add to the composer picker — each fetched model row gains a
+ Addbutton that adds the model straight into the composer's picker (no manual typing). It mirrors the existingModelChecklistprefix rule: OpenAI ids stay bare, everyone else getsprovider:prefixed.What's included
coworker/providers/_models_candidates.py: candidate-URL builder (ported from cc-switch).coworker/providers/registry.py:fetch_provider_models()per-provider model listing (Bedrock via boto3, Vertex via Google AI API, Anthropic/Gemini/Ollama/OpenAI via HTTP candidate iteration).coworker/server/manager.py+coworker/server/app.py:POST /v1/providers/{name}/modelsendpoint (read-only, does not persist).surfaces/gui/src/api.ts:fetchProviderModels()+ProviderModelInfotype.surfaces/gui/src/providers/ProviderSetup.tsx+ProviderSetup.test.tsx: the Fetch button, model-list UI (loading / error / empty states), and the+ Addper-row action with tests.Notes