fix: remove unnecessary lock mechanism and upgrade Claude 3 to Claude 4

- Remove sync.RWMutex and rrCounters from Config struct
- Simplify GetModelConfig to use global atomic counter for load balancing
- Remove unnecessary locks from HasProvidersConfig, SaveConfig, etc.
- Add buildModelWithProtocol helper to handle models with existing prefix
- Fix TestCreateProviderReturnsHTTPProviderForOpenRouter to use model_list
- Upgrade all Claude 3 references to Claude 4 across documentation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
yinwm
2026-02-20 11:34:52 +08:00
parent b7c906fe18
commit 5cd1597674
14 changed files with 134 additions and 100 deletions
+4 -4
View File
@@ -66,7 +66,7 @@ Problem: Agent needs to know both `provider` and `model`, adding complexity.
Inspired by [LiteLLM](https://docs.litellm.ai/docs/proxy/configs) design:
1. **Model-centric**: Users care about models, not providers
2. **Protocol prefix**: Use `protocol/model_name` format, e.g., `openai/gpt-5.2`, `anthropic/claude-3-sonnet`
2. **Protocol prefix**: Use `protocol/model_name` format, e.g., `openai/gpt-5.2`, `anthropic/claude-sonnet-4`
3. **Configuration-driven**: Adding new Providers only requires config changes, no code changes
### 2.2 New Configuration Structure
@@ -86,8 +86,8 @@ Inspired by [LiteLLM](https://docs.litellm.ai/docs/proxy/configs) design:
"api_key": "sk-xxx"
},
{
"model_name": "claude-3-sonnet",
"model": "anthropic/claude-3-5-sonnet-20241022",
"model_name": "claude-sonnet-4",
"model": "anthropic/claude-sonnet-4-20250514",
"api_key": "sk-xxx"
},
{
@@ -184,7 +184,7 @@ Identify protocol via prefix in `model` field:
"system_prompt": "You are a coding assistant..."
},
"translator": {
"model": "claude-3-sonnet"
"model": "claude-sonnet-4"
}
}
}