mirror of
https://github.com/alibaba/open-code-review.git
synced 2026-08-16 04:04:22 +00:00
feat(llm): add novita api as a default provider (#829)
* feat(llm): add Novita AI as a built-in provider Novita's endpoint (https://api.novita.ai/v3/openai) is OpenAI-compatible, so it registers like the other OpenAI-protocol providers (deepseek, kimi, z-ai, ...). Adds the registry entry, the matching name in the provider-order test, and the provider table in the en/zh/ja configuration docs. Model ids are taken from the live /v3/openai/models endpoint. * fix(llm): correct Novita base URL to current documented endpoint The registry entry, tests-adjacent docs tables (en/ja/zh configuration.md) used https://api.novita.ai/v3/openai. That path still resolves today, but Novita's current documentation (novita.ai/docs/guides/llm-api) no longer shows it; the current documented OpenAI-compatible endpoint is https://api.novita.ai/openai. Verified live 2026-08-01: both paths return identical /models and /chat/completions results, so this is a stale-citation fix, not a functional break. * Recommend Novita's current flagship models The models listed for Novita were older ids that no longer reflect what the platform leads with. Point the recommendations at the three current flagships instead, each verified against api.novita.ai: moonshotai/kimi-k3 1M context, native vision zai-org/glm-5.2 1M context, long-horizon agentic work deepseek/deepseek-v4-flash-0731 1M context, cheapest of the three Context windows, output limits, input modalities and pricing were taken from the live /openai/v1/models response rather than carried over. * Apply suggestion from @wu21-web Co-authored-by: Tao Xin <wu2196674@icloud.com> * Sync provider registry with upstream to resolve merge conflict Rebase-equivalent update of internal/llm/providers.go, internal/llm/providers_test.go, and the en/ja/zh/ru configuration docs to match upstream/main's current content (minimax-cn, mistral, model list refreshes) while keeping the novita entry this branch adds. This is a targeted content sync of the six files that conflicted, not a full merge, so unrelated upstream changes (workflows, CI, etc.) are left untouched. Also adds the novita row to the ru docs table, which was missing. --------- Co-authored-by: kite <254839944+lizhengfeng101@users.noreply.github.com>
This commit is contained in:
parent
7e52a4fd55
commit
a9449db5d3
6 changed files with 17 additions and 1 deletions
|
|
@ -317,6 +317,18 @@ var registry = []Provider{
|
|||
"qwen3.5:397b",
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "novita",
|
||||
DisplayName: "Novita API",
|
||||
Protocol: ProtocolOpenAIChatCompletions,
|
||||
BaseURL: "https://api.novita.ai/openai",
|
||||
EnvVar: "NOVITA_API_KEY",
|
||||
Models: []string{
|
||||
"moonshotai/kimi-k3",
|
||||
"zai-org/glm-5.2",
|
||||
"deepseek/deepseek-v4-flash-0731",
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "litellm",
|
||||
DisplayName: "LiteLLM AI Gateway",
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ func TestListProviders_Order(t *testing.T) {
|
|||
if len(providers) < 3 {
|
||||
t.Fatalf("expected at least 3 providers, got %d", len(providers))
|
||||
}
|
||||
expected := []string{"anthropic", "baidu-qianfan", "dashscope", "dashscope-tokenplan", "deepseek", "edenai", "hy-tokenplan", "iflytek", "kimi", "litellm", "mimo", "minimax", "minimax-cn", "mistral", "ollama-cloud", "openai", "tencent-tokenhub", "volcengine", "z-ai", "z-ai-coding"}
|
||||
expected := []string{"anthropic", "baidu-qianfan", "dashscope", "dashscope-tokenplan", "deepseek", "edenai", "hy-tokenplan", "iflytek", "kimi", "litellm", "mimo", "minimax", "minimax-cn", "mistral", "novita", "ollama-cloud", "openai", "tencent-tokenhub", "volcengine", "z-ai", "z-ai-coding"}
|
||||
if len(providers) != len(expected) {
|
||||
t.Fatalf("expected %d providers, got %d", len(expected), len(providers))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ environment variable.
|
|||
| `minimax` | openai | `https://api.minimax.io/v1` | `MINIMAX_GLOBAL_API_KEY` |
|
||||
| `minimax-cn` | openai | `https://api.minimaxi.com/v1` | `MINIMAX_API_KEY` |
|
||||
| `baidu-qianfan` | openai | `https://qianfan.baidubce.com/v2` | `QIANFAN_API_KEY` |
|
||||
| `novita` | openai | `https://api.novita.ai/openai` | `NOVITA_API_KEY` |
|
||||
|
||||
### Custom providers
|
||||
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ ocr config set providers.anthropic.api_key sk-ant-xxxxxxxxxx
|
|||
| `minimax` | openai | `https://api.minimax.io/v1` | `MINIMAX_GLOBAL_API_KEY` |
|
||||
| `minimax-cn` | openai | `https://api.minimaxi.com/v1` | `MINIMAX_API_KEY` |
|
||||
| `baidu-qianfan` | openai | `https://qianfan.baidubce.com/v2` | `QIANFAN_API_KEY` |
|
||||
| `novita` | openai | `https://api.novita.ai/openai` | `NOVITA_API_KEY` |
|
||||
|
||||
### カスタム provider
|
||||
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ API-ключ. Если `providers.<name>.api_key` не задан, OCR испо
|
|||
| `minimax` | openai | `https://api.minimax.io/v1` | `MINIMAX_GLOBAL_API_KEY` |
|
||||
| `minimax-cn` | openai | `https://api.minimaxi.com/v1` | `MINIMAX_API_KEY` |
|
||||
| `baidu-qianfan` | openai | `https://qianfan.baidubce.com/v2` | `QIANFAN_API_KEY` |
|
||||
| `novita` | openai | `https://api.novita.ai/openai` | `NOVITA_API_KEY` |
|
||||
|
||||
### Пользовательские провайдеры
|
||||
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ ocr config set providers.anthropic.api_key sk-ant-xxxxxxxxxx
|
|||
| `minimax` | openai | `https://api.minimax.io/v1` | `MINIMAX_GLOBAL_API_KEY` |
|
||||
| `minimax-cn` | openai | `https://api.minimaxi.com/v1` | `MINIMAX_API_KEY` |
|
||||
| `baidu-qianfan` | openai | `https://qianfan.baidubce.com/v2` | `QIANFAN_API_KEY` |
|
||||
| `novita` | openai | `https://api.novita.ai/openai` | `NOVITA_API_KEY` |
|
||||
|
||||
### 自定义 provider
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue