Problem
Alibaba Cloud Bailian/DashScope endpoints (used for Qwen, GLM, Kimi, MiniMax models) don't implement the standard OpenAI `/v1/models` endpoint. This causes Hermes model validation to fail when switching models in the interactive terminal:
```
✗ Could not reach the custom:bailian-qwen3.6-plus API to validate `qwen3.6-plus`.
If the service isn't down, this model may not be valid.
```
The API itself works perfectly - direct calls to `/v1/chat/completions` succeed:
```bash
curl -X POST "https://coding.dashscope.aliyuncs.com/v1/chat/completions"
-H "Authorization: Bearer sk-sp-xxx"
-H "Content-Type: application/json"
-d '{"model": "qwen3.6-plus", "messages": [{"role": "user", "content": "hi"}]}'
→ Works correctly
```
Affected Endpoints
Current Workaround
I patched `hermes_cli/models.py` to skip validation for Bailian URLs:
```python
bailian_urls = [
"coding.dashscope.aliyuncs.com",
"dashscope.aliyuncs.com",
"dashscope-intl.aliyuncs.com",
]
is_bailian = any(url in (base_url or "") for url in bailian_urls)
if is_bailian:
return {"accepted": True, "persist": True, "recognized": False}
```
Proposed Solution
Add a config option or auto-detection for endpoints that don't support `/models`:
Option A: Add `skip_model_validation: true` to custom_providers config:
```yaml
custom_providers:
Option B: Auto-detect Bailian endpoints and skip validation (like my patch).
Option C: Add Bailian as a built-in provider (like `alibaba` provider but with Coding Plan support).
Environment
- Hermes v0.10.0
- Linux (WSL2)
- Bailian Coding Plan API Key (`sk-sp-*`)
Related
Problem
Alibaba Cloud Bailian/DashScope endpoints (used for Qwen, GLM, Kimi, MiniMax models) don't implement the standard OpenAI `/v1/models` endpoint. This causes Hermes model validation to fail when switching models in the interactive terminal:
```
✗ Could not reach the custom:bailian-qwen3.6-plus API to validate `qwen3.6-plus`.
If the service isn't down, this model may not be valid.
```
The API itself works perfectly - direct calls to `/v1/chat/completions` succeed:
```bash
curl -X POST "https://coding.dashscope.aliyuncs.com/v1/chat/completions"
-H "Authorization: Bearer sk-sp-xxx"
-H "Content-Type: application/json"
-d '{"model": "qwen3.6-plus", "messages": [{"role": "user", "content": "hi"}]}'
→ Works correctly
```
Affected Endpoints
Current Workaround
I patched `hermes_cli/models.py` to skip validation for Bailian URLs:
```python
bailian_urls = [
"coding.dashscope.aliyuncs.com",
"dashscope.aliyuncs.com",
"dashscope-intl.aliyuncs.com",
]
is_bailian = any(url in (base_url or "") for url in bailian_urls)
if is_bailian:
return {"accepted": True, "persist": True, "recognized": False}
```
Proposed Solution
Add a config option or auto-detection for endpoints that don't support `/models`:
Option A: Add `skip_model_validation: true` to custom_providers config:
```yaml
custom_providers:
base_url: https://coding.dashscope.aliyuncs.com/v1
api_key: sk-sp-xxx
api_mode: chat_completions
skip_model_validation: true # ← new option
```
Option B: Auto-detect Bailian endpoints and skip validation (like my patch).
Option C: Add Bailian as a built-in provider (like `alibaba` provider but with Coding Plan support).
Environment
Related