chore: 初始化仓库,导入项目基线代码
Academy v0.8.3 完整代码基线:Go 后端(internal/cmd/cli/mcp-server/docreader)、 Vue 前端(frontend)、数据库迁移(migrations)、部署编排(docker/helm/deploy)与文档。 今日开发的培训推送管理改动随后单独提交。
This commit is contained in:
commit
7ec21f35b0
5767 files changed
+1436788
No files matched your search
@@ -0,0 +1,113 @@
|
||||
package parity
|
||||
|
||||
import (
|
||||
"crypto/sha256"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"academy/internal/models/api"
|
||||
"academy/internal/models/chat"
|
||||
"academy/internal/models/providers"
|
||||
modelruntime "academy/internal/models/runtime"
|
||||
"academy/internal/types"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
// This fixture was captured before the provider/runtime refactor. It pins every
|
||||
// catalog entry, alias and family rule, including full resolved protocol options,
|
||||
// endpoints and request bodies at every reasoning level. Updating it is an
|
||||
// explicit compatibility decision, never part of normal model generation.
|
||||
func TestCatalogMigrationBaseline(t *testing.T) {
|
||||
actual := map[string]string{}
|
||||
for _, vendor := range modelruntime.List() {
|
||||
for _, entry := range vendor.Models() {
|
||||
names := append([]string{entry.ID}, entry.Aliases...)
|
||||
if entry.Match != "" {
|
||||
names = append(names, strings.ReplaceAll(entry.Match, "*", "snapshot"))
|
||||
}
|
||||
for _, name := range names {
|
||||
if name == "" {
|
||||
continue
|
||||
}
|
||||
key := fmt.Sprintf("%s/%s/%s", vendor.ID, entry.Type, name)
|
||||
r, err := modelruntime.Resolve(
|
||||
modelruntime.Ref{
|
||||
Provider: vendor.ID,
|
||||
Model: name,
|
||||
ModelType: entry.Type,
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
actual[key] = "error: " + err.Error()
|
||||
continue
|
||||
}
|
||||
state := map[string]any{"resolved": r, "auth": vendor.AuthStyleFor(r.API)}
|
||||
if vendor.Endpoint != nil {
|
||||
u, q := vendor.Endpoint(
|
||||
providers.EndpointRequest{
|
||||
BaseURL: r.BaseURL,
|
||||
Model: name,
|
||||
ModelType: entry.Type,
|
||||
API: r.API,
|
||||
EmbeddingAPI: r.EmbeddingAPI,
|
||||
},
|
||||
)
|
||||
state["endpoint"], state["query"] = u, q
|
||||
}
|
||||
r.Vendor = nil // functions are not serializable; their output is captured above
|
||||
if entry.Type == "" || entry.Type == types.ModelTypeKnowledgeQA {
|
||||
bodies := map[string]any{}
|
||||
for _, level := range api.ReasoningLadder {
|
||||
for _, stream := range []bool{false, true} {
|
||||
bodies[fmt.Sprintf("%s/%t", level, stream)] = buildBody(t,
|
||||
&chat.ChatConfig{
|
||||
Provider: vendor.ID,
|
||||
ModelName: name,
|
||||
AppID: "app",
|
||||
AppSecret: "secret",
|
||||
BaseURL: reachableBaseURL(
|
||||
vendor.GetDefaultURL(
|
||||
types.ModelTypeKnowledgeQA,
|
||||
),
|
||||
),
|
||||
},
|
||||
&api.Options{
|
||||
MaxTokens: 256,
|
||||
Temperature: 0.5,
|
||||
ReasoningEffort: level,
|
||||
Thinking: ptrBool(
|
||||
level != api.ReasoningOff,
|
||||
),
|
||||
}, stream)
|
||||
}
|
||||
}
|
||||
state["bodies"] = bodies
|
||||
}
|
||||
data, err := json.Marshal(state)
|
||||
require.NoError(t, err, key)
|
||||
actual[key] = fmt.Sprintf("%x", sha256.Sum256(data))
|
||||
}
|
||||
}
|
||||
}
|
||||
const path = "testdata/catalog-baseline.json"
|
||||
if os.Getenv("ACADEMY_UPDATE_MODEL_BASELINE") == "1" {
|
||||
data, err := json.MarshalIndent(actual, "", " ")
|
||||
require.NoError(t, err)
|
||||
require.NoError(t, os.MkdirAll("testdata", 0o755))
|
||||
require.NoError(t, os.WriteFile(path, append(data, '\n'), 0o644))
|
||||
}
|
||||
data, err := os.ReadFile(path)
|
||||
require.NoError(t, err)
|
||||
var expected map[string]string
|
||||
require.NoError(t, json.Unmarshal(data, &expected))
|
||||
require.Equal(
|
||||
t,
|
||||
expected,
|
||||
actual,
|
||||
"catalog or wire contract changed; inspect each difference before updating the baseline",
|
||||
)
|
||||
t.Logf("verified %d catalog entries, aliases and family matches", len(actual))
|
||||
}
|
||||
@@ -0,0 +1,782 @@
|
||||
// Package parity holds the cross-cutting safety net for the vendor catalog:
|
||||
//
|
||||
// - TestLegacyWireParity pins the outbound request shape against the
|
||||
// behaviour of the pre-catalog implementation (the providerAdapter /
|
||||
// ThinkingStrategy / wireCompletionTokenField tables that lived in
|
||||
// internal/models/chat before the refactor). Every deliberate divergence
|
||||
// is listed explicitly with the reason, so an accidental one fails here.
|
||||
// - TestLegacyProviderDetection pins DetectProvider's URL table.
|
||||
// - TestCatalogInvariants and TestEveryChatModelRequestShape are
|
||||
// data-driven: they walk every registered vendor and every catalog model,
|
||||
// so a newly added vendor or model is covered without touching this file.
|
||||
//
|
||||
// The tests drive the real stack: chat.NewRemoteChat resolves the catalog and
|
||||
// returns the protocol client, and the body asserted here is exactly what
|
||||
// would go on the wire.
|
||||
package parity
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"os"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"academy/internal/models"
|
||||
"academy/internal/models/api"
|
||||
"academy/internal/models/chat"
|
||||
"academy/internal/models/providers"
|
||||
modelruntime "academy/internal/models/runtime"
|
||||
"academy/internal/types"
|
||||
secutils "academy/internal/utils"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
// TestMain whitelists the loopback host: several vendors ship a placeholder
|
||||
// default URL (self-hosted runtimes) or a templated one (Azure), which the
|
||||
// SSRF guard rejects before any request is built. Those cases are re-pointed
|
||||
// at 127.0.0.1 by reachableBaseURL.
|
||||
func TestMain(m *testing.M) {
|
||||
secutils.SetSSRFWhitelistFromRaw("127.0.0.1")
|
||||
defer secutils.ResetSSRFWhitelistForTest()
|
||||
os.Exit(m.Run())
|
||||
}
|
||||
|
||||
// reachableBaseURL replaces a placeholder or templated vendor URL with a
|
||||
// loopback one so the SSRF guard lets the request through. The protocol and
|
||||
// compat resolution under test do not depend on the host.
|
||||
func reachableBaseURL(url string) string {
|
||||
if url == "" {
|
||||
return ""
|
||||
}
|
||||
if strings.Contains(url, "your_") || strings.Contains(url, "{") {
|
||||
return "http://127.0.0.1:9/v1"
|
||||
}
|
||||
return url
|
||||
}
|
||||
|
||||
// bodyBuilder is implemented by every protocol client; it returns the exact
|
||||
// JSON object the client would send.
|
||||
type bodyBuilder interface {
|
||||
BuildRequestBody(messages []api.Message, opts *api.Options, stream bool) (map[string]any, error)
|
||||
}
|
||||
|
||||
func ptrBool(b bool) *bool { return &b }
|
||||
|
||||
var userTurn = []api.Message{{Role: "user", Content: "hi"}}
|
||||
|
||||
// buildBody runs the production path: ChatConfig -> modelruntime.Resolve ->
|
||||
// protocol client -> request body, then round-trips through JSON so the
|
||||
// assertions see the real wire types.
|
||||
func buildBody(t *testing.T, cfg *chat.ChatConfig, opts *api.Options, stream bool) map[string]any {
|
||||
t.Helper()
|
||||
if cfg.Source == "" {
|
||||
cfg.Source = types.ModelSourceRemote
|
||||
}
|
||||
if cfg.APIKey == "" {
|
||||
cfg.APIKey = "k"
|
||||
}
|
||||
cfg.BaseURL = reachableBaseURL(cfg.BaseURL)
|
||||
client, err := chat.NewRemoteChat(cfg)
|
||||
require.NoError(t, err, "NewRemoteChat(%s/%s)", cfg.Provider, cfg.ModelName)
|
||||
builder, ok := client.(bodyBuilder)
|
||||
require.True(t, ok, "%s/%s: protocol client does not expose BuildRequestBody", cfg.Provider, cfg.ModelName)
|
||||
body, err := builder.BuildRequestBody(userTurn, opts, stream)
|
||||
require.NoError(t, err)
|
||||
raw, err := json.Marshal(body)
|
||||
require.NoError(t, err)
|
||||
var out map[string]any
|
||||
require.NoError(t, json.Unmarshal(raw, &out))
|
||||
return out
|
||||
}
|
||||
|
||||
func resolve(t *testing.T, provider, model string) *modelruntime.Resolved {
|
||||
t.Helper()
|
||||
r, err := modelruntime.Resolve(modelruntime.Ref{Provider: provider, Model: model})
|
||||
require.NoError(t, err)
|
||||
return r
|
||||
}
|
||||
|
||||
// TestLegacyWireParity compares today's wire body with the pre-refactor
|
||||
// behaviour, case by case.
|
||||
//
|
||||
// `want` lists fields that must match the old implementation; a nil value
|
||||
// means the field must be absent, exactly as before. `divergence` documents
|
||||
// a deliberate behaviour change — those entries assert the NEW behaviour and
|
||||
// carry the reason, so the change stays visible in review.
|
||||
func TestLegacyWireParity(t *testing.T) {
|
||||
cases := []struct {
|
||||
name string
|
||||
provider string
|
||||
model string
|
||||
baseURL string
|
||||
extra map[string]string
|
||||
opts *api.Options
|
||||
stream bool
|
||||
want map[string]any
|
||||
divergence string
|
||||
}{
|
||||
// ---- completion budget field (old wireCompletionTokenField table) ----
|
||||
{
|
||||
name: "deepseek keeps max_tokens", provider: "deepseek", model: "deepseek-v4-pro",
|
||||
opts: &api.Options{MaxTokens: 100},
|
||||
want: map[string]any{"max_tokens": float64(100), "max_completion_tokens": nil},
|
||||
},
|
||||
{
|
||||
name: "zhipu keeps max_tokens", provider: "zhipu", model: "glm-4.7",
|
||||
opts: &api.Options{MaxTokens: 100},
|
||||
want: map[string]any{"max_tokens": float64(100), "max_completion_tokens": nil},
|
||||
},
|
||||
{
|
||||
name: "siliconflow keeps max_tokens", provider: "siliconflow", model: "deepseek-ai/DeepSeek-V4-Pro",
|
||||
opts: &api.Options{MaxTokens: 100},
|
||||
want: map[string]any{"max_tokens": float64(100), "max_completion_tokens": nil},
|
||||
},
|
||||
{
|
||||
name: "moonshot moved to max_completion_tokens", provider: "moonshot", model: "kimi-k2.6",
|
||||
opts: &api.Options{MaxTokens: 100},
|
||||
want: map[string]any{"max_completion_tokens": float64(100), "max_tokens": nil},
|
||||
divergence: "the old table sent max_tokens. platform.kimi.com now documents " +
|
||||
"max_completion_tokens as the field and max_tokens as deprecated, so the vendor " +
|
||||
"audit switched it; both are still accepted upstream.",
|
||||
},
|
||||
// The six vendors below moved the other way: the old table left them
|
||||
// on the default max_completion_tokens and the audit put them on
|
||||
// max_tokens. Each entry carries the documentation that decided it, so
|
||||
// a later flip back is a visible change rather than a silent one.
|
||||
{
|
||||
name: "hunyuan moved to max_tokens", provider: "hunyuan", model: "hunyuan-turbos-latest",
|
||||
opts: &api.Options{MaxTokens: 100},
|
||||
want: map[string]any{"max_tokens": float64(100), "max_completion_tokens": nil},
|
||||
divergence: "the OpenAI-compatible reference documents only max_tokens (default 4096); " +
|
||||
"max_completion_tokens appears nowhere in it.",
|
||||
},
|
||||
{
|
||||
name: "modelscope moved to max_tokens", provider: "modelscope", model: "ZhipuAI/GLM-4.6",
|
||||
opts: &api.Options{MaxTokens: 100},
|
||||
want: map[string]any{"max_tokens": float64(100), "max_completion_tokens": nil},
|
||||
divergence: "ModelScope API-Inference documents no output-cap parameter at all. " +
|
||||
"max_tokens is carried over from the DashScope/Bailian channel behind it and is " +
|
||||
"marked unverified in the vendor package, so this case pins a guess, not a fact.",
|
||||
},
|
||||
{
|
||||
name: "qiniu moved to max_tokens", provider: "qiniu", model: "qwen3.5-397b-a17b",
|
||||
opts: &api.Options{MaxTokens: 100},
|
||||
want: map[string]any{"max_tokens": float64(100), "max_completion_tokens": nil},
|
||||
divergence: "max_completion_tokens is not in the Qiniu reference.",
|
||||
},
|
||||
{
|
||||
name: "longcat moved to max_tokens", provider: "longcat", model: "LongCat-2.0",
|
||||
opts: &api.Options{MaxTokens: 100},
|
||||
want: map[string]any{"max_tokens": float64(100), "max_completion_tokens": nil},
|
||||
divergence: "max_completion_tokens is not part of the LongCat reference; max_tokens " +
|
||||
"defaults to and tops out at the model's 131072 output budget.",
|
||||
},
|
||||
{
|
||||
name: "requesty moved to max_tokens", provider: "requesty", model: "anthropic/claude-opus-5",
|
||||
opts: &api.Options{MaxTokens: 100},
|
||||
want: map[string]any{"max_tokens": float64(100), "max_completion_tokens": nil},
|
||||
divergence: "max_completion_tokens appears nowhere in Requesty's documentation.",
|
||||
},
|
||||
{
|
||||
name: "novita moved to max_tokens", provider: "novita", model: "moonshotai/kimi-k3",
|
||||
opts: &api.Options{MaxTokens: 100},
|
||||
want: map[string]any{"max_tokens": float64(100), "max_completion_tokens": nil},
|
||||
divergence: "Novita documents max_tokens as required and never mentions " +
|
||||
"max_completion_tokens.",
|
||||
},
|
||||
// NVIDIA is the one vendor whose output-cap field is per model, so the
|
||||
// vendor-level case above ("nvidia keeps max_tokens", an uncatalogued
|
||||
// deployment) does not cover these two.
|
||||
{
|
||||
name: "nvidia kimi-k3 overrides the vendor default", provider: "nvidia", model: "moonshotai/kimi-k3",
|
||||
opts: &api.Options{MaxTokens: 100},
|
||||
want: map[string]any{"max_completion_tokens": float64(100), "max_tokens": nil},
|
||||
divergence: "NVIDIA's own curl and Python samples use max_tokens, which is why that is " +
|
||||
"the vendor default, but the build.nvidia.com cards for kimi-k3 and " +
|
||||
"gemma-4-31b-it show max_completion_tokens; those two entries override it.",
|
||||
},
|
||||
{
|
||||
name: "nvidia gemma-4 overrides the vendor default",
|
||||
provider: "nvidia", model: "google/gemma-4-31b-it",
|
||||
opts: &api.Options{MaxTokens: 100},
|
||||
want: map[string]any{"max_completion_tokens": float64(100), "max_tokens": nil},
|
||||
divergence: "see the kimi-k3 case above; the model card shows max_completion_tokens.",
|
||||
},
|
||||
{
|
||||
name: "nvidia keeps max_tokens", provider: "nvidia", model: "some-nim-model",
|
||||
opts: &api.Options{MaxTokens: 100},
|
||||
want: map[string]any{"max_tokens": float64(100), "max_completion_tokens": nil},
|
||||
},
|
||||
{
|
||||
name: "generic keeps max_tokens", provider: "generic", model: "Qwen/Qwen3-32B",
|
||||
opts: &api.Options{MaxTokens: 100},
|
||||
want: map[string]any{"max_tokens": float64(100), "max_completion_tokens": nil},
|
||||
},
|
||||
{
|
||||
name: "gpustack keeps max_tokens", provider: "gpustack", model: "qwen3",
|
||||
baseURL: "http://127.0.0.1:9/v1-openai",
|
||||
opts: &api.Options{MaxTokens: 100},
|
||||
want: map[string]any{"max_tokens": float64(100), "max_completion_tokens": nil},
|
||||
},
|
||||
{
|
||||
name: "lkeap keeps max_tokens", provider: "lkeap", model: "deepseek-r1-0528",
|
||||
opts: &api.Options{MaxTokens: 100},
|
||||
want: map[string]any{"max_tokens": float64(100), "max_completion_tokens": nil},
|
||||
},
|
||||
{
|
||||
name: "volcengine keeps max_completion_tokens", provider: "volcengine", model: "doubao-seed-1-6-251015",
|
||||
opts: &api.Options{MaxTokens: 100},
|
||||
want: map[string]any{"max_completion_tokens": float64(100), "max_tokens": nil},
|
||||
},
|
||||
{
|
||||
// Not a divergence: the pre-catalog table left DashScope on the
|
||||
// default too. The audit briefly moved it to max_tokens because
|
||||
// the compatible mode has always accepted that field; it was
|
||||
// moved back because DashScope's parameter table marks
|
||||
// max_tokens 即将废弃 and names max_completion_tokens its
|
||||
// successor, and following a vendor that has announced a
|
||||
// replacement is the cheaper side of the bet.
|
||||
name: "aliyun keeps max_completion_tokens", provider: "aliyun", model: "qwen3-max",
|
||||
opts: &api.Options{MaxTokens: 100},
|
||||
want: map[string]any{"max_completion_tokens": float64(100), "max_tokens": nil},
|
||||
},
|
||||
{
|
||||
name: "litellm keeps max_completion_tokens", provider: "litellm", model: "gpt-4o",
|
||||
baseURL: "http://127.0.0.1:9/v1",
|
||||
opts: &api.Options{MaxTokens: 100},
|
||||
want: map[string]any{"max_completion_tokens": float64(100), "max_tokens": nil},
|
||||
},
|
||||
{
|
||||
name: "openai reasoning model keeps max_completion_tokens and drops sampling",
|
||||
provider: "openai", model: "gpt-5.5",
|
||||
extra: map[string]string{models.ExtraAPI: "openai-completions"},
|
||||
opts: &api.Options{MaxTokens: 100, Temperature: 0.7, TopP: 0.9},
|
||||
want: map[string]any{
|
||||
"max_completion_tokens": float64(100), "max_tokens": nil,
|
||||
"temperature": nil, "top_p": nil,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "azure reasoning deployment drops sampling", provider: "azure_openai", model: "gpt-5-prod",
|
||||
baseURL: "http://127.0.0.1:9",
|
||||
opts: &api.Options{MaxTokens: 100, Temperature: 0.7},
|
||||
want: map[string]any{"max_completion_tokens": float64(100), "temperature": nil},
|
||||
},
|
||||
|
||||
// ---- thinking encodings (old ThinkingStrategy table) ----
|
||||
{
|
||||
name: "aliyun qwen thinking model always pins enable_thinking, off in non-stream",
|
||||
provider: "aliyun", model: "qwen3-max",
|
||||
opts: &api.Options{Thinking: ptrBool(true)},
|
||||
stream: false,
|
||||
want: map[string]any{"enable_thinking": false},
|
||||
},
|
||||
{
|
||||
name: "aliyun qwen thinking model streams with enable_thinking true",
|
||||
provider: "aliyun", model: "qwen3-max",
|
||||
opts: &api.Options{Thinking: ptrBool(true)},
|
||||
stream: true,
|
||||
want: map[string]any{"enable_thinking": true},
|
||||
},
|
||||
{
|
||||
name: "aliyun sends the switch even without a caller preference",
|
||||
provider: "aliyun", model: "qwen3-max",
|
||||
opts: &api.Options{Temperature: 0.2},
|
||||
want: map[string]any{"enable_thinking": false},
|
||||
},
|
||||
{
|
||||
name: "volcengine uses thinking.type", provider: "volcengine", model: "doubao-seed-1-6-251015",
|
||||
opts: &api.Options{Thinking: ptrBool(true)},
|
||||
want: map[string]any{"thinking": map[string]any{"type": "enabled"}},
|
||||
},
|
||||
{
|
||||
name: "lkeap deepseek v3 uses thinking.type", provider: "lkeap", model: "deepseek-v3.2",
|
||||
opts: &api.Options{Thinking: ptrBool(true)},
|
||||
want: map[string]any{"thinking": map[string]any{"type": "enabled"}},
|
||||
},
|
||||
{
|
||||
name: "lkeap deepseek r1 is always-on so no switch is sent",
|
||||
provider: "lkeap", model: "deepseek-r1",
|
||||
opts: &api.Options{Thinking: ptrBool(false)},
|
||||
want: map[string]any{"thinking": nil, "enable_thinking": nil, "reasoning_effort": nil},
|
||||
},
|
||||
{
|
||||
name: "generic uses chat_template_kwargs", provider: "generic", model: "Qwen/Qwen3-32B",
|
||||
opts: &api.Options{Thinking: ptrBool(true)},
|
||||
want: map[string]any{"chat_template_kwargs": map[string]any{"enable_thinking": true}},
|
||||
},
|
||||
{
|
||||
name: "nvidia uses chat_template_kwargs", provider: "nvidia", model: "some-nim-model",
|
||||
opts: &api.Options{Thinking: ptrBool(true)},
|
||||
want: map[string]any{"chat_template_kwargs": map[string]any{"enable_thinking": true}},
|
||||
},
|
||||
{
|
||||
name: "openrouter legacy default keeps the native reasoning format",
|
||||
provider: "openrouter", model: "qwen/qwen3.7-flash",
|
||||
extra: map[string]string{models.ExtraThinkingControl: "none"},
|
||||
opts: &api.Options{Thinking: ptrBool(false)},
|
||||
want: map[string]any{
|
||||
"reasoning": map[string]any{"enabled": false},
|
||||
"chat_template_kwargs": nil,
|
||||
},
|
||||
divergence: "the pre-catalog editor persisted OpenRouter's default `none` on every remote row; " +
|
||||
"that default must not suppress the provider's native reasoning switch.",
|
||||
},
|
||||
{
|
||||
name: "openrouter non-default legacy format remains an explicit override",
|
||||
provider: "openrouter", model: "qwen/qwen3.7-flash",
|
||||
extra: map[string]string{models.ExtraThinkingControl: "chat_template_kwargs"},
|
||||
opts: &api.Options{Thinking: ptrBool(false)},
|
||||
want: map[string]any{
|
||||
"reasoning": nil,
|
||||
"chat_template_kwargs": map[string]any{"enable_thinking": false},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "moonshot v1 pins temperature to 1 and drops other sampling",
|
||||
provider: "moonshot", model: "moonshot-v1-8k",
|
||||
opts: &api.Options{Temperature: 0.2, TopP: 0.9},
|
||||
want: map[string]any{"temperature": 1.0, "top_p": nil},
|
||||
},
|
||||
{
|
||||
// deepseek-chat is catalogued as non-reasoning, so this also pins the
|
||||
// precedence rule: an explicit legacy override outranks that gate.
|
||||
name: "legacy extra_config.thinking_control still overrides the vendor default",
|
||||
provider: "deepseek", model: "deepseek-chat",
|
||||
extra: map[string]string{models.ExtraThinkingControl: "chat_template_kwargs"},
|
||||
opts: &api.Options{Thinking: ptrBool(true)},
|
||||
want: map[string]any{
|
||||
"chat_template_kwargs": map[string]any{"enable_thinking": true}, "thinking": nil,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "legacy extra_config.thinking_control=none silences thinking",
|
||||
provider: "volcengine", model: "doubao-seed-1-6-251015",
|
||||
extra: map[string]string{models.ExtraThinkingControl: "none"},
|
||||
opts: &api.Options{Thinking: ptrBool(true)},
|
||||
want: map[string]any{"thinking": nil, "reasoning_effort": nil},
|
||||
},
|
||||
{
|
||||
name: "remote_model_name still overrides the wire model id",
|
||||
provider: "deepseek", model: "deepseek-chat",
|
||||
extra: map[string]string{models.ExtraRemoteModelName: "deepseek-v4-pro-internal"},
|
||||
opts: &api.Options{},
|
||||
want: map[string]any{"model": "deepseek-v4-pro-internal"},
|
||||
},
|
||||
|
||||
{
|
||||
name: "a catalogued non-reasoning model never receives thinking fields",
|
||||
provider: "deepseek", model: "deepseek-chat",
|
||||
opts: &api.Options{Thinking: ptrBool(true)},
|
||||
want: map[string]any{"thinking": nil, "reasoning_effort": nil, "enable_thinking": nil},
|
||||
divergence: "DeepSeek's non-thinking alias is marked reasoning:false in the catalog, so " +
|
||||
"Resolve now silences the thinking switch even when the caller asks for it.",
|
||||
},
|
||||
|
||||
// ---- deliberate divergences from the old behaviour ----
|
||||
{
|
||||
name: "deepseek now honours thinking=false instead of ignoring it",
|
||||
provider: "deepseek", model: "deepseek-v4-pro",
|
||||
opts: &api.Options{Thinking: ptrBool(false)},
|
||||
want: map[string]any{"thinking": map[string]any{"type": "disabled"}},
|
||||
divergence: "old code had no thinking strategy for DeepSeek, so an agent with thinking off " +
|
||||
"still got the vendor default (thinking on). The vendor documents thinking.type, so the " +
|
||||
"user's setting is now honoured.",
|
||||
},
|
||||
{
|
||||
name: "zhipu now honours thinking=false", provider: "zhipu", model: "glm-4.7",
|
||||
opts: &api.Options{Thinking: ptrBool(false)},
|
||||
want: map[string]any{"thinking": map[string]any{"type": "disabled"}},
|
||||
divergence: "same as DeepSeek: GLM documents thinking.type and the old code sent nothing.",
|
||||
},
|
||||
{
|
||||
name: "openai first-party now uses the Responses protocol",
|
||||
provider: "openai", model: "gpt-5.5",
|
||||
opts: &api.Options{MaxTokens: 100},
|
||||
want: map[string]any{"max_output_tokens": float64(100), "max_completion_tokens": nil},
|
||||
divergence: "api.openai.com now speaks the Responses protocol (reasoning items and encrypted " +
|
||||
"reasoning can be replayed); relays keep Chat Completions.",
|
||||
},
|
||||
{
|
||||
name: "openai through a relay keeps Chat Completions",
|
||||
provider: "openai", model: "gpt-5.5",
|
||||
opts: &api.Options{MaxTokens: 100},
|
||||
want: map[string]any{"max_completion_tokens": float64(100), "max_output_tokens": nil},
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range cases {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
cfg := &chat.ChatConfig{
|
||||
Provider: tc.provider, ModelName: tc.model, BaseURL: tc.baseURL, ExtraConfig: tc.extra,
|
||||
}
|
||||
if strings.Contains(tc.name, "through a relay") {
|
||||
cfg.BaseURL = "http://127.0.0.1:9/v1"
|
||||
}
|
||||
body := buildBody(t, cfg, tc.opts, tc.stream)
|
||||
for key, want := range tc.want {
|
||||
got, present := body[key]
|
||||
if want == nil {
|
||||
assert.False(t, present, "field %q must be absent, got %v", key, got)
|
||||
continue
|
||||
}
|
||||
assert.Equal(t, want, got, "field %q", key)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// TestLegacyProviderDetection pins the URL table of the old DetectProvider
|
||||
// switch: a stored model row without an explicit provider must still resolve
|
||||
// to the same vendor as before.
|
||||
func TestLegacyProviderDetection(t *testing.T) {
|
||||
cases := map[string]string{
|
||||
"https://dashscope.aliyuncs.com/compatible-mode/v1": "aliyun",
|
||||
"https://open.bigmodel.cn/api/paas/v4": "zhipu",
|
||||
"https://openrouter.ai/api/v1": "openrouter",
|
||||
"https://router.requesty.ai/v1": "requesty",
|
||||
"https://api.siliconflow.cn/v1": "siliconflow",
|
||||
"https://api.jina.ai/v1": "jina",
|
||||
"https://my-resource.openai.azure.com": "azure_openai",
|
||||
"https://api.openai.com/v1": "openai",
|
||||
"https://api.anthropic.com/v1": "anthropic",
|
||||
"https://api.deepseek.com/v1": "deepseek",
|
||||
"https://generativelanguage.googleapis.com/v1beta": "gemini",
|
||||
"https://ark.cn-beijing.volces.com/api/v3": "volcengine",
|
||||
"https://api.hunyuan.cloud.tencent.com/v1": "hunyuan",
|
||||
"https://api.minimaxi.com/v1": "minimax",
|
||||
"https://api.xiaomimimo.com/v1": "mimo",
|
||||
"https://api-inference.modelscope.cn/v1": "modelscope",
|
||||
"https://api.qnaigc.com/v1": "qiniu",
|
||||
"https://api.moonshot.ai/v1": "moonshot",
|
||||
"https://qianfan.baidubce.com/v2": "qianfan",
|
||||
"https://api.longcat.chat/openai/v1": "longcat",
|
||||
"https://api.lkeap.cloud.tencent.com/v1": "lkeap",
|
||||
"https://integrate.api.nvidia.com/v1": "nvidia",
|
||||
"https://api.novita.ai/openai/v1": "novita",
|
||||
"https://weknora.weixin.qq.com": "academycloud",
|
||||
"http://localhost:8000/v1": "generic",
|
||||
"": "generic",
|
||||
}
|
||||
for url, want := range cases {
|
||||
assert.Equal(t, want, modelruntime.DetectByURL(url), "DetectByURL(%q)", url)
|
||||
}
|
||||
}
|
||||
|
||||
// TestCatalogInvariants walks every registered vendor and model. It is the
|
||||
// net that catches a newly added vendor or model entry that is malformed,
|
||||
// contradictory, or unresolvable — without anyone updating this test.
|
||||
func TestCatalogInvariants(t *testing.T) {
|
||||
vendors := modelruntime.List()
|
||||
require.NotEmpty(t, vendors, "no vendors registered")
|
||||
seenID := map[string]bool{}
|
||||
|
||||
for _, v := range vendors {
|
||||
t.Run(v.ID, func(t *testing.T) {
|
||||
assert.False(t, seenID[v.ID], "duplicate vendor id")
|
||||
seenID[v.ID] = true
|
||||
assert.Equal(t, strings.ToLower(v.ID), v.ID, "vendor id must be lowercase")
|
||||
assert.NotEmpty(t, v.Name, "vendor needs a display name")
|
||||
assert.NotEmpty(t, v.Description, "vendor needs a description for the picker")
|
||||
assert.True(t, v.API.Known(), "unknown default API %q", v.API)
|
||||
assert.NotEmpty(t, v.ModelTypes, "vendor supports no model type")
|
||||
assert.True(t, strings.HasPrefix(strings.TrimSpace(string(v.Icon)), "<svg"), "icon must be an SVG")
|
||||
assert.LessOrEqual(t, len(v.Icon), 6*1024, "icon over the 6 KB budget")
|
||||
if v.RequiresAuth {
|
||||
assert.NotEmpty(t, v.Auth, "RequiresAuth without an auth style")
|
||||
}
|
||||
if v.Auth == providers.AuthSigned {
|
||||
assert.NotNil(t, v.Signer, "signed auth without a Signer hook")
|
||||
}
|
||||
|
||||
for _, field := range v.ExtraFields {
|
||||
assert.NotEmpty(t, field.Key, "extra field without a key")
|
||||
assert.NotEmpty(t, field.Label, "extra field %q without a label", field.Key)
|
||||
assert.Contains(t, []string{"string", "number", "boolean", "select", "password"}, field.Type,
|
||||
"extra field %q has an unsupported type", field.Key)
|
||||
if field.Type == "select" {
|
||||
assert.NotEmpty(t, field.Options, "select field %q without options", field.Key)
|
||||
}
|
||||
}
|
||||
|
||||
// Default URLs must be absolute and only declared for supported types.
|
||||
for mt, url := range v.DefaultBaseURLs {
|
||||
assert.True(t, strings.HasPrefix(url, "http://") || strings.HasPrefix(url, "https://"),
|
||||
"%s default URL %q is not absolute", mt, url)
|
||||
assert.True(t, v.SupportsType(mt), "default URL for unsupported model type %s", mt)
|
||||
}
|
||||
|
||||
ids := map[string]bool{}
|
||||
for _, m := range v.Models() {
|
||||
label := m.ID
|
||||
if label == "" {
|
||||
label = "match:" + m.Match
|
||||
}
|
||||
assert.True(t, m.ID != "" || m.Match != "", "model entry needs an id or a match pattern")
|
||||
if m.ID != "" {
|
||||
assert.False(t, ids[strings.ToLower(m.ID)], "duplicate model id %q", m.ID)
|
||||
ids[strings.ToLower(m.ID)] = true
|
||||
}
|
||||
assert.GreaterOrEqual(t, m.ContextWindow, 0, "%s: negative context window", label)
|
||||
assert.GreaterOrEqual(t, m.MaxOutputTokens, 0, "%s: negative max output", label)
|
||||
if m.ContextWindow > 0 && m.MaxOutputTokens > 0 {
|
||||
assert.LessOrEqual(t, m.MaxOutputTokens, m.ContextWindow,
|
||||
"%s: max output exceeds the context window", label)
|
||||
}
|
||||
for _, in := range m.Input {
|
||||
assert.Contains(t, []string{"text", "image", "audio", "video"}, in,
|
||||
"%s: unknown input modality %q", label, in)
|
||||
}
|
||||
for level := range m.ThinkingLevels {
|
||||
_, ok := api.ParseReasoningEffort(string(level))
|
||||
assert.True(t, ok, "%s: unknown thinking level %q", label, level)
|
||||
}
|
||||
if len(m.ThinkingLevels) > 0 {
|
||||
assert.True(t, m.Reasoning, "%s: thinking levels on a non-reasoning model", label)
|
||||
}
|
||||
if m.Cost != nil {
|
||||
assert.GreaterOrEqual(t, m.Cost.Input, 0.0, "%s: negative input cost", label)
|
||||
assert.GreaterOrEqual(t, m.Cost.Output, 0.0, "%s: negative output cost", label)
|
||||
}
|
||||
if m.ID != "" {
|
||||
// Resolve validates the compat object against the model's
|
||||
// protocol: an unknown or misspelled key fails here.
|
||||
_, err := modelruntime.Resolve(modelruntime.Ref{Provider: v.ID, Model: m.ID, ModelType: m.Type})
|
||||
if bytes.Contains(m.Compat, []byte("unsupported_reason")) {
|
||||
// An entry that declares itself unserveable must say so
|
||||
// by refusing, not by resolving into a request shaped
|
||||
// for a protocol this build does not speak.
|
||||
assert.Error(t, err, "%s: declares unsupported_reason but still resolves", label)
|
||||
continue
|
||||
}
|
||||
assert.NoError(t, err, "%s: does not resolve", label)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// TestEveryChatModelRequestShape builds a real request for every catalog chat
|
||||
// model, with thinking on and off, and asserts the invariants that hold for
|
||||
// every vendor. A new model whose compat contradicts itself fails here.
|
||||
func TestEveryChatModelRequestShape(t *testing.T) {
|
||||
for _, v := range modelruntime.List() {
|
||||
if !v.SupportsType(types.ModelTypeKnowledgeQA) {
|
||||
continue
|
||||
}
|
||||
for _, m := range v.ModelsByType(types.ModelTypeKnowledgeQA) {
|
||||
m := m
|
||||
t.Run(v.ID+"/"+m.ID, func(t *testing.T) {
|
||||
resolved := resolve(t, v.ID, m.ID)
|
||||
cfg := &chat.ChatConfig{
|
||||
Provider: v.ID, ModelName: m.ID,
|
||||
BaseURL: reachableBaseURL(v.GetDefaultURL(types.ModelTypeKnowledgeQA)),
|
||||
AppID: "app", AppSecret: "secret", // only used by signing vendors
|
||||
}
|
||||
for _, thinking := range []bool{true, false} {
|
||||
opts := &api.Options{MaxTokens: 256, Temperature: 0.5, Thinking: ptrBool(thinking)}
|
||||
body := buildBody(t, cfg, opts, true)
|
||||
|
||||
_, hasMaxTokens := body["max_tokens"]
|
||||
_, hasMaxCompletion := body["max_completion_tokens"]
|
||||
_, hasMaxOutput := body["max_output_tokens"]
|
||||
_, hasGenerationConfig := body["generationConfig"]
|
||||
budgets := 0
|
||||
for _, present := range []bool{hasMaxTokens, hasMaxCompletion, hasMaxOutput, hasGenerationConfig} {
|
||||
if present {
|
||||
budgets++
|
||||
}
|
||||
}
|
||||
assert.Equal(t, 1, budgets,
|
||||
"thinking=%v: exactly one completion-budget field expected, body=%v", thinking, body)
|
||||
|
||||
if resolved.API != api.APIOpenAICompletions {
|
||||
continue
|
||||
}
|
||||
settings := resolved.OpenAICompletions
|
||||
if !settings.SupportsTemperature {
|
||||
assert.NotContains(t, body, "temperature",
|
||||
"thinking=%v: model rejects sampling parameters", thinking)
|
||||
}
|
||||
if settings.ThinkingFormat == api.ThinkingFormatNone {
|
||||
for _, field := range []string{"thinking", "enable_thinking", "reasoning_effort", "reasoning"} {
|
||||
assert.NotContains(t, body, field,
|
||||
"thinking=%v: %s must not be sent when the vendor has no thinking format",
|
||||
thinking, field)
|
||||
}
|
||||
}
|
||||
if !thinking && !resolved.ThinkingLevels.Supports(api.ReasoningOff) {
|
||||
for _, field := range []string{"thinking", "enable_thinking"} {
|
||||
if value, ok := body[field]; ok {
|
||||
assert.NotEqual(t, map[string]any{"type": "disabled"}, value,
|
||||
"always-on model must not be told to disable thinking")
|
||||
assert.NotEqual(t, false, value,
|
||||
"always-on model must not be told to disable thinking")
|
||||
}
|
||||
}
|
||||
}
|
||||
if !settings.SupportsReasoningEffort {
|
||||
assert.NotContains(t, body, "reasoning_effort",
|
||||
"thinking=%v: vendor does not accept reasoning_effort", thinking)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TestAcademyCloudTransport pins the two things that vendor needs and no
|
||||
// other vendor does: a signed request to a non-standard path, and plain-text
|
||||
// content because the endpoint rejects multi-part messages.
|
||||
func TestAcademyCloudTransport(t *testing.T) {
|
||||
v, ok := modelruntime.Get("academycloud")
|
||||
require.True(t, ok)
|
||||
require.NotNil(t, v.Endpoint, "Academy Cloud needs a custom endpoint")
|
||||
url, _ := v.Endpoint(providers.EndpointRequest{
|
||||
BaseURL: "https://weknora.weixin.qq.com", ModelType: types.ModelTypeKnowledgeQA,
|
||||
})
|
||||
assert.Equal(t, "https://weknora.weixin.qq.com/api/v1/chat/completions", url)
|
||||
|
||||
resolved := resolve(t, "academycloud", "any-model")
|
||||
assert.False(t, resolved.OpenAICompletions.SupportsMultiContent,
|
||||
"Academy Cloud needs multi-content flattened to text")
|
||||
|
||||
cfg := &chat.ChatConfig{Provider: "academycloud", ModelName: "any-model", AppID: "app", AppSecret: "secret"}
|
||||
body := buildBody(t, cfg, &api.Options{}, false)
|
||||
messages, _ := json.Marshal(body["messages"])
|
||||
assert.Contains(t, string(messages), `"content":"hi"`, "content must be a plain string")
|
||||
}
|
||||
|
||||
// TestGeminiLegacyBaseURLKeepsOpenAIProtocol covers the rows that exist in
|
||||
// databases today: Gemini chat models were stored with the OpenAI-compatible
|
||||
// base URL, and those must keep speaking that protocol after the switch to
|
||||
// native generateContent as the default.
|
||||
func TestGeminiLegacyBaseURLKeepsOpenAIProtocol(t *testing.T) {
|
||||
r, err := modelruntime.Resolve(modelruntime.Ref{
|
||||
Provider: "gemini", Model: "gemini-2.5-pro",
|
||||
BaseURL: "https://generativelanguage.googleapis.com/v1beta/openai",
|
||||
})
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, api.APIOpenAICompletions, r.API)
|
||||
|
||||
native := resolve(t, "gemini", "gemini-2.5-pro")
|
||||
assert.Equal(t, api.APIGoogleGenerativeAI, native.API, "new rows use the native protocol")
|
||||
}
|
||||
|
||||
// TestGeminiCredentialFollowsTheProtocol pins the header each Gemini path
|
||||
// authenticates with. The two surfaces document different credentials —
|
||||
// x-goog-api-key for native generateContent, Authorization: Bearer for the
|
||||
// OpenAI-compatible facade (https://ai.google.dev/gemini-api/docs/openai) —
|
||||
// and the auth style is a vendor-wide setting, so without the per-protocol
|
||||
// override every row stored before the native protocol became the default
|
||||
// would silently change credential: they all carry the /v1beta/openai base
|
||||
// URL that the pre-catalog code paired with a bearer token.
|
||||
func TestGeminiCredentialFollowsTheProtocol(t *testing.T) {
|
||||
var got http.Header
|
||||
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
got = r.Header.Clone()
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
_, _ = w.Write([]byte(`{"choices":[{"message":{"content":"ok"}}],` +
|
||||
`"candidates":[{"content":{"parts":[{"text":"ok"}]}}]}`))
|
||||
}))
|
||||
defer server.Close()
|
||||
|
||||
for _, tc := range []struct {
|
||||
name string
|
||||
baseURL string
|
||||
wantHeader string
|
||||
otherEmpty string
|
||||
}{
|
||||
{
|
||||
name: "openai facade keeps the bearer token", baseURL: server.URL + "/v1beta/openai",
|
||||
wantHeader: "Authorization", otherEmpty: "x-goog-api-key",
|
||||
},
|
||||
{
|
||||
name: "native protocol uses the google api key", baseURL: server.URL + "/v1beta",
|
||||
wantHeader: "x-goog-api-key", otherEmpty: "Authorization",
|
||||
},
|
||||
} {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
client, err := chat.NewRemoteChat(&chat.ChatConfig{
|
||||
Source: types.ModelSourceRemote, Provider: "gemini",
|
||||
ModelName: "gemini-2.5-pro", BaseURL: tc.baseURL, APIKey: "KEY",
|
||||
})
|
||||
require.NoError(t, err)
|
||||
_, _ = client.Chat(context.Background(), []chat.Message{{Role: "user", Content: "hi"}},
|
||||
&chat.ChatOptions{})
|
||||
|
||||
assert.NotEmpty(t, got.Get(tc.wantHeader), "%s must carry the credential", tc.wantHeader)
|
||||
assert.Empty(t, got.Get(tc.otherEmpty), "%s must not be sent on this protocol", tc.otherEmpty)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// TestConcurrentResolve runs the resolution path from many goroutines at
|
||||
// once, the way a busy server does: every chat call resolves the catalog
|
||||
// before building its request. Registration happens once at init, but the
|
||||
// registry map and the per-vendor slices are shared, so a resolver that
|
||||
// mutated them would corrupt another request. Run with -race.
|
||||
func TestConcurrentResolve(t *testing.T) {
|
||||
vendors := modelruntime.List()
|
||||
require.NotEmpty(t, vendors)
|
||||
|
||||
const goroutines = 32
|
||||
done := make(chan struct{}, goroutines)
|
||||
for i := 0; i < goroutines; i++ {
|
||||
go func(i int) {
|
||||
defer func() { done <- struct{}{} }()
|
||||
for _, v := range vendors {
|
||||
models := v.ModelsByType(types.ModelTypeKnowledgeQA)
|
||||
name := "unknown-model"
|
||||
if len(models) > 0 {
|
||||
name = models[i%len(models)].ID
|
||||
}
|
||||
r, err := modelruntime.Resolve(modelruntime.Ref{Provider: v.ID, Model: name})
|
||||
if err != nil {
|
||||
t.Errorf("resolve %s/%s: %v", v.ID, name, err)
|
||||
return
|
||||
}
|
||||
// Touch the derived views the handlers use.
|
||||
_ = r.Capabilities()
|
||||
_ = r.ThinkingLevels.SupportedLevels()
|
||||
_ = modelruntime.DetectByURL(r.BaseURL)
|
||||
}
|
||||
}(i)
|
||||
}
|
||||
for i := 0; i < goroutines; i++ {
|
||||
<-done
|
||||
}
|
||||
}
|
||||
|
||||
// TestEveryCatalogModelDocumentsItsSource pins that each entry can answer
|
||||
// "where is this documented".
|
||||
//
|
||||
// Two things depend on it. The facts in models.json are only auditable if the
|
||||
// page they came from is recorded next to them, and the model editor links an
|
||||
// operator straight to that page from the picker. models.json may state the
|
||||
// URL once at file level for the entries a single page covers, so this also
|
||||
// covers the generator preserving per-entry sources — previously it was parsed and
|
||||
// dropped, and most entries had nothing to link to.
|
||||
func TestEveryCatalogModelDocumentsItsSource(t *testing.T) {
|
||||
for _, vendor := range modelruntime.List() {
|
||||
for _, model := range vendor.Models() {
|
||||
name := model.ID
|
||||
if name == "" {
|
||||
name = model.Match
|
||||
}
|
||||
t.Run(vendor.ID+"/"+name, func(t *testing.T) {
|
||||
if model.Source == "" {
|
||||
t.Fatalf("no source: add one to the entry, or a file-level source to models.json")
|
||||
}
|
||||
if !strings.HasPrefix(model.Source, "https://") && !strings.HasPrefix(model.Source, "http://") {
|
||||
t.Errorf("source %q is not a URL the editor can link to", model.Source)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package parity
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"academy/internal/models/api"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
// internal/types cannot import internal/models/api (it would cycle), so
|
||||
// types.CustomAgent.EnsureDefaults restates the reasoning-effort
|
||||
// vocabulary by hand to derive the legacy Thinking bool. Two copies of a
|
||||
// vocabulary drift, and the last time they did the result was a fail-open:
|
||||
// an unparseable level meant "unknown, therefore thinking on", which turned
|
||||
// a typo into thinking enabled at the provider default with an undefined
|
||||
// level sent upstream.
|
||||
//
|
||||
// This package imports both sides, so it is the one place the two can be
|
||||
// compared. It walks every value api.ParseReasoningEffort accepts and
|
||||
// asserts EnsureDefaults agrees about whether thinking is on, then asserts
|
||||
// that a value that function rejects never enables it.
|
||||
func TestReasoningEffortVocabulariesAgree(t *testing.T) {
|
||||
accepted := make([]string, 0, len(api.AllReasoningEfforts)+8)
|
||||
for _, level := range api.AllReasoningEfforts {
|
||||
accepted = append(accepted, string(level))
|
||||
}
|
||||
// The aliases ParseReasoningEffort documents for the legacy boolean UI
|
||||
// and for provider wording.
|
||||
accepted = append(accepted, "none", "false", "disabled", "true", "enabled", "default", "on")
|
||||
|
||||
for _, raw := range accepted {
|
||||
t.Run("accepted/"+raw, func(t *testing.T) {
|
||||
level, ok := api.ParseReasoningEffort(raw)
|
||||
if !ok {
|
||||
t.Fatalf("ParseReasoningEffort rejected %q, which this test lists as accepted", raw)
|
||||
}
|
||||
agent := types.CustomAgent{Config: types.CustomAgentConfig{ReasoningEffort: raw}}
|
||||
agent.EnsureDefaults()
|
||||
cfg := agent.Config
|
||||
if cfg.Thinking == nil {
|
||||
t.Fatalf("EnsureDefaults left Thinking unset for the known level %q", raw)
|
||||
}
|
||||
if got, want := *cfg.Thinking, level.Enabled(); got != want {
|
||||
t.Errorf("EnsureDefaults(%q) derived Thinking=%v, the level means %v", raw, got, want)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
for _, raw := range []string{"hgih", "ultra", "HIGH", " high ", "maximum", "0", "yes"} {
|
||||
t.Run("rejected/"+raw, func(t *testing.T) {
|
||||
if _, ok := api.ParseReasoningEffort(raw); ok {
|
||||
t.Fatalf("ParseReasoningEffort accepted %q; this table assumes it does not", raw)
|
||||
}
|
||||
agent := types.CustomAgent{Config: types.CustomAgentConfig{ReasoningEffort: raw}}
|
||||
agent.EnsureDefaults()
|
||||
if cfg := agent.Config; cfg.Thinking != nil && *cfg.Thinking {
|
||||
t.Errorf("an unparseable level must never enable thinking, %q did", raw)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,533 @@
|
||||
package parity
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"academy/internal/models"
|
||||
"academy/internal/models/api"
|
||||
"academy/internal/models/providers"
|
||||
"academy/internal/models/rerank"
|
||||
modelruntime "academy/internal/models/runtime"
|
||||
"academy/internal/types"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
// TestEveryRerankVendorResolvesToAKnownProtocol walks the catalog, so a newly
|
||||
// added vendor is covered without touching this file.
|
||||
func TestEveryRerankVendorResolvesToAKnownProtocol(t *testing.T) {
|
||||
vendors := modelruntime.ListByType(types.ModelTypeRerank)
|
||||
require.NotEmpty(t, vendors, "no vendor serves rerank")
|
||||
|
||||
for _, v := range vendors {
|
||||
t.Run(v.ID, func(t *testing.T) {
|
||||
model := "some-rerank-model"
|
||||
if catalogued := v.ModelsByType(types.ModelTypeRerank); len(catalogued) > 0 {
|
||||
model = catalogued[0].ID
|
||||
}
|
||||
resolved, err := modelruntime.Resolve(modelruntime.Ref{
|
||||
Provider: v.ID, Model: model, ModelType: types.ModelTypeRerank,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
assert.True(t, resolved.RerankAPI.Known(),
|
||||
"unknown rerank protocol %q", resolved.RerankAPI)
|
||||
// Generic and self-hosted TEI have no endpoint of their own:
|
||||
// the operator supplies one, and Validate requires it.
|
||||
if v.ID != providers.GenericID && v.ID != providers.HuggingFaceTEIID {
|
||||
assert.NotEmpty(t, resolved.BaseURL, "rerank vendors need a default endpoint")
|
||||
}
|
||||
|
||||
// A vendor that declares a ceiling must declare a usable one.
|
||||
assert.GreaterOrEqual(t, resolved.Rerank.MaxDocuments, 0)
|
||||
assert.GreaterOrEqual(t, resolved.Rerank.MaxDocumentChars, 0)
|
||||
if resolved.Rerank.ScoreScale != "" {
|
||||
assert.Contains(t,
|
||||
[]api.ScoreScale{api.ScoreProbability, api.ScoreLogit},
|
||||
resolved.Rerank.ScoreScale)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// TestRerankProtocolAssignment pins which dialect each vendor speaks. The
|
||||
// wire shapes are mutually incompatible, so a silent reassignment breaks
|
||||
// every rerank call for that vendor.
|
||||
func TestRerankProtocolAssignment(t *testing.T) {
|
||||
for id, want := range map[string]api.RerankAPI{
|
||||
"aliyun": api.RerankDashScope,
|
||||
"nvidia": api.RerankNIM,
|
||||
"pinecone": api.RerankPinecone,
|
||||
"huggingface_tei": api.RerankTEI,
|
||||
"lkeap": api.RerankTencentLKEAP,
|
||||
"volcengine": api.RerankVolcengineKnowledge,
|
||||
"zhipu": api.RerankCohere,
|
||||
"jina": api.RerankCohere,
|
||||
"siliconflow": api.RerankCohere,
|
||||
"qianfan": api.RerankCohere,
|
||||
"gpustack": api.RerankCohere,
|
||||
"generic": api.RerankCohere,
|
||||
"academycloud": api.RerankCohere,
|
||||
"novita": api.RerankCohere,
|
||||
"openrouter": api.RerankCohere,
|
||||
"litellm": api.RerankCohere,
|
||||
} {
|
||||
t.Run(id, func(t *testing.T) {
|
||||
resolved, err := modelruntime.Resolve(modelruntime.Ref{
|
||||
Provider: id, Model: "m", ModelType: types.ModelTypeRerank,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, want, resolved.RerankAPI)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// TestRerankOutboundShapePerProtocol builds the real client through
|
||||
// rerank.NewReranker and asserts what each dialect puts on the wire.
|
||||
func TestRerankOutboundShapePerProtocol(t *testing.T) {
|
||||
for _, tc := range []struct {
|
||||
name string
|
||||
provider string
|
||||
model string
|
||||
assert func(t *testing.T, path string, body map[string]any)
|
||||
reply string
|
||||
}{
|
||||
{
|
||||
name: "cohere shape", provider: "siliconflow", model: "BAAI/bge-reranker-v2-m3",
|
||||
reply: `{"results":[{"index":0,"relevance_score":0.5}]}`,
|
||||
assert: func(t *testing.T, path string, body map[string]any) {
|
||||
assert.Equal(t, "/v1/rerank", path)
|
||||
assert.Equal(t, "BAAI/bge-reranker-v2-m3", body["model"])
|
||||
assert.Equal(t, "q", body["query"])
|
||||
assert.Equal(t, []any{"d0"}, body["documents"])
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "dashscope shape", provider: "aliyun", model: "gte-rerank-v2",
|
||||
reply: `{"output":{"results":[{"index":0,"relevance_score":0.5,"document":{"text":"d0"}}]}}`,
|
||||
assert: func(t *testing.T, _ string, body map[string]any) {
|
||||
input, ok := body["input"].(map[string]any)
|
||||
require.True(t, ok, "DashScope wraps the query and documents in input")
|
||||
assert.Equal(t, "q", input["query"])
|
||||
assert.Contains(t, body, "parameters")
|
||||
assert.NotContains(t, body, "documents", "documents live under input")
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "dashscope shape for qwen3-rerank", provider: "aliyun", model: "qwen3-rerank",
|
||||
reply: `{"output":{"results":[{"index":0,"relevance_score":0.5,"document":{"text":"d0"}}]}}`,
|
||||
assert: func(t *testing.T, path string, body map[string]any) {
|
||||
assert.Equal(t, "/api/v1/services/rerank/text-rerank/text-rerank", path)
|
||||
assert.Equal(t, "qwen3-rerank", body["model"])
|
||||
input, ok := body["input"].(map[string]any)
|
||||
require.True(t, ok, "qwen3-rerank goes out in the native input wrapper")
|
||||
assert.Equal(t, "q", input["query"])
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "nim shape", provider: "nvidia", model: "nvidia/nv-rerankqa-mistral-4b-v3",
|
||||
reply: `{"rankings":[{"index":0,"logit":0.0}]}`,
|
||||
assert: func(t *testing.T, _ string, body map[string]any) {
|
||||
query, ok := body["query"].(map[string]any)
|
||||
require.True(t, ok, "NIM sends the query as an object")
|
||||
assert.Equal(t, "q", query["text"])
|
||||
assert.Equal(t, []any{map[string]any{"text": "d0"}}, body["passages"])
|
||||
assert.Equal(t, "END", body["truncate"], "NIM fails over-long input unless told to cut")
|
||||
},
|
||||
},
|
||||
} {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
var gotPath string
|
||||
var gotBody map[string]any
|
||||
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
gotPath = r.URL.Path
|
||||
_ = json.NewDecoder(r.Body).Decode(&gotBody)
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
_, _ = w.Write([]byte(tc.reply))
|
||||
}))
|
||||
defer server.Close()
|
||||
|
||||
reranker, err := rerank.NewReranker(&rerank.RerankerConfig{
|
||||
Provider: tc.provider, ModelName: tc.model, APIKey: "k",
|
||||
BaseURL: server.URL + rerankPathFor(t, tc.provider),
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
||||
_, err = reranker.Rerank(context.Background(), "q", []string{"d0"})
|
||||
require.NoError(t, err)
|
||||
tc.assert(t, gotPath, gotBody)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// rerankPathFor keeps the loopback base URL shaped like the vendor's own, so
|
||||
// the test exercises the same path handling production does.
|
||||
func rerankPathFor(t *testing.T, provider string) string {
|
||||
t.Helper()
|
||||
switch provider {
|
||||
case "aliyun":
|
||||
return "/api/v1/services/rerank/text-rerank/text-rerank"
|
||||
case "nvidia":
|
||||
return "/v1/retrieval/nvidia/reranking"
|
||||
default:
|
||||
return "/v1"
|
||||
}
|
||||
}
|
||||
|
||||
// TestNvidiaRerankScoresAreComparable is the end-to-end form of the unit test
|
||||
// in the rerank package: a NIM logit must reach the retrieval pipeline on the
|
||||
// same 0..1 scale as every other vendor, because they all meet one
|
||||
// RerankThreshold.
|
||||
func TestNvidiaRerankScoresAreComparable(t *testing.T) {
|
||||
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
|
||||
_, _ = w.Write([]byte(`{"rankings":[{"index":0,"logit":-1.171875},{"index":1,"logit":4.0}]}`))
|
||||
}))
|
||||
defer server.Close()
|
||||
|
||||
reranker, err := rerank.NewReranker(&rerank.RerankerConfig{
|
||||
Provider: "nvidia", ModelName: "nvidia/nv-rerankqa-mistral-4b-v3", APIKey: "k",
|
||||
BaseURL: server.URL + "/v1/retrieval/nvidia/reranking",
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
||||
got, err := reranker.Rerank(context.Background(), "q", []string{"d0", "d1"})
|
||||
require.NoError(t, err)
|
||||
require.Len(t, got, 2)
|
||||
for _, item := range got {
|
||||
assert.GreaterOrEqual(t, item.RelevanceScore, 0.0)
|
||||
assert.LessOrEqual(t, item.RelevanceScore, 1.0)
|
||||
}
|
||||
// Results come back ranked, so the logit of 4.0 leads and the negative
|
||||
// one follows: the conversion is monotonic and the ranking is preserved.
|
||||
assert.Equal(t, 1, got[0].Index)
|
||||
assert.Greater(t, got[0].RelevanceScore, got[1].RelevanceScore)
|
||||
}
|
||||
|
||||
// TestSignedRerankVendorRequiresItsIdentityPair keeps the pre-catalog
|
||||
// contract: Academy Cloud rerank is signed with an AppID / AppSecret pair, and
|
||||
// a row without one must fail at construction rather than send unsigned
|
||||
// requests that the far end rejects with something less readable.
|
||||
func TestSignedRerankVendorRequiresItsIdentityPair(t *testing.T) {
|
||||
_, err := rerank.NewReranker(&rerank.RerankerConfig{
|
||||
Provider: "academycloud", ModelName: "rerank",
|
||||
})
|
||||
require.Error(t, err)
|
||||
assert.Contains(t, err.Error(), "AppID")
|
||||
|
||||
_, err = rerank.NewReranker(&rerank.RerankerConfig{
|
||||
Provider: "academycloud", ModelName: "rerank", AppID: "app",
|
||||
})
|
||||
require.Error(t, err)
|
||||
assert.Contains(t, err.Error(), "AppSecret")
|
||||
}
|
||||
|
||||
// TestTruncatePromptTokensOnlyReachesVLLMClassVendors pins the gate on the
|
||||
// vLLM extension restored from the pre-catalog client. It is opt-in per row,
|
||||
// but the row can only opt into it on a runtime that implements it: no
|
||||
// managed vendor documents the field, and sending it to one is how an
|
||||
// undocumented parameter ends up on every request.
|
||||
func TestTruncatePromptTokensOnlyReachesVLLMClassVendors(t *testing.T) {
|
||||
optIn := map[string]string{models.ExtraTruncatePromptTokens: "512"}
|
||||
|
||||
for _, id := range []string{"generic", "gpustack"} {
|
||||
t.Run(id+" accepts it", func(t *testing.T) {
|
||||
resolved, err := modelruntime.Resolve(modelruntime.Ref{
|
||||
Provider: id, Model: "m", ModelType: types.ModelTypeRerank,
|
||||
BaseURL: "http://127.0.0.1:9/v1", Extra: optIn,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, 512, resolved.Rerank.TruncatePromptTokens)
|
||||
})
|
||||
}
|
||||
|
||||
for _, id := range []string{"jina", "zhipu", "siliconflow", "qianfan", "academycloud", "aliyun", "nvidia"} {
|
||||
t.Run(id+" rejects it", func(t *testing.T) {
|
||||
_, err := modelruntime.Resolve(modelruntime.Ref{
|
||||
Provider: id, Model: "m", ModelType: types.ModelTypeRerank, Extra: optIn,
|
||||
})
|
||||
require.Error(t, err, "a managed vendor must not silently accept a vLLM extension")
|
||||
assert.Contains(t, err.Error(), "vLLM extension")
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestTruncatePromptTokensRejectsAnInvalidValue(t *testing.T) {
|
||||
for _, raw := range []string{"0", "-1", "abc"} {
|
||||
_, err := modelruntime.Resolve(modelruntime.Ref{
|
||||
Provider: "generic", Model: "m", ModelType: types.ModelTypeRerank,
|
||||
BaseURL: "http://127.0.0.1:9/v1",
|
||||
Extra: map[string]string{models.ExtraTruncatePromptTokens: raw},
|
||||
})
|
||||
require.Error(t, err, "value %q", raw)
|
||||
}
|
||||
}
|
||||
|
||||
// TestRerankCeilingsAreTheDocumentedOnes pins the numbers the shared batching
|
||||
// layer enforces. They used to live inside each client, where a dedicated
|
||||
// test watched them; now they are declarations, so they need their own guard —
|
||||
// TestEveryRerankVendorResolvesToAKnownProtocol only checks they are sane.
|
||||
func TestRerankCeilingsAreTheDocumentedOnes(t *testing.T) {
|
||||
for id, want := range map[string]api.RerankSettings{
|
||||
// docs.bigmodel.cn: 最多 128 条,query 与单条文档各 4096 字符
|
||||
"zhipu": {MaxDocuments: 128, MaxQueryChars: 4096, MaxDocumentChars: 4096},
|
||||
// cloud.tencent.com/document/product/1772: RunRerank 60 docs,
|
||||
// Query + Docs together 2000 characters, one request at a time.
|
||||
"lkeap": {MaxDocuments: 60, MaxRequestChars: 2000, MaxConcurrency: 1},
|
||||
// VikingDB Knowledge Service rerank: datas "数组长度不超过 200".
|
||||
"volcengine": {MaxDocuments: 200, MaxConcurrency: 4},
|
||||
// NIM reranking: passages is capped at 512 items.
|
||||
"nvidia": {MaxDocuments: 512},
|
||||
// cloud.baidu.com/doc/qianfan-api: 文本数量不超过64, query 不超过
|
||||
// 1600 个字符, 每条 document 不超过 4096 个字符.
|
||||
"qianfan": {MaxDocuments: 64, MaxQueryChars: 1600, MaxDocumentChars: 4096},
|
||||
// help.aliyun.com text-rerank: 500 documents per request. Its length
|
||||
// limits are stated in tokens, which runes cannot express.
|
||||
"aliyun": {MaxDocuments: 500},
|
||||
// TEI router: --max-client-batch-size defaults to 32.
|
||||
"huggingface_tei": {MaxDocuments: 32},
|
||||
} {
|
||||
t.Run(id, func(t *testing.T) {
|
||||
resolved, err := modelruntime.Resolve(modelruntime.Ref{
|
||||
Provider: id, Model: "m", ModelType: types.ModelTypeRerank,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
got := resolved.Rerank
|
||||
assert.Equal(t, want.MaxDocuments, got.MaxDocuments, "max documents")
|
||||
assert.Equal(t, want.MaxQueryChars, got.MaxQueryChars, "max query characters")
|
||||
assert.Equal(t, want.MaxDocumentChars, got.MaxDocumentChars, "max document characters")
|
||||
assert.Equal(t, want.MaxRequestChars, got.MaxRequestChars, "max request characters")
|
||||
assert.Equal(t, want.MaxConcurrency, got.MaxConcurrency, "max concurrency")
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// TestAcademyCloudRerankKeepsItsDeadline pins the one rerank vendor that has
|
||||
// ever had a client-level timeout. Without it a hung endpoint holds the
|
||||
// retrieval stage open for as long as the caller's context allows.
|
||||
func TestAcademyCloudRerankKeepsItsDeadline(t *testing.T) {
|
||||
resolved, err := modelruntime.Resolve(modelruntime.Ref{
|
||||
Provider: "academycloud", Model: "rerank", ModelType: types.ModelTypeRerank,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, 60, resolved.Rerank.RequestTimeout)
|
||||
|
||||
// Everyone else has always run without one and relies on the caller.
|
||||
for _, id := range []string{"zhipu", "jina", "siliconflow", "aliyun", "nvidia", "generic"} {
|
||||
other, err := modelruntime.Resolve(modelruntime.Ref{
|
||||
Provider: id, Model: "m", ModelType: types.ModelTypeRerank,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
assert.Zero(t, other.Rerank.RequestTimeout, "%s did not have a client deadline before", id)
|
||||
}
|
||||
}
|
||||
|
||||
// TestTruncatePromptTokensIsReachableFromTheEditor closes the loop between the
|
||||
// vendor accepting the extension and an operator being able to turn it on.
|
||||
// Before the catalog it was readable from extra_config but had no input in the
|
||||
// model editor, so the only way to set it was the API or the database.
|
||||
// GET /models/providers renders extra fields dynamically, so declaring one is
|
||||
// all it takes — and it must be declared exactly where the extension is
|
||||
// accepted, or the form offers a switch the vendor will reject.
|
||||
func TestTruncatePromptTokensIsReachableFromTheEditor(t *testing.T) {
|
||||
for _, v := range modelruntime.ListByType(types.ModelTypeRerank) {
|
||||
var field *providers.ExtraField
|
||||
for i := range v.ExtraFields {
|
||||
if v.ExtraFields[i].Key == models.ExtraTruncatePromptTokens {
|
||||
field = &v.ExtraFields[i]
|
||||
}
|
||||
}
|
||||
resolved, err := modelruntime.Resolve(modelruntime.Ref{
|
||||
Provider: v.ID, Model: "m", ModelType: types.ModelTypeRerank,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
||||
if !resolved.Rerank.AcceptsTruncatePromptTokens {
|
||||
assert.Nil(t, field, "%s does not accept the extension, so it must not offer the input", v.ID)
|
||||
continue
|
||||
}
|
||||
require.NotNil(t, field, "%s accepts the extension but offers no way to set it", v.ID)
|
||||
assert.Equal(t, "number", field.Type)
|
||||
assert.False(t, field.Required, "the extension is opt-in")
|
||||
assert.Equal(t, []types.ModelType{types.ModelTypeRerank}, field.ModelTypes,
|
||||
"the input belongs to the rerank form only")
|
||||
}
|
||||
}
|
||||
|
||||
// TestRerankScoreScalesMatchTheVendorDocs pins which vendors return something
|
||||
// other than a 0..1 relevance score. Getting this wrong is silent: the number
|
||||
// still looks like a score, and the retrieval threshold still compares it, so
|
||||
// a logit-scaled vendor simply loses every negatively scored document.
|
||||
func TestRerankScoreScalesMatchTheVendorDocs(t *testing.T) {
|
||||
// Both spell the field like a probability and return neither.
|
||||
// NIM: rankings[].logit, e.g. 0.226 / -1.171 / -6.31
|
||||
// GPUStack: relevance_score, e.g. 1.951 / -3.734 / -6.157
|
||||
logitScaled := map[string]bool{"nvidia": true, "gpustack": true}
|
||||
|
||||
for _, v := range modelruntime.ListByType(types.ModelTypeRerank) {
|
||||
resolved, err := modelruntime.Resolve(modelruntime.Ref{
|
||||
Provider: v.ID, Model: "m", ModelType: types.ModelTypeRerank,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
want := api.ScoreProbability
|
||||
if logitScaled[v.ID] {
|
||||
want = api.ScoreLogit
|
||||
}
|
||||
assert.Equal(t, want, resolved.Rerank.ScoreScale, "%s score scale", v.ID)
|
||||
}
|
||||
}
|
||||
|
||||
// TestQwen3RerankUsesNativeDashScopeProtocol keeps qwen3-rerank on the
|
||||
// native text-rerank endpoint. Alibaba also documents a flat
|
||||
// /compatible-api/v1/reranks shape for it, but the native endpoint serves the
|
||||
// same model with identical scores (#3558), and v0.8.0 deployments already
|
||||
// have rows that name it — refusing it would break them on upgrade.
|
||||
func TestQwen3RerankUsesNativeDashScopeProtocol(t *testing.T) {
|
||||
v, ok := modelruntime.Get("aliyun")
|
||||
require.True(t, ok)
|
||||
|
||||
offered := make([]string, 0)
|
||||
for _, m := range v.ModelsByType(types.ModelTypeRerank) {
|
||||
offered = append(offered, m.ID)
|
||||
}
|
||||
assert.Contains(t, offered, "qwen3-rerank")
|
||||
assert.Contains(t, offered, "gte-rerank-v2")
|
||||
|
||||
for _, model := range []string{"qwen3-rerank", "gte-rerank-v2"} {
|
||||
resolved, err := modelruntime.Resolve(modelruntime.Ref{
|
||||
Provider: "aliyun", Model: model, ModelType: types.ModelTypeRerank,
|
||||
})
|
||||
require.NoError(t, err, model)
|
||||
assert.Equal(t, api.RerankDashScope, resolved.RerankAPI, model)
|
||||
}
|
||||
}
|
||||
|
||||
// TestGatewayRerankEndpoints pins the URL each gateway's rerank rows reach.
|
||||
// All three serve the Cohere dialect the protocol package already speaks, so
|
||||
// opening the type was a declaration — but LiteLLM documents the route on the
|
||||
// proxy root rather than under /v1, which is why it needs its own default.
|
||||
func TestGatewayRerankEndpoints(t *testing.T) {
|
||||
for _, tc := range []struct {
|
||||
provider string
|
||||
wantURL string
|
||||
}{
|
||||
// https://docs.novita.ai/api-reference/model-apis-llm-create-rerank
|
||||
{provider: "novita", wantURL: "https://api.novita.ai/openai/v1/rerank"},
|
||||
// https://openrouter.ai/docs/api/api-reference/rerank/submit-a-rerank-request
|
||||
{provider: "openrouter", wantURL: "https://openrouter.ai/api/v1/rerank"},
|
||||
// https://docs.litellm.ai/docs/rerank — the curl example posts to
|
||||
// http://0.0.0.0:4000/rerank, not /v1/rerank.
|
||||
{provider: "litellm", wantURL: "http://your_litellm_proxy/rerank"},
|
||||
} {
|
||||
t.Run(tc.provider, func(t *testing.T) {
|
||||
resolved, err := modelruntime.Resolve(modelruntime.Ref{
|
||||
Provider: tc.provider, Model: "m", ModelType: types.ModelTypeRerank,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, api.RerankCohere, resolved.RerankAPI)
|
||||
|
||||
// Rebuild the URL the way cohererank does.
|
||||
got := strings.TrimRight(resolved.BaseURL, "/")
|
||||
if !strings.HasSuffix(got, "/rerank") {
|
||||
got += "/rerank"
|
||||
}
|
||||
assert.Equal(t, tc.wantURL, got)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// TestScoreScaleIsOverridablePerRow covers the gateways, where the vendor
|
||||
// cannot know the answer: GPUStack and a generic endpoint serve whatever
|
||||
// reranker was deployed behind them, and the two families disagree — BGE
|
||||
// answers a 0..1 probability, Qwen3-Reranker an unbounded score. Converting a
|
||||
// probability as if it were a logit squeezes every score into [0.5, 0.73],
|
||||
// which makes a relevance threshold meaningless, so the operator needs a way
|
||||
// to say which one is actually there.
|
||||
func TestScoreScaleIsOverridablePerRow(t *testing.T) {
|
||||
for _, id := range []string{"gpustack", "generic"} {
|
||||
t.Run(id, func(t *testing.T) {
|
||||
base := "http://127.0.0.1:9/v1"
|
||||
overridden, err := modelruntime.Resolve(modelruntime.Ref{
|
||||
Provider: id, Model: "bge-reranker-v2-m3", ModelType: types.ModelTypeRerank,
|
||||
BaseURL: base, Extra: map[string]string{models.ExtraScoreScale: "probability"},
|
||||
})
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, api.ScoreProbability, overridden.Rerank.ScoreScale)
|
||||
|
||||
// And the input to set it is rendered by the editor.
|
||||
v, ok := modelruntime.Get(id)
|
||||
require.True(t, ok)
|
||||
var field *providers.ExtraField
|
||||
for i := range v.ExtraFields {
|
||||
if v.ExtraFields[i].Key == models.ExtraScoreScale {
|
||||
field = &v.ExtraFields[i]
|
||||
}
|
||||
}
|
||||
require.NotNil(t, field, "%s must offer the override it needs", id)
|
||||
assert.Equal(t, "select", field.Type)
|
||||
assert.Len(t, field.Options, 2)
|
||||
})
|
||||
}
|
||||
|
||||
_, err := modelruntime.Resolve(modelruntime.Ref{
|
||||
Provider: "gpustack", Model: "m", ModelType: types.ModelTypeRerank,
|
||||
BaseURL: "http://127.0.0.1:9/v1",
|
||||
Extra: map[string]string{models.ExtraScoreScale: "sigmoid"},
|
||||
})
|
||||
require.Error(t, err, "an unknown scale must not be treated as a probability")
|
||||
}
|
||||
|
||||
// TestGatewayVendorsOfferTheScoreScaleOverride keeps the override where the
|
||||
// question is open. A gateway cannot know which reranker is deployed behind
|
||||
// it, so all three offer the input; the other vendors' scales are settled by
|
||||
// their own documentation and must not offer a switch that only lets an
|
||||
// operator get it wrong.
|
||||
func TestGatewayVendorsOfferTheScoreScaleOverride(t *testing.T) {
|
||||
gateways := map[string]bool{"generic": true, "gpustack": true, "litellm": true}
|
||||
|
||||
for _, v := range modelruntime.ListByType(types.ModelTypeRerank) {
|
||||
var field *providers.ExtraField
|
||||
for i := range v.ExtraFields {
|
||||
if v.ExtraFields[i].Key == models.ExtraScoreScale {
|
||||
field = &v.ExtraFields[i]
|
||||
}
|
||||
}
|
||||
if !gateways[v.ID] {
|
||||
assert.Nil(t, field, "%s: its documentation settles the scale", v.ID)
|
||||
continue
|
||||
}
|
||||
require.NotNil(t, field, "%s is a gateway and needs the override", v.ID)
|
||||
require.Len(t, field.Options, 2)
|
||||
for _, opt := range field.Options {
|
||||
assert.NotEmpty(t, opt.LocalizedLabel("zh-CN"), "%s: option %q has no label", v.ID, opt.Value)
|
||||
assert.NotEqual(t, opt.Label, opt.LocalizedLabel("zh-CN"),
|
||||
"%s: option %q is prose and needs a zh-CN label", v.ID, opt.Value)
|
||||
}
|
||||
assert.NotEqual(t, field.Placeholder, field.LocalizedPlaceholder("zh-CN"),
|
||||
"%s: the placeholder is prose and needs a zh-CN variant", v.ID)
|
||||
}
|
||||
}
|
||||
|
||||
// Every operator-facing string a vendor declares has to exist in both
|
||||
// languages, or half the product reads English prose in a Chinese form.
|
||||
func TestEveryExtraFieldProseIsLocalized(t *testing.T) {
|
||||
for _, v := range modelruntime.List() {
|
||||
for _, field := range v.ExtraFields {
|
||||
if field.Placeholder != "" && strings.Contains(field.Placeholder, " ") {
|
||||
assert.NotEqual(t, field.Placeholder, field.LocalizedPlaceholder("zh-CN"),
|
||||
"%s/%s: placeholder is prose without a zh-CN variant", v.ID, field.Key)
|
||||
}
|
||||
for _, opt := range field.Options {
|
||||
// An identifier (a region code, a version) is the same in
|
||||
// every language; prose is not.
|
||||
if strings.Contains(opt.Label, " ") {
|
||||
assert.NotEqual(t, opt.Label, opt.LocalizedLabel("zh-CN"),
|
||||
"%s/%s: option %q is prose without a zh-CN label", v.ID, field.Key, opt.Value)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,374 @@
|
||||
{
|
||||
"aliyun/ASR/qwen3-asr-flash": "bb6104c02ce1013fd954de79c4998fd5b9e96e8b91cbbe083c9bc02a23660d7a",
|
||||
"aliyun/ASR/snapshot": "error: catalog: aliyun does not serve \"\" through a protocol this build implements: Alibaba's other recognition models take a public file URL or run as asynchronous tasks; only qwen3-asr-flash accepts the audio in the request",
|
||||
"aliyun/Embedding/multimodal-embedding-v1": "50cf14ae80fda14d123809d757833c44f08f7dc3b7f5d2d5d647d7ad66a8449b",
|
||||
"aliyun/Embedding/multimodal-embeddingsnapshot": "abd8e6e33132030c401670448cbc649f51c200bd5b0042157d3ecbabb093fd4d",
|
||||
"aliyun/Embedding/qwen2.5-vl-embedding": "277b713c73d600e661cab1a118b1f7ed6b936e4c48843b1cfb1a049385ddafff",
|
||||
"aliyun/Embedding/qwen2.5-vl-embeddingsnapshot": "f957cb1c3bdba7cfe010c2c2f58a5148e422c629a4486321296a35ee4b7790f0",
|
||||
"aliyun/Embedding/qwen3-vl-embedding": "80e3b7307df275d470f6c174f3bee891439fbe410d116720c7deba09bbde97af",
|
||||
"aliyun/Embedding/qwen3-vl-embeddingsnapshot": "3d6dba847c93c3ea41c64a18dd31ec521c37426a05d94968bfea90c951544127",
|
||||
"aliyun/Embedding/qwen3.7-text-embedding": "1747d31bcb369f32605000f3f2cc59406a4f7ddc5be6123c80e4e06f5d7fc2e7",
|
||||
"aliyun/Embedding/qwen3.7-text-embedding-flash": "14ce61f8e4aea6394b43f6383bd2ec3d1398abd0a8d666374c4300fb86845cd5",
|
||||
"aliyun/Embedding/text-embedding-v1": "1e7d78c2635542f53008f0aa30d69544fd4fae3a48d36745b027875005cfb2d6",
|
||||
"aliyun/Embedding/text-embedding-v2": "b3eb2440097a26c93dea795bdf9b9d1ea4d4a11f1e20a034e2bb146d7226883f",
|
||||
"aliyun/Embedding/text-embedding-v3": "ef7acfe7150c048a9c46d5e8e2bc14d890df0721f877d76c41e6a2ed275bb7cc",
|
||||
"aliyun/Embedding/text-embedding-v4": "acd6a3536ee4f98330fb02e39c9f1952dbb1eb578d70a82c64278355ca44bc36",
|
||||
"aliyun/Embedding/tongyi-embedding-vision-flash": "bff51fd7a6cdb822b6b7463e436d68f953c1599796814dd0d9181db15c4fc4ec",
|
||||
"aliyun/Embedding/tongyi-embedding-vision-plus": "fd37a8b75ef6f1c54dbbba9975e75f2668690d479f42beda61804f1be5b3c6bd",
|
||||
"aliyun/Embedding/tongyi-embedding-visionsnapshot": "37e1d6878a0ec196c49339fc5ba48615f12453b7f065c6ac0e50e272b76ac219",
|
||||
"aliyun/KnowledgeQA/deepseek-r1": "735322a596dda4a914b7e53041643eab61bd90b51e18e0cffd36dcc807b6fd16",
|
||||
"aliyun/KnowledgeQA/deepseek-v3snapshot": "b3e72a6d322e5d53b18cf1204434be5f75de77262e67bab838492376c7c287b3",
|
||||
"aliyun/KnowledgeQA/deepseek-v4-flash": "ac9d4d9224054609f98ba4ab3fc32c47b99f6af8c4153793a2fd00f5495212e9",
|
||||
"aliyun/KnowledgeQA/deepseek-v4-pro": "721e53ca9a8ce694089bcd40191192bc977da23b4a1d4bd0dedf4fdc49211d22",
|
||||
"aliyun/KnowledgeQA/deepseek-v4snapshot": "0d8da530ae0a30876180c66297759e2432c7f1d75a3d619a8d16e62a68855947",
|
||||
"aliyun/KnowledgeQA/glm-5.3": "4dd3f7f0fa9a150dc5f5a04ac2e966d4ba72175469899595e2be1e25b3ced1cc",
|
||||
"aliyun/KnowledgeQA/glm-5snapshot": "1ac48a35980b980f74bba9ec66d544f4002d0cae9a56df6e56af048a4638d773",
|
||||
"aliyun/KnowledgeQA/kimi-k2.6": "c3abc2f5dca8649975aeba02b65d00b5e9d52a42d1ed78738e4ab52f21519cc6",
|
||||
"aliyun/KnowledgeQA/kimi-k2snapshot": "fe5309c7a15bd6d1a1f0a7a6ff6781114bca8df784d51426d10435f3b6bfe801",
|
||||
"aliyun/KnowledgeQA/kimi-k3": "bc5876d0856c08564e99bf64fe7d3d146ac198dbe2162aed5da5dc31e4414e76",
|
||||
"aliyun/KnowledgeQA/qwen-flash": "0dd76b78c1ec61684c3652e2071669dd7cf3bfebf5f2ac5455256ab7a3fea943",
|
||||
"aliyun/KnowledgeQA/qwen-flashsnapshot": "c87b62a72825e100762a35f59a9de188e5c32b9af200a88f52f53b31e242919c",
|
||||
"aliyun/KnowledgeQA/qwen-max": "6cbf111674fb87b581e0a00ba5bc374f755350df9f0f1b04cb1c57f2fbcf93bd",
|
||||
"aliyun/KnowledgeQA/qwen-maxsnapshot": "a82d0a42e7fda949b518405d13d1ffb00c2e638b9057eaa023d97133e47202a7",
|
||||
"aliyun/KnowledgeQA/qwen-plus": "9cddc4357709d690a0d6fc7c4f5e489f2be896079a5c2c0865ee8d584cb0710b",
|
||||
"aliyun/KnowledgeQA/qwen-plussnapshot": "71d8ee8a8211fd8185fa6d55ceb54d3bc211bab28de145eed903909ea56f99b9",
|
||||
"aliyun/KnowledgeQA/qwen-turbo": "2509ff8973a28864388f0f78bc9cf5ff39c41badcbb0b68c006fbd737d8b733f",
|
||||
"aliyun/KnowledgeQA/qwen-turbosnapshot": "763ccbe6edf8591c503e0fa583ccb57f2f3b1d3301d8755f281b93973c86ffdd",
|
||||
"aliyun/KnowledgeQA/qwen-vl-max": "363afe785842c67a130d5b52276898907ab6ec68fa94f7daeb92f620d9461241",
|
||||
"aliyun/KnowledgeQA/qwen-vl-plus": "93ceef7e0934e75ba46c29808100d06beb5b17e166d42b1a8f9b67827445bb20",
|
||||
"aliyun/KnowledgeQA/qwen3-max": "26c68d4418a2ac820f38298cc02c819759ad07ad73f1cdfb0717c2f3fb3b4777",
|
||||
"aliyun/KnowledgeQA/qwen3-vl-plus": "a9c17b4adc677e16c45c46f7c3d349050cf74f8bc45f4b00801d27bcef7afb0f",
|
||||
"aliyun/KnowledgeQA/qwen3.5-flash": "031aff057e413a6fbca8e23ad0c49c87c21966ee6a9433e62974da629c0e601b",
|
||||
"aliyun/KnowledgeQA/qwen3.5-plus": "0996fbdbd529902600e90b5479fd33433a1a42dbfc5bd048261f8e731fec1199",
|
||||
"aliyun/KnowledgeQA/qwen3.5snapshot": "aaeb6e1305ae6ed1e17f1f7d6f63998a6be1f643266510bd0b22de04cf1ec269",
|
||||
"aliyun/KnowledgeQA/qwen3.6-flash": "b0d78ba90bc8389faf889ddb233433c9064be614c223f9e642d56a76343631a6",
|
||||
"aliyun/KnowledgeQA/qwen3.6-plus": "ae8db4ffac0edb2acdc88415b4b86d7684b0c240adb5dc14d4396b83b249c287",
|
||||
"aliyun/KnowledgeQA/qwen3.6snapshot": "99d81f0501afe9bc35d73bde4994bf9694c3eac8df3db5555bda7ebe9a4d8c2d",
|
||||
"aliyun/KnowledgeQA/qwen3.7-flash": "bb843bbbcb15592b40b0440eefd62ccf33071296fafe2f62ad91b568d79a2278",
|
||||
"aliyun/KnowledgeQA/qwen3.7-max": "2d928e94ee5a8f4c7929b7864811809f24c9111c07c29ef5636a4f9100b5d24c",
|
||||
"aliyun/KnowledgeQA/qwen3.7-plus": "a9c62431dbc611c0fbe8143abbbf6684fe693b80ab0df6ef51f3420c434c234d",
|
||||
"aliyun/KnowledgeQA/qwen3.7snapshot": "c4f7868c2d989871b19f56ded1c2618681c42c9df3e21387b79592e684bce552",
|
||||
"aliyun/KnowledgeQA/qwen3.8-flash": "cfc1b3931753e0c95289e593b1b090492ab406cd5ba61e7b2517d9a0ca3202b7",
|
||||
"aliyun/KnowledgeQA/qwen3.8-max": "59599abf4bf64d2f9c7a3facb860fcbcddcdf833533202d6abf04f67b86bc4ec",
|
||||
"aliyun/KnowledgeQA/qwen3.8snapshot": "c7ca540b17a3b0c74abaf31bff8e3c5f6cf41011c36380931086c13f9adf947e",
|
||||
"aliyun/KnowledgeQA/qwen3snapshot": "aa634e380fcef6efc6ce9c096acb8d7ad75f8d80e3c078829ab47a08164d4cc8",
|
||||
"aliyun/KnowledgeQA/qwq-32b": "b05df754c2d09e0fe937e85c6bda28b71ef3e694c0e06c17dccdbd9217fecb28",
|
||||
"aliyun/KnowledgeQA/qwq-plus": "7139911fda2d14b002889abbd06c185e550bec0984cea85116510b17ba4063ea",
|
||||
"aliyun/Rerank/gte-rerank-v2": "27219a2ffc212a35e9eeacf87da136410342e1915dd1141dc3357d7b40f9595b",
|
||||
"aliyun/Rerank/qwen3-rerank": "2b0b10a4c768fb157901e45586d0092e4ebe5ee5e92064a592aa726d8d133df2",
|
||||
"anthropic/KnowledgeQA/claude-fable-5": "7de3476c027bee1ff6c57d80750c84cec1d405fafe746470e72d6d3f0d2c5142",
|
||||
"anthropic/KnowledgeQA/claude-fable-5-1": "a8fd85f4d84dc59d34f6088badbfaa149c025efaeb358bdf18b829a3759a84e3",
|
||||
"anthropic/KnowledgeQA/claude-haiku-4-5": "5eb4abef41f957d98c0a15c83de48c0e6b46be48d59f761ba6006c29010487f9",
|
||||
"anthropic/KnowledgeQA/claude-haiku-4-5-20251001": "50878a87d7d212c8f295f191343f77200d71e71337b934a07a949ce04ef976f1",
|
||||
"anthropic/KnowledgeQA/claude-haiku-5-5": "e69241c875604143108531eb4614a575af80abfc12fbad496462654177331101",
|
||||
"anthropic/KnowledgeQA/claude-opus-4-5": "3536e5a1bb14f6e980eeda66cca9d7fc8bfea8c6b26937765069d93f713a673d",
|
||||
"anthropic/KnowledgeQA/claude-opus-4-5-20251101": "78bfa567c9c17acb9488ea0a7aaccb5b0e73e840db8c4955731debf1382ff8cf",
|
||||
"anthropic/KnowledgeQA/claude-opus-4-6": "96f08927c9e9df5c113102d498d38c1aab3a7280f350f14cfe8fad4dfcffe039",
|
||||
"anthropic/KnowledgeQA/claude-opus-4-7": "d5cac6382ff5bca2f303199ab6a9ccabf8c205569f6cd090ec64bbfd672b4ebe",
|
||||
"anthropic/KnowledgeQA/claude-opus-4-8": "7335b6d93baf2fc6a7776737df6bf58791e8aed08475017cbad66abcd48d573f",
|
||||
"anthropic/KnowledgeQA/claude-opus-5": "bb9cc2a045ce8d4ebd5ce65d61f8abf3f1bb19af817961eaea5faa802e0819e5",
|
||||
"anthropic/KnowledgeQA/claude-opus-5-5": "473f7e4047961c7405171ff7b53355f19604d77e3d376ff6d0cdec7fb3d12a7d",
|
||||
"anthropic/KnowledgeQA/claude-sonnet-4-5": "176ba6989053acf35be0a6acdd421c1c94c20f183358544eb0343c6e74897220",
|
||||
"anthropic/KnowledgeQA/claude-sonnet-4-5-20250929": "6757d77ed1d25cf80d04d2d35217a7f5d94e37f1b7c3545bf1613ac0494ec388",
|
||||
"anthropic/KnowledgeQA/claude-sonnet-4-6": "c00c494964632af431731f6fdf2ba4d697d42b8e58600e8a28e6a880ad6f0cda",
|
||||
"anthropic/KnowledgeQA/claude-sonnet-5": "57112aa6a5905f29ccb0030d75afa92defc8c40fe3c2923b7f6c75e73db1ccf5",
|
||||
"anthropic/KnowledgeQA/claude-sonnet-5-5": "6880da6922858ec485f07de03058393c68082059abd9c7c169adced9b5f386df",
|
||||
"azure_openai/Embedding/text-embedding-3snapshot": "0c2f547ad2206affe719f6f0775ee73574a4dda8a7993a699ee9c4e7d4983cab",
|
||||
"azure_openai/KnowledgeQA/gpt-4.1snapshot": "6b6e303e1e4ed32f972e8224ab090f835e63570543036912809fc6e2551f923c",
|
||||
"azure_openai/KnowledgeQA/gpt-4osnapshot": "69fab35e2db1fab9640c72ab3b0c7acae322a1d0758c61ade28bc39fb9f9f750",
|
||||
"azure_openai/KnowledgeQA/gpt-5": "db0a775a9c41d10b19d7707826820455e4b8f07cd5fbf9340f1329d97531d564",
|
||||
"azure_openai/KnowledgeQA/gpt-5-mini": "4b0569c209354289d80d9e897e199a0deb1e759b685e1f1f13d87b5a54aee4d6",
|
||||
"azure_openai/KnowledgeQA/gpt-5-nano": "362639f61878bf5dbe5c1f61172a7f617984014ef23e2d2183d0debebf17ba3d",
|
||||
"azure_openai/KnowledgeQA/gpt-5snapshot": "0212af206f4f3be585e5be378ae78d2a72e127dfd017b2ea3f0e31680377a15f",
|
||||
"azure_openai/KnowledgeQA/gpt-6snapshot": "32f322083e4d338bad9d46878e193be7914754a38771204a2ea110050b8fa655",
|
||||
"azure_openai/KnowledgeQA/o1snapshot": "932a1de3ec30ca2f61c26391d01e8053c167417818a347f1fff3968351992868",
|
||||
"azure_openai/KnowledgeQA/o3snapshot": "06838afe2bf35d03ad99cdceb6b088f272fa83aa4cc25d461d3b0ad034573066",
|
||||
"azure_openai/KnowledgeQA/o4snapshot": "5a234aaf785bf4b2835f8dbcc49b0f6ce886743ef6d429c68180ca247c9b5a3e",
|
||||
"cohere/Rerank/rerank-v3.5": "330a5f690caa4a82f03e0da50c8c84b18eeb7010b2af12cc6acbe0bdbcca0799",
|
||||
"cohere/Rerank/rerank-v4.0-fast": "be4565dc043f51aa21ca3117c6785ad5012cf8a3edbc83ed4c57e676cfc0b7a2",
|
||||
"cohere/Rerank/rerank-v4.0-pro": "71fc9aaab7c45cdd102331ccc3bb7d238d9cb23e7f72489bd395d94c7aff1f01",
|
||||
"deepseek/KnowledgeQA/deepseek-chat": "07512b23255f3d8ca9b19123617f7fecdf0da538b6d4c3ea7773ccc73a08be00",
|
||||
"deepseek/KnowledgeQA/deepseek-flash": "77d77b5c366570d4ba6e9b088c2690e8970e0284af7f5a6b4c114ff2024afdd3",
|
||||
"deepseek/KnowledgeQA/deepseek-reasoner": "0765764d483664d8df1d1fe2c708671a74eb355764cec3e7a3e1cfe0a1b6e89a",
|
||||
"deepseek/KnowledgeQA/deepseek-v4-flash": "a1d11bc227bae61b53cd3642d32c59affa715b2cdb73fc53995c6a0ad9977438",
|
||||
"deepseek/KnowledgeQA/deepseek-v4-pro": "5b245660012e5b1e4160861575244ecd1d0feb9b24a366d10cc58b4ae8257786",
|
||||
"gemini/Embedding/gemini-embedding-001": "2126e8863f9ba5d4cef4e0154c5b8ce8579dddd7d8aeb674bb74632b6294a7dd",
|
||||
"gemini/Embedding/gemini-embedding-2": "d79dee9bc056de3bc95e90877eebcb8846edf967e4555028d72a2e5694d8188a",
|
||||
"gemini/Embedding/gemini-embedding-2-preview": "f45ec78e4183dbc342640f9754a59a6a48144a67564cf17a3c68567c8e0dcfa2",
|
||||
"gemini/KnowledgeQA/gemini-2.5-flash": "8fd1fd7205b512d2e7c506f171d4cf09f77e7c1f08d327942e42a63dd6a10560",
|
||||
"gemini/KnowledgeQA/gemini-2.5-flash-lite": "04688ec4b28a2ffc5afd5fa501b6ea144c3ee519badcbb36d82b61d44a25dd17",
|
||||
"gemini/KnowledgeQA/gemini-2.5-pro": "6929d8015b51e7326d9de5f333408b7abe91c23f87623af4f4434a78a6cbbaa2",
|
||||
"gemini/KnowledgeQA/gemini-3-flash-preview": "b2f619cdd5fbcd2202198be74c9215b1998e3e428cd46f7c38a38dceeee36542",
|
||||
"gemini/KnowledgeQA/gemini-3.1-flash-lite": "c8a1e2b17e829616366e2ad52cfb2e331c6e62e6c9682150da6ec5a0ebb94604",
|
||||
"gemini/KnowledgeQA/gemini-3.1-pro-preview": "53ce7edd9dc46112991f6ea1746dc419abcfad267c694db8d461fdd9a4275177",
|
||||
"gemini/KnowledgeQA/gemini-3.5-flash": "2abcc9d6223b140d31e73c4ea63f9f25b9728c6bea9dcfd4bc1e7ec96d985a96",
|
||||
"gemini/KnowledgeQA/gemini-3.5-flash-lite": "9c9815ef99aab3ab91926ecd8e0586598dde2737fe533d43d70c839bddd62521",
|
||||
"gemini/KnowledgeQA/gemini-3.6-flash": "8be4820a9da0c156cad0684936bb3c6f1ae0833065cb45952f8d0027a5eb1fee",
|
||||
"gemini/KnowledgeQA/gemini-3.7-flash": "570b30391590c3fa380e98e8323bf2187635d18db427eae3d75f9e63def26c8d",
|
||||
"gemini/KnowledgeQA/gemini-3.8-flash": "6d40802ed8d3b310e1e91c186f769a4f8a298138538853cf623ad43e59c29140",
|
||||
"gemini/KnowledgeQA/gemini-3snapshot": "c5931f2304774b718637f47540e78b66cbf855b4a4189c9fc0cea2040a12951d",
|
||||
"generic/Embedding/WeMM-Embedding-2B": "8b6d496d4e145cebe75c192377b9a428be2b049fb23419b07e2f4ed766ee744d",
|
||||
"generic/Embedding/WeMM-Embedding-4B": "d1a6ae0fbde3a9828d6392069aef8707817061b553cfc871b2f5432a460b6e83",
|
||||
"generic/Embedding/WeMM-Embedding-9B": "aa6fce5495ec995031fb677c0396671b79864ab099587ac6cbc3fa52c0868e39",
|
||||
"generic/Embedding/snapshot/WeMM-Embedding-2B": "4832569c35ef95ad39fc75e903fa3a860127c373e06670148301dffbaaf65294",
|
||||
"generic/Embedding/snapshot/WeMM-Embedding-4B": "39c3cfdf00aacdcd443309ae6d4940a0ec16300d52aa1944460feae0174353bd",
|
||||
"generic/Embedding/snapshot/WeMM-Embedding-9B": "ad2407f2bedd74df45f4cc2debe4a8f44be7c9bf138d1228c55924c477ea9a61",
|
||||
"generic/Embedding/snapshotqwen3-vl-embeddingsnapshot": "a1dedaaddb23ad1449d1aef38f0f032d7bcd834bdf079c511c65ec03cccfffe4",
|
||||
"generic/Embedding/tencent/WeMM-Embedding-2B": "54141d358d96ea836ce5a0ede691db0e5dff87cf7d33319a4a59d17a0c1ce0c4",
|
||||
"generic/Embedding/tencent/WeMM-Embedding-4B": "0dd3bbf5caadcd0c230f5bece1aff09e6ccf6180b095c785244580936aeec68b",
|
||||
"generic/Embedding/tencent/WeMM-Embedding-9B": "7176482974a360aa14a1e97dc2e7b508b3ec2526d6f38acbf7f2bf4de595b2d3",
|
||||
"generic/KnowledgeQA/gpt-5snapshot": "3e3712264316db008c1465a2d7c395072d85942d0352196e456342cef0b14eb0",
|
||||
"generic/KnowledgeQA/o1snapshot": "52340886b4160a0cb9342ae33a7c81304c9dad5d22c2d1c1ce073f89860a30b1",
|
||||
"generic/KnowledgeQA/o3snapshot": "782e836769e56c43d9c954ab2d563df7d2f476ae4fb4d588bb8bf3c88ae42ce6",
|
||||
"generic/KnowledgeQA/o4snapshot": "dc652fe264d2c9bde369307bc48e8136ba92a5d31a54676374560ba878f2190a",
|
||||
"hunyuan/Embedding/hunyuan-embedding": "8f8dff4309455e2bb4566768b6d335b34359a7d6aa5253eb11f3b59d16517c5a",
|
||||
"hunyuan/KnowledgeQA/hunyuan-2.0-instruct-20251111": "1a634287a65c3317056937c9e9e35e28ae79e326f1910ee0f331618fc076acb9",
|
||||
"hunyuan/KnowledgeQA/hunyuan-2.0-thinking-20251109": "1e982bc103cfc5830b0634a9b1a44a1a33bece3647606c712016c89ea17af467",
|
||||
"hunyuan/KnowledgeQA/hunyuan-a13b": "615fcf75935e1b842cbfaf188d212546dd3a5450f1a850c7c7c269f3b3263dab",
|
||||
"hunyuan/KnowledgeQA/hunyuan-lite": "c2a18cc8c2fecd9f807dc0a746c287c3a111bc0fe68453806fcd511c388f48e9",
|
||||
"hunyuan/KnowledgeQA/hunyuan-t1-latest": "6b5be11d928cb578f87ad8fb151dabc2b41f9882e0eec5c2bbbdc63c8a9d4aac",
|
||||
"hunyuan/KnowledgeQA/hunyuan-t1-vision-20250916": "edfac3f8a8a9b5f32852f4669b9cc13f3c8d326a3ab5f01008135b474853e5dc",
|
||||
"hunyuan/KnowledgeQA/hunyuan-t1snapshot": "6d8d26d354fc6540e269a51d5a2e1108520e0c08133ca38f78d459ba0691770a",
|
||||
"hunyuan/KnowledgeQA/hunyuan-turbos-latest": "e0c9996172983b9d47994f073438aea931bdd995b7794c84eae745502afb3466",
|
||||
"hunyuan/KnowledgeQA/hunyuan-turbos-vision": "de1994d9055a856578b34082829c6de1728633d1e7e664b02b993131797f1291",
|
||||
"hunyuan/KnowledgeQA/hunyuan-turbos-vision-video": "07d35ec30279d336e39257ff80f558dd69ffa1c3e865a34a1585f2a261aad640",
|
||||
"hunyuan/KnowledgeQA/hunyuan-vision-1.5-instruct": "eb831ff45f66229ed468214ad2c40cd89e07d60021ee79685ff58d8cc68421e9",
|
||||
"jina/Embedding/jina-code-embeddings-0.5b": "9775240b72e8ba4a05e8847f9ebcbbb254c988c756783b883f6cba293fdc89f9",
|
||||
"jina/Embedding/jina-code-embeddings-1.5b": "d5c3d65b861352b2324a19224ee5712f84c9347b4e89d3a51ba0f2c88abf9f03",
|
||||
"jina/Embedding/jina-embeddings-v3": "3af8aeb042e5a2727fe9497c70c53399036fa16ebc349660ce69ea4e9a48953f",
|
||||
"jina/Embedding/jina-embeddings-v4": "b76a9b00b360adfbdfa1f98cd068f725f3f2beb0c48da71bcaaefcf0a2d9c59d",
|
||||
"jina/Embedding/jina-embeddings-v5-omni-nano": "93af28d6a431cd3fe9f937a121f2f8912491df57e218c43d21c1b387b9bd0587",
|
||||
"jina/Embedding/jina-embeddings-v5-omni-small": "e93d92bed96c1a3b810ea93502fb4fdd02f7299e1c43d97e9c197f7883c4dc38",
|
||||
"jina/Embedding/jina-embeddings-v5-text-nano": "efa8aa5e980a90db2f510dc005a1e573f059f97157209cd34880998007a72ad9",
|
||||
"jina/Embedding/jina-embeddings-v5-text-small": "4ef8c82f495ba94c28010ec54e8317e201ce3e9c1bf73a8911f49eb20889f138",
|
||||
"jina/Rerank/jina-reranker-m0": "61ad7916e3ca1755527abbec0dc06aeb48098680a47fe0e18bbff4f0282f4d02",
|
||||
"jina/Rerank/jina-reranker-v2-base-multilingual": "59e17bfbaffec4d58b53c8173cc0fcd3175367f79e217eea48a90189d35f70dc",
|
||||
"jina/Rerank/jina-reranker-v3": "fe222e6a40c638e2a7d058505317f64798e326c5672d4d0673bbb5cb12c04494",
|
||||
"jina/Rerank/jina-reranker-v3.5": "92afd3493e58691ca7a5fc969925c1347975d45023307bb281a7e78ade0124c1",
|
||||
"lkeap/KnowledgeQA/deepseek-r1": "910b88dd40f5445e1cb93d4f1f75d0a918b6c2cbbfb2f6dd626486cfc30a01af",
|
||||
"lkeap/KnowledgeQA/deepseek-r1-0528": "e29f4d275bd351a9cba4dd109a13c70326403c50eedc630ef8c3d6be4c6b380d",
|
||||
"lkeap/KnowledgeQA/deepseek-v3": "1d95b0fcec9e157382300ff255b002fb81073020f1d857b47ddff7c8c0cc6899",
|
||||
"lkeap/KnowledgeQA/deepseek-v3-0324": "5d66cc4e847187520a51e6976edc2dceb11f1ef1ceb3bbc35b1c5f337e2a1f58",
|
||||
"lkeap/KnowledgeQA/deepseek-v3.1": "b51473160f3d344f85d5e0ae45ac6f1db7343781aea471c4a9c7ddd72dbc1e5d",
|
||||
"lkeap/KnowledgeQA/deepseek-v3.1-terminus": "6cd662bc9e0fd9b7e51f63dd97552f991897339a1e28301c099ee67c3a13fbc7",
|
||||
"lkeap/KnowledgeQA/deepseek-v3.2": "3ac1f719fd185a24d899de8b0ab8bce08c55fdfaeaf4370e8084d80eb7841456",
|
||||
"lkeap/KnowledgeQA/snapshotdeepseek-r1snapshot": "5fe12a729af1576b4446cf21e2df7d06147d1213da0b15bec1058ff4236fdf66",
|
||||
"lkeap/KnowledgeQA/snapshotdeepseek-v3snapshot": "b488b275212bd6fb7543b43798aa30d5008a231d7cae749e06a2be3b469f5965",
|
||||
"lkeap/Rerank/lke-reranker-base": "6e8dcdc74c37d9cf8abd2c513dcd8e79d43d6fc52ddc3bb44a95b25a6a191f52",
|
||||
"longcat/KnowledgeQA/LongCat-2.0": "84748558b2d2dbdad28bfb9937d2cb8fd867cf6d6240f561eb4278b93f186b4a",
|
||||
"longcat/KnowledgeQA/LongCat-Flash-Chat": "7f27f6c3e463fe45a39144ca5e0ca934e1157c7251e695a9f470d66bb63c4afb",
|
||||
"longcat/KnowledgeQA/LongCat-Flash-Thinking": "30269a2c7037a4b928b0ea4164f9934f4dca117b03574de470e2d8053a8d661a",
|
||||
"mimo/ASR/mimo-v2.5-asr": "cfd5e7af20f9bea915399d1de654049880144fd3b16b46d38563b328545f7d53",
|
||||
"mimo/KnowledgeQA/mimo-v2-flash": "a1111e2792de419143f71c33230097b3d7e0e5b525c6e217713940f0a9e34246",
|
||||
"mimo/KnowledgeQA/mimo-v2.5": "a53a5bf889aa110e4460fed294a3230758ddaa49a6db60e8b0408fe183a60ed9",
|
||||
"mimo/KnowledgeQA/mimo-v2.5-pro": "3c38342327d6286db15a7548f651c2780d8b0998b2671d05f187781eb6a23262",
|
||||
"mimo/KnowledgeQA/mimo-v2.5-pro-ultraspeed": "a47aba2614020595d63accdc1c3c6058cfebdb3198df58936fb95e28c9046092",
|
||||
"minimax/ASR/asr-1.0": "1c51f1e261087dc295ca455f3f580ebd4e2af19b4dc520635729415f49ef4432",
|
||||
"minimax/KnowledgeQA/MiniMax-M2": "43bf0fa0d1325b5c52f046109c730d6c7549cb4a31696cae7119a68480802fe9",
|
||||
"minimax/KnowledgeQA/MiniMax-M2.1": "bd74e5923d0d12f7cd5d27cdc9ce7a03aea561fb932fbc2df7b9527f30a0b27e",
|
||||
"minimax/KnowledgeQA/MiniMax-M2.1-highspeed": "dcc02614ff25e6ec426f81e8c5bc8c1fb54fe15fc3c61bc952158cdc5605b7a1",
|
||||
"minimax/KnowledgeQA/MiniMax-M2.5": "12e81e74ad422b52aab382584e0e329d28f5e6f97f9fa517a16c63b448f46156",
|
||||
"minimax/KnowledgeQA/MiniMax-M2.5-highspeed": "6b87c598fcfcb674dbe600ef19f30b518af8b6c6ba959d84ecbd02542eee3c12",
|
||||
"minimax/KnowledgeQA/MiniMax-M2.7": "3f6c046bb99022ee88f3c99f3f9e7e75ecfabaad6f97a601352297ec33ffadde",
|
||||
"minimax/KnowledgeQA/MiniMax-M2.7-highspeed": "bc4a3116243b4dd2a4b764db9fa8155f8262ab4a05a34cc1e8b6bcc2e17cde72",
|
||||
"minimax/KnowledgeQA/MiniMax-M3": "153a02aafdcdfbd115c5e1fd6b5f03b145dfe22e13cf2641dc9f52722ac4ca98",
|
||||
"modelscope/Embedding/Qwen/Qwen3-Embedding-0.6B": "a4515af27268a360fe7ee62eb4c4785bc5e3079f65e0264acc99ba974b9a777b",
|
||||
"modelscope/Embedding/Qwen/Qwen3-Embedding-8B": "a76960f74528a100af92aad4def93306da5eb819ba8fc916693197d779f0ebd2",
|
||||
"modelscope/KnowledgeQA/Qwen/Qwen3-235B-A22B-Instruct-2507": "cbd8290913b5b1a584aaa9cd20ccb6478b67c62a73d9aa3f9f9c5aee0baf7d80",
|
||||
"modelscope/KnowledgeQA/Qwen/Qwen3-235B-A22B-Thinking-2507": "35599fb7d339e43401eed51973c8f67f2440c40e96c4dfdcdb6f0393d39163be",
|
||||
"modelscope/KnowledgeQA/Qwen/Qwen3-30B-A3B-Instruct-2507": "de63c30b559ee1b70d214465c67091c8892ed30e1213b1df7bbe06d22c4a31d5",
|
||||
"modelscope/KnowledgeQA/Qwen/Qwen3-30B-A3B-Thinking-2507": "e2e2b90ca7a7178d660a86796a671d9ca05311b13b5c3d10a914a33249de0e77",
|
||||
"modelscope/KnowledgeQA/Qwen/Qwen3-8B": "d9650153601f0e158e9799a2da4059925251959366d6bd511878c8c02ac49de2",
|
||||
"modelscope/KnowledgeQA/Qwen/Qwen3-Coder-30B-A3B-Instruct": "54874cdaf43b7b91c520b7db9e33bf45cf7ae64aa2fece00c9d0d4c14e8c8bbe",
|
||||
"modelscope/KnowledgeQA/Qwen/Qwen3-VL-235B-A22B-Instruct": "3fae347f784339e772be3d18d13182822ef2d16581ee4e2a588f5dc573945146",
|
||||
"modelscope/KnowledgeQA/ZhipuAI/GLM-4.5": "4c3824594e8801642e459a728ef3d786fddf5ae9b7cad658f3ca868834d98d8f",
|
||||
"modelscope/KnowledgeQA/ZhipuAI/GLM-4.6": "3c7c2713d06b22fef0cb7c4ca002c9d14049abf37be9750716d403e64caca607",
|
||||
"moonshot/KnowledgeQA/kimi-k2-thinking": "78e9accc9b580b7b4ddfe804b6d234912d906e5b84098db9378743a933d653fa",
|
||||
"moonshot/KnowledgeQA/kimi-k2-turbo-preview": "eef0bbc6a30c62c3125ea3bec013c99ce23c135e00be532ebf69f10946e2d197",
|
||||
"moonshot/KnowledgeQA/kimi-k2.5": "dd37529bc898f32b26c1261396b9bd5461ddc36da08b43743185a9af4551555f",
|
||||
"moonshot/KnowledgeQA/kimi-k2.6": "6a6e887f73fc5abcbe313c9ce5f15206f605b2f2f713c11acce3d720f8ba4c50",
|
||||
"moonshot/KnowledgeQA/kimi-k2.7-code": "e010d8cac56af5fdd145466dd229bbc3b21ce7120dd2840df7a79599dd51126b",
|
||||
"moonshot/KnowledgeQA/kimi-k2.7-code-highspeed": "2f6a58da0d422895eb49a1e2a85ef3ad1c25569c83ab6e08425a03ce39c08fff",
|
||||
"moonshot/KnowledgeQA/kimi-k3": "d762c5e5af93b109df5ea421866ccb260f819a12768cb19e88f708ed39bc6e06",
|
||||
"moonshot/KnowledgeQA/moonshot-v1-128k": "a083f7226a9ef76bd048db7852bfe263c8f080b5725b1dc0b99257ae3841ffb8",
|
||||
"moonshot/KnowledgeQA/moonshot-v1-32k": "ba0dcd86e11bbcec03725d605d6a50ce308d5f6682fd9522b101a7ef81f2f709",
|
||||
"moonshot/KnowledgeQA/moonshot-v1-8k": "118b5c3533abac97b6f364a3341d599856c5724842ccd809de6a27e7d78a9a5b",
|
||||
"moonshot/KnowledgeQA/moonshot-v1-8k-vision-preview": "dfce889dafa16367941825e7e496b2ba542c0f950d796d30e60bc611ee20ea55",
|
||||
"moonshot/KnowledgeQA/moonshot-v1snapshot": "ad805e8b2951004069afc16305e6dd5d24570bce9454fff41da4c89b0b552e8a",
|
||||
"novita/Embedding/baai/bge-m3": "ead230cee65e288b3f8f1befb4cfb39dddf581528bb617a46feaa76e0454faab",
|
||||
"novita/Embedding/qwen/qwen3-embedding-0.6b": "fd7fe2850e9f193d11bb27f1130bb325b95d95156c879f770c6e303599298e2e",
|
||||
"novita/Embedding/qwen/qwen3-embedding-8b": "870036141aea257889436fc43fef077f91ca92451c5c78cd14fcb10697bbe7be",
|
||||
"novita/KnowledgeQA/deepseek/deepseek-v4-flash": "46882c5a6f42c8c50189bd311fcd34e0f19e073006d94c403f7f7a0d130fb981",
|
||||
"novita/KnowledgeQA/deepseek/deepseek-v4-pro": "202e557b0ae3ec4cc2647b9c362ff0b8cb36d381d296ba5cf74bc1a3df8c7095",
|
||||
"novita/KnowledgeQA/google/gemma-4-31b-it": "3302698feace987ec23fad14ade2b771eef6cc60830baab3c93f0341994a475a",
|
||||
"novita/KnowledgeQA/minimax/minimax-m2.7": "d46d5b8360a5d7d6a7c81750234fcde3bbff8a308368b85d098d7a5afec27795",
|
||||
"novita/KnowledgeQA/moonshotai/kimi-k2.6": "1db1fe6b65cfb73ad60ee112020f7a44bf1d74b0bc5177ad49b1af5d19526811",
|
||||
"novita/KnowledgeQA/moonshotai/kimi-k2.7-code": "4c84bb9463ccec60043eb6a1682f85b2de44e3257aeb6bae036b3de4bc3f6ee9",
|
||||
"novita/KnowledgeQA/moonshotai/kimi-k3": "a4a9490695fab439e2ff3bbc428b3632cd6e1a2661c7664c76d86b0455c5ac30",
|
||||
"novita/KnowledgeQA/qwen/qwen3.5-397b-a17b": "7d73f0dfcf6597fa8d885a7b23cfbc3dee5cf2999e8787c490da7d3e2d27ae07",
|
||||
"novita/KnowledgeQA/qwen/qwen3.7-max": "e9ba323773ced5ebf841c3f58d68836a9123faa00ef6c307886f66d03c727ded",
|
||||
"novita/KnowledgeQA/xiaomimimo/mimo-v2.5-pro": "c5af6bb090696d50afb7564d863e05e62d889f285eb385e676e2d3bf5064ae79",
|
||||
"novita/KnowledgeQA/zai-org/glm-5.1": "f5e07a2348ba716a0c6fca88f9233bb591e38ba893290085a57098e94d0a90e2",
|
||||
"novita/KnowledgeQA/zai-org/glm-5.2": "5801f0529d010aa9d60e4fbbb00be0ab90103fb241361daf03f9b81fc4975af5",
|
||||
"nvidia/Embedding/nvidia/nemotron-3-embed-1b": "d5117e8e9b70279b2bd66152840f6c6421e79cdc953b76f8227573e9763f8216",
|
||||
"nvidia/KnowledgeQA/deepseek-ai/deepseek-v4-flash-0731": "f2c975c6dc38d31fc297c847c0d4c82173dac24252886b4c91ae8ea3bad87bae",
|
||||
"nvidia/KnowledgeQA/deepseek-ai/deepseek-v4-pro-0813": "ab2c7147362fba415f417037e4cc9a55c851613cb5febe1adc6867c9d8d68814",
|
||||
"nvidia/KnowledgeQA/google/gemma-4-31b-it": "2d9d31c3f69fedbf720aac946e6ef7226280ee2d9cd11e2f41cb1f8a8ab05f3d",
|
||||
"nvidia/KnowledgeQA/moonshotai/kimi-k2.6": "a62ebedfac75c0cd21a02ea11dfe6a3f7c021c0a055338268122174385cdf63d",
|
||||
"nvidia/KnowledgeQA/moonshotai/kimi-k3": "26588e04850c35ef81c921daa4577ad50680cdd94570a795c2b0a26558c797b7",
|
||||
"nvidia/KnowledgeQA/nvidia/nemotron-3-super-120b-a12b": "c0b0e182881bb1cae1d5e09edf0b18008ff84e766e71bf7f21540f77d3083aa6",
|
||||
"nvidia/KnowledgeQA/nvidia/nemotron-3-ultra-550b-a55b": "16a998db79f88f0014802d020cc38cb7819e4c961964c1cb358cf698e3ca43c0",
|
||||
"nvidia/KnowledgeQA/nvidia/nemotron-3.5-lightning-30b-a3b": "0b58b353733a2aa6c6254a31dd4b75e36eeaeb50fd87c79f89719db826c91766",
|
||||
"nvidia/KnowledgeQA/z-ai/glm-5.3": "5b2cc061f54a17df95cdf53e359faab697869a6ddfb24c945aa7823577795c3f",
|
||||
"nvidia/Rerank/nvidia/llama-nemotron-rerank-vl-1b-v2": "2081699b82747e6244943c1875d8a0b7bd6f755d41d65a63d4ed175c0bb9728b",
|
||||
"nvidia/Rerank/nvidia/nv-rerankqa-mistral-4b-v3": "581df5ca9633492a7cd9caeeb27a25cfbac0d15098403ae5895a5a6e4c4295d7",
|
||||
"openai/ASR/gpt-4o-mini-transcribe": "ce0044f799b08a1524971126a2881e0a0f830d26cc44f141f93f944ac55eee8b",
|
||||
"openai/ASR/gpt-4o-transcribe": "3e533c7d02be1039d0316d2c4968ce73052240248baa096c1df5cabf713692e9",
|
||||
"openai/ASR/gpt-transcribe": "540a1ae5b477a4f73d9c2269bb3ec2b7f95459995140517987ae5f76e68b6899",
|
||||
"openai/ASR/whisper-1": "0636eb35239490f9e8e6a1d3fee44b9826a391e021e85aed7072c33fdcf2218c",
|
||||
"openai/Embedding/text-embedding-3-large": "3c14fc11141e7f473040fefb14ba5595e1dcb193e970b4480554935d1c118435",
|
||||
"openai/Embedding/text-embedding-3-small": "96dba6192448cf2a6e6b1aff646bd5be063e49fdea64b277555f4b5297b4560b",
|
||||
"openai/Embedding/text-embedding-ada-002": "410188713299a54711ca75e6d82c950d45e506602a71ec1dfbea298460a78d94",
|
||||
"openai/KnowledgeQA/gpt-4.1": "2c2025b04be58eb7dbb846ff5aa3098db2d4e0e556f5ae04a0727ed5ee122ed7",
|
||||
"openai/KnowledgeQA/gpt-4.1-mini": "6cd397454d5b4ff738b14c93c58bab88a447904da3332d8fa35aa9e137e1eec1",
|
||||
"openai/KnowledgeQA/gpt-4o": "49267acbe5769cff75edff28caa8880e23d7465d3381c13f6464fcf41cd11ceb",
|
||||
"openai/KnowledgeQA/gpt-4o-2024-08-06": "d2b5c47db996452cc672c75388b25da1462a60f302389d95029d50555e2bc95d",
|
||||
"openai/KnowledgeQA/gpt-4o-2024-11-20": "78c808e3cc9659ab1d27efd829e12313a8f7bf8e587ed856a2d85ae182d68921",
|
||||
"openai/KnowledgeQA/gpt-4o-mini": "39176c7bf6c81072957a5955c1804a75ffcfbb3cda03cbfb40ee15389927218b",
|
||||
"openai/KnowledgeQA/gpt-5": "1b8a325e646c0251225a1d83099eb67544dfd637e6fbe4489ea0399e59174ddb",
|
||||
"openai/KnowledgeQA/gpt-5-mini": "687e595b4d87b87a62230103fe10895e131795eef2c83e5a69daddfaea36dd02",
|
||||
"openai/KnowledgeQA/gpt-5-nano": "c0802166ccd659d2078118320182b73c6d6f3137f68838a15271e905e3e28ee5",
|
||||
"openai/KnowledgeQA/gpt-5.1": "a655f01773da62bb4dff4c26e6880465e83816e976a17052c26940068fdd5cee",
|
||||
"openai/KnowledgeQA/gpt-5.2": "37ed13fbd98481774ed42a462ee36f07d46776ff762e79cc63d37f80d6c8d31a",
|
||||
"openai/KnowledgeQA/gpt-5.4": "a4e18227d5b5bb6ba2ed085f36fdbd2d870abf6f2d43a253cb893eb34675661b",
|
||||
"openai/KnowledgeQA/gpt-5.4-mini": "2b491f50798d8ad85dadb59e9d9afb731ded5fee2b7479060e34e2749e5f3f63",
|
||||
"openai/KnowledgeQA/gpt-5.4-nano": "435903825985472fe57ad84d74233eb0f8cde613134e0da1c7c1d3e91072bdea",
|
||||
"openai/KnowledgeQA/gpt-5.5": "2ec73f0f32e00993d395a02f62b53873f010991423400a59c1388d9759cabc29",
|
||||
"openai/KnowledgeQA/gpt-5.6": "f3ae64cf2bb8b366c5355b96f3417a0f1b5c033aec57489bc9ea091b0a3906d0",
|
||||
"openai/KnowledgeQA/gpt-5.6-luna": "315609c50a9598f6a9ae0411ed2aba39946fe6be868b06cb7177516cad28706b",
|
||||
"openai/KnowledgeQA/gpt-5.6-sol": "6646d9a8463b8dcc13d84a53cd16deb84613c132c480378e3f243b83df01ef19",
|
||||
"openai/KnowledgeQA/gpt-5.6-terra": "ee33f16f0630b8c7f23a64c724267fcb5d794dfc523a6ab38e20a48d4447b515",
|
||||
"openai/KnowledgeQA/gpt-5snapshot": "fc10abaa4f5b71bf2c4c46624109ed99d5c0ddc196517803d0cdf68ef92a9448",
|
||||
"openai/KnowledgeQA/gpt-6-astra": "1a4d4e1be37f472307da3af52dd6db448da7bed568fedf3086e548303fb460cf",
|
||||
"openai/KnowledgeQA/gpt-6snapshot": "75e800414ec7df086c55eaf36509de26a5f6ed000f0e38d2520191a4176c3ad7",
|
||||
"openai/KnowledgeQA/o1snapshot": "dcc4cb93570f7fcd128679b692a27e2cc6e6ea38f37f2e7ad9ce6e28ac6749e8",
|
||||
"openai/KnowledgeQA/o3": "39cf8e5211e93dae65a14f9c6c5a76172844266690c4f448e5eb401bcd766572",
|
||||
"openai/KnowledgeQA/o3snapshot": "d875433d0f7897c01785b510381144f43dbc835249963e5f9b16ee3130068c68",
|
||||
"openai/KnowledgeQA/o4snapshot": "82910c522ac0b0d023f995a3672647c73e533b1992f79d4e597c11a8d53189a6",
|
||||
"openrouter/ASR/openai/whisper-large-v3": "18d077ef76d17cb51b3dadc18b570b40f2da916572c0196f7435d2728c3027f7",
|
||||
"openrouter/Embedding/openai/text-embedding-3-large": "18f651405d3a854813dd5938ce8c8ffefbc8f3e68ac64057335c1d6d1a382b62",
|
||||
"openrouter/Embedding/openai/text-embedding-3-small": "f16558abafbe7e1980542efd23ccd8bc215802e5a35444422ba948a02c59538d",
|
||||
"openrouter/KnowledgeQA/anthropic/claude-opus-5": "b410f7a28577fb2b8ec7845fbb9157dc44d2a51b287a825fade2722929c6fb7d",
|
||||
"openrouter/KnowledgeQA/anthropic/claude-sonnet-4.6": "d7d4e8a93c533bad68fa85c2accef5b10f08cabb382765ddea7799b06e8b5739",
|
||||
"openrouter/KnowledgeQA/anthropic/claude-sonnet-5": "7ebf34dfd7d017ac1fe6983b2191345fe96a1727619951a3426363a366b45f45",
|
||||
"openrouter/KnowledgeQA/anthropic/snapshot": "74ea9636e921fe17977b2915ba6397823abc6b23a43825b41e0b99612df38358",
|
||||
"openrouter/KnowledgeQA/deepseek/deepseek-v4-flash": "c25c357b6078af533e7a7fdd01ffed9d5ab83c6e589486d48bba184291a0e6b2",
|
||||
"openrouter/KnowledgeQA/deepseek/deepseek-v4-pro": "3f350e296e22a05eddca8737d11f637cfeb4c0ad245246fa510cdf2cd19a1980",
|
||||
"openrouter/KnowledgeQA/google/gemini-3.1-pro-preview": "1bba0aa89a00cd5fe8af7e76e93891ca4dd77281cd48414923afc95c9b4f0818",
|
||||
"openrouter/KnowledgeQA/google/gemini-3.8-flash": "e1f59cee98e945423b040c0bd2aa8ecf26780c0e70cd6a037b0b0aa0108ea475",
|
||||
"openrouter/KnowledgeQA/minimax/minimax-m3": "7fac4b6ec8518284aed9c74d66e0e243bec860a8a538d45cc03f5f7481b99cdb",
|
||||
"openrouter/KnowledgeQA/moonshotai/kimi-k3": "bf7e74b42760aa71c4423665f323d054d932ad5b1a59401857de1e2092fe6e36",
|
||||
"openrouter/KnowledgeQA/openai/gpt-5.4": "8a22de2014afc2a58312d2e5f965116ed19cbe0652246f8964d94993616c8e1c",
|
||||
"openrouter/KnowledgeQA/openai/gpt-5.5": "a9007fd1530e4f597ed152a3bf13a2921433557405c048952b07c17c6fbfba9a",
|
||||
"openrouter/KnowledgeQA/qwen/qwen3.7-max": "b875905a43449272a94f2339766bac4c4f9b5414c603b9c434b0e6a31b925fd3",
|
||||
"openrouter/KnowledgeQA/x-ai/grok-4.6": "b43bad43581cfc02bb2f7c8e56fbfea372edf6e4e6b1a34d15442efab0a0b0f4",
|
||||
"openrouter/KnowledgeQA/z-ai/glm-5.3": "d629d890b3e68a3e95a37d320390c60fe44019ff3bd80f9bb4bd897edcfa425c",
|
||||
"openrouter/Rerank/cohere/rerank-v3.5": "35f701fdcf196b6de1e71dc677dd3cdecf1a2a9b4fd71f08f2fb5cbc78601fc5",
|
||||
"pinecone/Rerank/bge-reranker-v2-m3": "b7e3f9e779e7aaf8176a248cdc02f839e1fb0e224e0b99f8571c4522d5a04b45",
|
||||
"pinecone/Rerank/pinecone-rerank-v0": "4edec140b7fb93c950ca8d6f8482e05f412b919e5269889d0919b60af6928835",
|
||||
"qianfan/Embedding/bge-large-zh": "121f5c8566989713874cba0044039f9e02cf53fe23db739709e122459b9a3fda",
|
||||
"qianfan/Embedding/embedding-v1": "cc6b2807cbedb3422ba1982e04cae952c7ddffbba2685e4b53f90774d56aeab0",
|
||||
"qianfan/Embedding/tao-8k": "af316a1f4b9f96f93088f52a3e7e4292b6e30b5aa6f49243830890f4f4043058",
|
||||
"qianfan/KnowledgeQA/deepseek-v3.2": "32ebceea751c46e99ec750d5301e17e3b50a29a9002eb61e3065c4a4dd14ea5b",
|
||||
"qianfan/KnowledgeQA/ernie-4.5-turbo-128k": "2fa61399541418ed8d8fbe5fd8ead2655baf8bc92ef20f6ff2d9d4884de2f396",
|
||||
"qianfan/KnowledgeQA/ernie-4.5-turbo-vl-32k": "134b57565beec32415b79eb070c74dbd5bd819f90488fd005a4b44e671189d56",
|
||||
"qianfan/KnowledgeQA/ernie-5.0-thinking-preview": "638accf53511978b7a01a6d5bc2f06407a1a60906540a44ce1fe1ea57d0a73e3",
|
||||
"qianfan/KnowledgeQA/ernie-x1-turbo-32k": "fcb41841b028c5e6199f277b2d3e1036260d3913a923f7eb8f5650467d8d49ef",
|
||||
"qianfan/Rerank/bce-reranker-base": "485e2639fccc993514e87c0dcf434cb24dd37284777302b78f88e9b45bb412a0",
|
||||
"qiniu/KnowledgeQA/deepseek-r1": "95d9f18f66374713e5f7265b7d571a70590369048ad5b58c5499cae2090dcc88",
|
||||
"qiniu/KnowledgeQA/deepseek-v3": "921365f0f3370f7870edbfd7720cd948f51e5aae95e3956f3f8d4f130176b964",
|
||||
"qiniu/KnowledgeQA/deepseek/deepseek-v3.2-251201": "f505852c2ef532a79b58577d489b152a80a8960565d86472bcc73c7ab9ddc58c",
|
||||
"qiniu/KnowledgeQA/doubao-seed-2.0-pro": "b25cada50048f5a77ca8f54b55696d2c5d38a2bbb795a6200704ac093691ae45",
|
||||
"qiniu/KnowledgeQA/minimax/minimax-m2.5": "6d3df233d5dfaa21a13e124795d57cca22a69f3dff91bbd83fed3b4a03fc4493",
|
||||
"qiniu/KnowledgeQA/moonshotai/kimi-k2.5": "108c5be046d8592d756e1ff40592b36af6dd0798fd5d1967b747e5e44427b426",
|
||||
"qiniu/KnowledgeQA/qwen3.5-397b-a17b": "187b4cef7195768aeae7bf5d949dd438ce9a4bc9d0e07da993f9548ba0584a19",
|
||||
"qiniu/KnowledgeQA/xiaomi/mimo-v2-flash": "845a64410036654c2e66e2665461ce2cb4aef29e4aecdb94cd42df072f63f5e7",
|
||||
"qiniu/KnowledgeQA/z-ai/glm-4.7": "50f155530873601913d3501ae5fdd8e02cd53e779d164d5e3e5983f9f72aa6d2",
|
||||
"qiniu/KnowledgeQA/z-ai/glm-5": "d9ea33c0add65f8a817e4fd688141c1082d6e42f26e2a4cf85761f081feec093",
|
||||
"requesty/ASR/openai/gpt-4o-mini-transcribe": "c0349aa7c2203860f357fd0e46450f27489e3d1ca6600635268cc847b1866bab",
|
||||
"requesty/ASR/openai/gpt-4o-transcribe": "4316875346e4271458d0e62e5037d53454da07386768de13f370ce6b4fc65e45",
|
||||
"requesty/ASR/openai/whisper-1": "778b91371b71032df8453c650f91bbc964f6560522577a4846b9f25c8945f48a",
|
||||
"requesty/KnowledgeQA/anthropic/claude-opus-5": "8356a41a7bd95135d2ddf12b4b2415b82b8dbbcce718d1e60d8de3db1c950687",
|
||||
"requesty/KnowledgeQA/anthropic/claude-sonnet-5": "a75f2e814e2a97a56258c93d0039a7d89496abc72bb52f1955ad660dd13858ac",
|
||||
"requesty/KnowledgeQA/deepseek/deepseek-v4-pro-0813": "fa7d14e1c3a15d18e25b86b4276a83f9299ca7a7e6b08ebe396c61c88dcf9f46",
|
||||
"requesty/KnowledgeQA/google/gemini-3.1-pro-preview": "5ae18bea9729e634d48bbd42f720f8b3ccd2f61a1d6fd2351d66ae0ec7e72c68",
|
||||
"requesty/KnowledgeQA/google/gemini-3.6-flash": "4a87ddc564934a9852b530f1e26049a5a621425f190d2e4b1d43d1b1b65a51d4",
|
||||
"requesty/KnowledgeQA/moonshot/kimi-k3": "96f37af49c144a446d9c4c7c65211e65689826a25d8c33e5db31f508cae637c0",
|
||||
"requesty/KnowledgeQA/openai/gpt-5.4": "6ca93580eedb4008adf37034d96f41230e7b4222c96dbcb22a857a2da9e9b0b3",
|
||||
"requesty/KnowledgeQA/openai/gpt-5.5": "253f766ef2d39c19ba8e0bb5cdffd2839a4be3de4cf5ae16e319d515a18697f1",
|
||||
"requesty/KnowledgeQA/openai/gpt-6-astra": "6f4c1566c3840c8b0ce6d96a98dd1c07fd79b1e2b9293d1a53873ce5a1b5a427",
|
||||
"requesty/KnowledgeQA/vertex/gemini-3.8-flash": "8fb9c557105405e4a8b20bf9fd857da65edd424d02c9fbc084fb7411c5fa9d3b",
|
||||
"requesty/KnowledgeQA/zai/glm-5.2": "055e7a4a4470f79a61e327423a0212b24f6ad79be04afbde3abc26eb65347bb6",
|
||||
"siliconflow/ASR/FunAudioLLM/SenseVoiceSmall": "88839578e8f7b051a3d7143f8d302709fe69ab9271b8e854d5b5d12efa172c8b",
|
||||
"siliconflow/ASR/TeleAI/TeleSpeechASR": "a4dca0f67155be24e0a868455c53651ef38ff2553a5d8c5dd35087731b1a66cd",
|
||||
"siliconflow/Embedding/BAAI/bge-m3": "9d87b5170939e61d952b96f7dcffc56ea414b1ff59c0592a3e42dc826fda441c",
|
||||
"siliconflow/Embedding/Qwen/Qwen3-Embedding-0.6B": "b55351b9b00e746f4b383ae0c065c8e3c2a906273297f081d7e35a5a7e04f0ba",
|
||||
"siliconflow/Embedding/Qwen/Qwen3-Embedding-4B": "8aa441fee0aade229c25c57db8b0c93303f2d53d1102d57b939131c3c0a983a0",
|
||||
"siliconflow/Embedding/Qwen/Qwen3-Embedding-8B": "f3a6805f2883d3a193d13148ab9ca0aa182de4ec11f3007a4fd78702aa0b21bf",
|
||||
"siliconflow/KnowledgeQA/Pro/MiniMaxAI/MiniMax-M2.5": "700781182ca8df30b8cfdad4180fd36e2bfaae0da63ade30a1d10b5488fe2db9",
|
||||
"siliconflow/KnowledgeQA/Pro/deepseek-ai/DeepSeek-V4snapshot": "292817da83beca2f7fa60e9eeae633269f6d8e018032c02d7166b80b9120f5d6",
|
||||
"siliconflow/KnowledgeQA/Pro/moonshotai/Kimi-K2.5": "34d25f8f2758edefe777c7a89cd912afe8dcc6ec9d291847efda649f56656cd1",
|
||||
"siliconflow/KnowledgeQA/Pro/moonshotai/Kimi-K2.6": "1d65e2cb0cd8817f30ea1841b17f7c1688de2fb596cf886736e424128620889e",
|
||||
"siliconflow/KnowledgeQA/Pro/zai-org/GLM-5": "4549beb67deab651429c8385e206e7a256594a526c22d672a29c4c869d4b5755",
|
||||
"siliconflow/KnowledgeQA/Pro/zai-org/GLM-5.1": "9db6bed5330d09ee15dbc828a57e646da9abcdb3760004c51b5b7fbaa761ce59",
|
||||
"siliconflow/KnowledgeQA/Pro/zai-org/GLM-5.2": "ab9c0076ec579b6fe0b51f706128021b32f0b754b1fc62d913d7caeae7ed05fe",
|
||||
"siliconflow/KnowledgeQA/Qwen/Qwen3-VL-32B-Instruct": "35beda50dc06f2714574ee5a85b5e99ea0398e7eecd89ce663b510d1b101c242",
|
||||
"siliconflow/KnowledgeQA/Qwen/Qwen3.5-122B-A10B": "07db7c23527b82c43d9c85e6a341638dc856896417652fb5d15fd97e4c18d64a",
|
||||
"siliconflow/KnowledgeQA/Qwen/Qwen3.5-35B-A3B": "9a35f5c89b6ffeb6f1c2f2f524f393075f03e30eca264a99f03825007704499d",
|
||||
"siliconflow/KnowledgeQA/Qwen/Qwen3.5-397B-A17B": "852f2b573c9a7710fcba19662fca908de01b8a9e197eed500075e25feae18d4c",
|
||||
"siliconflow/KnowledgeQA/Qwen/Qwen3.6-35B-A3B": "46e2a4b78ef2f4ad61ae4cc4cf464434ca589333e6c03440819b2d93c7f0e834",
|
||||
"siliconflow/KnowledgeQA/deepseek-ai/DeepSeek-V3.2": "a8717568360641fc17238d588c9e5457e8be46c26377b6b3825b34c1002b4bbe",
|
||||
"siliconflow/KnowledgeQA/deepseek-ai/DeepSeek-V4-Flash": "0359b123c902a072e6b7f00ce62500745f9b7e68be0fdb4c96cb7ff1746dca46",
|
||||
"siliconflow/KnowledgeQA/deepseek-ai/DeepSeek-V4-Pro": "727f889e46c372bad78b32249a7adc3a32ed83191252c27477849785b4968cf0",
|
||||
"siliconflow/KnowledgeQA/deepseek-ai/DeepSeek-V4snapshot": "724ec881791b35536279abfc42f4ff466401032433d160c3ba3205bb2b921178",
|
||||
"siliconflow/KnowledgeQA/zai-org/GLM-5.2": "acce2ad2d6d1987c4702c00418bac6e441d0194fd7e8c12c9abee0141ac0f743",
|
||||
"siliconflow/Rerank/BAAI/bge-reranker-v2-m3": "471d9660cd6219c98941f7aec09ef68a17a5191a2350bea872d235098e4a1c1e",
|
||||
"siliconflow/Rerank/Qwen/Qwen3-Reranker-8B": "712284e5eef89f522e30c96bba18d019d0c48703adb2dc0fc1239aa55d582d49",
|
||||
"volcengine/Embedding/doubao-embedding-large-textsnapshot": "44d79d19f14506e75d7b9144907ffe70c3eb3110e07470362264022866ce104e",
|
||||
"volcengine/Embedding/doubao-embedding-textsnapshot": "e522020c10b4d3962869cd0bdfa42f845ca60cf2d1862f06ecb725d67386f32a",
|
||||
"volcengine/Embedding/doubao-embedding-vision-250615": "6e447d353627e2f90da5ce3bf6458f73c7caf796210ebdee28af0497b77bc66f",
|
||||
"volcengine/Embedding/doubao-embedding-vision-251215": "d0bd4b44b168a1422272a923739dd396af5d220c53d1c8f831f34478e3dc1d1b",
|
||||
"volcengine/KnowledgeQA/deepseek-v4-1-flash-260910": "da798ebd4b75f0cac486e0c13b7b944db5e72119d70cb95749ea9a7546c8694b",
|
||||
"volcengine/KnowledgeQA/deepseek-v4-flash-ga-260731": "a5150f406c1a4889c3488cc113f14a55e55fbc67ad254e00f3e7919b3d6ea04d",
|
||||
"volcengine/KnowledgeQA/deepseek-v4-pro-ga-260813": "0bfe115ffe3d5837228188d4c94c34d58f374b4dd9c9c70106f0717ad335b456",
|
||||
"volcengine/KnowledgeQA/doubao-seed-1-6-251015": "41c2fe8ba6b42ec7961fdd2e1f6a4f27258d6d21e1f1fdf1d94c00201f347b8d",
|
||||
"volcengine/KnowledgeQA/doubao-seed-1-6-flash-250828": "e4b5567cd833190f9b87f8832d2a55554f0ae642acef6e8cd6f29f15cd875e0b",
|
||||
"volcengine/KnowledgeQA/doubao-seed-1-6-vision-250815": "9637b628a6c8ebd56d2fa5cf867bcbf70f16016961167ec269074e257b6d648d",
|
||||
"volcengine/KnowledgeQA/doubao-seed-1-8-251228": "342c5c259199ba362e65940a93a11a518c9c360fa3866f1ebe75549a996e46f6",
|
||||
"volcengine/KnowledgeQA/doubao-seed-2-0-code-preview-260215": "2e708cad82ed46e174bb0e21a72f131746f1d1bdbda3ffe62f6e7a00da18429f",
|
||||
"volcengine/KnowledgeQA/doubao-seed-2-0-lite-260428": "0730f665ae74ede933c04820e4616618b50eca760b87ccaccfeffe19e56ef07f",
|
||||
"volcengine/KnowledgeQA/doubao-seed-2-0-mini-260428": "b9a472f9abeaec9df800bad8b464527797e0c3b60203ca2565fd18e7e94c10ad",
|
||||
"volcengine/KnowledgeQA/doubao-seed-2-0-pro-260215": "bd0e1f3043f453477d4aeb1d74ee101f5fa7d9c14563404380ac30d42a0104fb",
|
||||
"volcengine/KnowledgeQA/doubao-seed-2-1-pro-260628": "c401fe36c486bb0bde15dbadda5f66d1095e83a4954afc3dc3567534fceae58c",
|
||||
"volcengine/KnowledgeQA/doubao-seed-2-1-pro-260915": "abea45c2694f8eb2e36dc4ed7e53643b89e09dde68e7fc89fe6149e2d9d8d56b",
|
||||
"volcengine/KnowledgeQA/doubao-seed-2-1-turbo-260628": "7a15c04ee6d70612fbfbf80cfff77507bd101ff3b9f22df1ee286fa734dd0476",
|
||||
"volcengine/KnowledgeQA/glm-5-2-260617": "e5207931dafd7edbc947999ff780a34d20867caa28772b6b10715ace4312f22a",
|
||||
"volcengine/KnowledgeQA/glm-5-3-flash-260828": "ca9bd13d9c86d2463efeb07ad414515a1f0cd7ab8dbe2173e5cc939f034e8577",
|
||||
"volcengine/Rerank/base-multilingual-rerank": "fa578e2a39ad622b50452c4d04ae9612ad5279c9abfe1df86143aacbae70820a",
|
||||
"volcengine/Rerank/doubao-seed-rerank": "2d26d34faf9c3d7a69302cfdd28c7e7162fe1ceb8060a507582724a5368f493f",
|
||||
"zhipu/ASR/glm-asr-2512": "58e487f13624e4ef38d8258e01664bd609e65d8b1d68c80855d314d8bc541342",
|
||||
"zhipu/Embedding/embedding-2": "524e2d23e61229245c2befdd4edd46c7ecd1814368d1afd7acb1ce98125601f4",
|
||||
"zhipu/Embedding/embedding-3": "e84ca0362294219a7dc044537d2dacf897d75c531e49699eac85c2c9f9cc4d3c",
|
||||
"zhipu/KnowledgeQA/glm-4.5-air": "3911dfaa4e69e0342c2c7757f78846e1509c7300db2e92ee256bb293db9b1b99",
|
||||
"zhipu/KnowledgeQA/glm-4.6": "2aa273031863e5b4a3dd1a66dfe951285837cd1161034748c798189639864ad7",
|
||||
"zhipu/KnowledgeQA/glm-4.6v": "b82aad09279b58d1bc98239fb6292c7571aa1160c6f8b763d984ecbbfa6080f1",
|
||||
"zhipu/KnowledgeQA/glm-4.7": "6614695fc13cfbf22f03be7304df3ed8335edff9a67d8dd1a3ec10d0d56055d5",
|
||||
"zhipu/KnowledgeQA/glm-4.7-flash": "fce7d598de8b287455711de716af3259470aaaeb04cc8af2ba32618b19cf10c4",
|
||||
"zhipu/KnowledgeQA/glm-5": "2bf18dfd80557bbca52ed26321b904a6289aa671d0307977e4115176ce4faec2",
|
||||
"zhipu/KnowledgeQA/glm-5.1": "dfcc36d6d2ded9ab8bfc5bbfc6af7a530d918710d9bfd301252a6c9ab17d8767",
|
||||
"zhipu/KnowledgeQA/glm-5.2": "3dad7d6d1be8fb9a43bd5e0b0d38eb28d988cb70029a5062e2d71b8ca046cd76",
|
||||
"zhipu/KnowledgeQA/glm-5.3": "2e114d129d282680ba853add9fad838921adef5ef20b5182b29ce21d9c705821",
|
||||
"zhipu/KnowledgeQA/glm-5.3-flash": "859f96e6699a7f6923f1fe224adcf6e0e6be012740970a9109f0b35a27862224",
|
||||
"zhipu/KnowledgeQA/glm-5v-turbo": "39c2299304ce46d636b564cab7b3061b74491b32f31d7ea8b4a2a1c22304704e",
|
||||
"zhipu/Rerank/rerank": "566896288736efe9f8ef8a44c6e9b9d2f2ad9cdc944bfb05b794c4c3ecb20a66"
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package parity
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"academy/internal/models/api"
|
||||
"academy/internal/models/chat"
|
||||
modelruntime "academy/internal/models/runtime"
|
||||
"academy/internal/types"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestVolcengineCompletionBudgetFieldsAreMutuallyExclusive(t *testing.T) {
|
||||
vendor, ok := modelruntime.Get("volcengine")
|
||||
require.True(t, ok)
|
||||
for _, model := range vendor.ModelsByType(types.ModelTypeKnowledgeQA) {
|
||||
t.Run(model.ID, func(t *testing.T) {
|
||||
for _, stream := range []bool{false, true} {
|
||||
for _, thinking := range []bool{false, true} {
|
||||
for _, budget := range []int{0, 256} {
|
||||
body := buildBody(t, &chat.ChatConfig{
|
||||
Provider: "volcengine", ModelName: model.ID, BaseURL: "http://127.0.0.1:9/v3",
|
||||
Spec: &types.ModelSpecOverride{Compat: map[string]any{
|
||||
"extra_body": map[string]any{"max_tokens": 1024, "max_completion_tokens": 2048},
|
||||
}},
|
||||
}, &api.Options{MaxTokens: budget, Thinking: ptrBool(thinking)}, stream)
|
||||
require.NotContains(t, body, "max_tokens")
|
||||
want := 2048
|
||||
if budget > 0 {
|
||||
want = budget
|
||||
}
|
||||
require.Equal(t, float64(want), body["max_completion_tokens"])
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user