Who it is forA user whose API provider adds, removes or renames models and who needs Codex or Claude Code to use only the models that still exist.
The problemStale model lists send requests to models the provider no longer offers, and default models can point to models that were removed.
The outcomeThe enabled model list matches the provider's current models, the default model is valid, and each model has its context length set.
What you need first
- A desktop computer running Windows, Linux or macOS
- An API address and API Key from your provider
- Codex or Claude Code installed on the same machine
- For building from source: Node.js 20 or newer, Rust 1.89 or newer, and the platform build tools listed in the README
Steps
- Open the provider and click 管理模型.
- Click the sync action to load the current upstream models.
- Choose which models stay enabled and select the default model.
- Set the context length for each model. The default is 256k.
- Confirm to save. Cancelling the dialog discards the draft and writes nothing.
Prompt for your agent
Using the uni-switch project at github.com/dieqiyun/uni-switch, sync the model list for the provider <provider-name> and report which models were removed and which default model was chosen. Expected output: a list of enabled models and the new default. Verify that the default model is still present in the synced list.
Caveat. Model names and thinking labels from the upstream provider do not guarantee what a model can actually do, so test important tasks after changing the list.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for dieqiyun/uni-switch and "Sync a provider's models and set context limits"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer