Skip to content

Support Bailian/DashScope endpoints that don't expose /v1/models #12220

@duyiliu

Description

@duyiliu

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existscomp/cliCLI entry point, hermes_cli/, setup wizardprovider/qwenQwen / Alibaba Cloud (OAuth)type/featureNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions