OpenViking icon indicating copy to clipboard operation
OpenViking copied to clipboard

[Bug] v0.4.20: `provider: vikingdb` rerank always fails — the VikingDB rerank endpoint has been retired in favour of Knowledge Base

Open za8209 opened this issue 2 months ago • 1 comments

Issue Origin

Reproduced in a real environment (macOS 26.6.2 arm64, OpenViking 0.4.20 = latest on PyPI, used as a Hermes memory backend).

Bug Description

With a valid provider: vikingdb rerank config and freshly issued AK/SK, every rerank call fails:

HTTP 400
{"code":"InvalidParameter","message":"The request parameter is invalid. Reason: Rerank is temporarily unavailable in VikingDB. Please use Knowledge Base if you need rerank capabilities.","request_id":"..."}

HierarchicalRetriever then falls back to vector scores, so rerank is silently a no-op on every search (one ERROR line per attempt).

Environment / config

"rerank": {
  "provider": "vikingdb",
  "ak": "<redacted>",
  "sk": "<redacted>",
  "model_name": "doubao-seed-rerank",
  "model_version": "251028"
}

Evidence — this is not a credential problem

Control tests against https://api-vikingdb.vikingdb.cn-beijing.volces.com/api/vikingdb/rerank (AK/SK signed with service=vikingdb, as OpenViking does today):

request response
no signature header 403 Check identity failed, please check your AK.
signed with a made-up AK/SK 403 Check identity failed, please check your AK.
signed with the real AK/SK 400 ... Rerank is temporarily unavailable in VikingDB. Please use Knowledge Base if you need rerank capabilities.

The gateway distinguishes "AK unknown" / "signature mismatch" / "authenticated but endpoint retired", so the credentials are valid (the signature was accepted) and the VikingDB rerank endpoint itself has been retired.

The official docs have moved to Knowledge Base

  • /api/knowledge/service/rerank — https://www.volcengine.com/docs/84313/1254474 (page last updated 2026-08-24)
  • The VikingDB rerank SDK page now uses the endpoint https://api-knowledgebase.mlp.cn-beijing.volces.com — https://www.volcengine.com/docs/84313/2277199 (and explicitly states the interface does not support APIKey auth; AK/SK (IAM) is required)

It works today with the same AK/SK, signed with service="air":

POST https://api-knowledgebase.mlp.cn-beijing.volces.com/api/knowledge/service/rerank
{"datas":[{"query":"什么是记忆系统","content":"..."}],
 "rerank_model":"doubao-seed-rerank",
 "rerank_instruction":"Whether the Document answers the Query or matches the content retrieval intent"}

→ HTTP 200 in ~226 ms
{"code":0,"data":{"scores":[0.5799078608366358,0.06459059364482121,0.1271737977861856],"token_usage":261},"message":"success"}

What needs to change in OpenViking

openviking/models/rerank/volcengine_rerank.py:

  1. Endpoint — :116 hardcodes path="/api/vikingdb/rerank" (only host is configurable). The Knowledge Base path is /api/knowledge/service/rerank on host api-knowledgebase.mlp.cn-beijing.volces.com.
  2. Signing service — :84 hardcodes Credentials(ak, sk, "vikingdb", "cn-beijing"). The Knowledge Base gateway requires service="air"; vikingdb / ml_platform / knowledgebase all return 403 {"code":1000001,"message":"check sign not match..."}. (Service: "air" is also what the official vikingdb-go-sdk/knowledge client uses.)
  3. Payload / response mapping — the current body is model_name / model_version / data: [[{"text": …}]] / query: [{"text": …}] / instruction, and the parser reads a result object. Knowledge Base expects lowercase datas (elements query (required, string or {text, image}), content, image, title; max 200), optional rerank_model (default base-multilingual-rerank, doubao-seed-rerank recommended) and rerank_instruction (≤1024, seed model only), and returns {"code","message","request_id","data":{"scores":[…],"token_usage":N}}.

Other affected surfaces

  • docs/zh/guides/01-configuration.md (and the English + website versions) still documents the vikingdb + ak/sk example with no migration note. Upstream code on main still ships only the four providers (cohere, litellm, openai, volcengine), with no Knowledge Base provider.
  • Related: since #4443 a missing credential fails loudly at load — but a valid credential pointed at a retired endpoint still degrades silently at runtime, which is much easier to miss in production.

Workaround

provider: openai can be pointed at a small local adapter (its api_base is a full endpoint URL), which signs the Knowledge Base request with service="air" and reshapes the response to {"results":[{"index":n,"relevance_score":s}]}. Alternatively use a local reranker.

Expected

Either migrate provider: vikingdb to the Knowledge Base API (preferred), or fail loudly with an explicit "endpoint retired" message instead of falling back silently.


中文摘要:provider: vikingdb 在 0.4.20 上 100% 失败——火山已把 rerank 从 VikingDB 迁移到知识库(/api/knowledge/service/rerank,签名 service="air",小写字段 datas/query/content,响应 data.scores),旧端点返回 400「Rerank is temporarily unavailable in VikingDB. Please use Knowledge Base」。AK/SK 经对照实验确认有效(同一对凭证在知识库端点上 200 返回真实分数)。需要改动三处:端点路径、签名 service 名、请求/响应字段映射。

za8209 avatar Sep 15 '26 12:09 za8209

后面规划先下掉,rerank 资源不多了

qin-ctx avatar Sep 15 '26 12:09 qin-ctx