infiniflow / infiniflow/ragflow

[Feature Request]: Implement ListModels in the VolcEngine Go driver

Open
#14,701 2 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
91k
Forks
10.8k
Avg merge
1d 14h
Merged PRs (30d)
705

Description

### Self Checks

- [x] I have searched for existing issues [search for existing issues](https://github.com/infiniflow/ragflow/issues), including closed ones.
- [x] I confirm that I am using English to submit this report ([Language Policy](https://github.com/infiniflow/ragflow/issues/5910)).
- [x] Non-english title submitions will be closed directly ( 非英文标题的提交将会被直接关闭 ) ([Language Policy](https://github.com/infiniflow/ragflow/issues/5910)).
- [x] Please do not modify this template :) and fill in all the required fields.

### Is your feature request related to a problem?

```Markdown
Note: this issue was originally filed for Aliyun Balance. After verifying that the
DashScope endpoint specified in that earlier framing returns 404 (it does not exist
on DashScope, and account balance is exposed only via the separate BSS OpenAPI which
uses AccessKey + HMAC-SHA256 signing rather than the model API key), I am repurposing
this issue for a different concrete gap in the same Go-driver track.

The VolcEngine Go driver in internal/entity/models/volcengine.go ships a stub
ListModels method that always returns "volcengine, no such method". Other Go drivers
that have already landed in the recent Go-rewrite effort (DeepSeek, Gitee, NVIDIA,
OpenAI, SiliconFlow) all implement ListModels against the OpenAI-compatible /models
endpoint, and the model picker UI relies on it.

VolcEngine (Doubao / Ark) does expose a documented OpenAI-compatible models endpoint
that accepts the same Bearer token used for chat and embedding requests:

GET https://ark.cn-beijing.volces.com/api/v3/models

Without ListModels, a tenant who configures VolcEngine has no in-product way to see
which endpoints are available on their Ark account, even though the chat and
embedding paths in the same driver are already working.

conf/models/volcengine.json also does not yet declare a "models" entry under
url_suffix, so even if the method body were filled in there is no URL to call.
```

### Describe the feature you'd like

Implement `VolcEngine.ListModels` in `internal/entity/models/volcengine.go` and add the
matching `models` URL suffix to `conf/models/volcengine.json` so the existing model
picker works for VolcEngine the same way it already works for the other drivers in this
package.

The driver should:

1. Resolve the region with a default-region fallback, the same way the surrounding
VolcEngine methods already do.
2. GET `${BaseURL[region]}/${URLSuffix.Models}`, which resolves to
`https://ark.cn-beijing.volces.com/api/v3/models` with the default region.
3. Send `Authorization: Bearer ` when an API key is configured. Mirror the
existing NVIDIA `ListModels` behavior of omitting the header when the key is empty,
so an unauthenticated caller still gets a clear `401 Unauthorized` from upstream.
4. Surface non-200 responses with the upstream status line and body, the same shape
the other Go drivers use.
5. Parse the JSON response via the package-level `DSModelList` / `DSModel` types
already used by DeepSeek, Gitee, and SiliconFlow, and return the list of model ids
in input order. When the response includes `owned_by`, render the entry as
`id@owned_by`, matching the convention of the other drivers.

`conf/models/volcengine.json` needs the `"models"` URL suffix added alongside the
existing `chat`, `files`, and `embedding` entries:

```json
"url_suffix": {
"chat": "chat/completions",
"files": "files",
"embedding": "embeddings/multimodal",
"models": "models"
}
```

No new public API. No interface change. No factory change.

### Describe implementation you've considered

_No response_

### Documentation, adoption, use case

```Markdown
No new docs are needed. VolcEngine is already in the model provider picker, with chat
and embedding already working. This issue just makes the existing model-list UI return
real data for VolcEngine instead of an error, the same way it already returns real
data for DeepSeek, Gitee, NVIDIA, OpenAI, and SiliconFlow.

Use case: a tenant adds VolcEngine (Doubao / Ark) as a model provider in RAGFlow,
opens the model selector, and immediately sees the endpoints available on their Ark
account, without having to leave the RAGFlow UI to log into the Volcano Engine
console.
```

### Additional information

_No response_

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with internal/entity/models/volcengine.go and compare its surrounding methods with the existing ListModels implementations in the DeepSeek, Gitee, NVIDIA, and SiliconFlow drivers. Then update conf/models/volcengine.json and verify the model picker receives model IDs in the expected format from the VolcEngine /models endpoint, including owned_by when present.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api, backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
84/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.