Merge branch 'main' into feat/mcp-bridge-1.1.0
3 files · +36 -1
M README.md +1 -1
| @@ -490,7 +490,7 @@ For direct Moonshot API keys or a custom compatible endpoint: | |||
| 490 | 490 | zot --provider kimi --model kimi-k2-0905-preview --base-url https://api.moonshot.ai/v1 --api-key "$KIMI_API_KEY" | |
| 491 | 491 | ``` | |
| 492 | 492 | ||
| 493 | - | Kimi K3 is built in as `kimi/k3`, `moonshotai/kimi-k3`, `moonshotai-cn/kimi-k3`, `openrouter/moonshotai/kimi-k3`, and `vercel-ai-gateway/moonshotai/kimi-k3`. Its output limit is 131,072 tokens on every built-in route. | |
| 493 | + | Kimi K3 is built in as `kimi/k3`, `moonshotai/kimi-k3`, `moonshotai-cn/kimi-k3`, `opencode-go/kimi-k3`, `openrouter/moonshotai/kimi-k3`, and `vercel-ai-gateway/moonshotai/kimi-k3`. Its output limit is 131,072 tokens on every built-in route. | |
| 494 | 494 | ||
| 495 | 495 | You can add additional Kimi/Moonshot model IDs to `models.json` under the `kimi` provider. | |
| 496 | 496 | ||
| @@ -490,7 +490,7 @@ For direct Moonshot API keys or a custom compatible endpoint: | |||||
| 490 | zot --provider kimi --model kimi-k2-0905-preview --base-url https://api.moonshot.ai/v1 --api-key "$KIMI_API_KEY" | 490 | zot --provider kimi --model kimi-k2-0905-preview --base-url https://api.moonshot.ai/v1 --api-key "$KIMI_API_KEY" | ||
| 491 | ``` | 491 | ``` | ||
| 492 | 492 | ||||
| 493 | - | Kimi K3 is built in as `kimi/k3`, `moonshotai/kimi-k3`, `moonshotai-cn/kimi-k3`, `openrouter/moonshotai/kimi-k3`, and `vercel-ai-gateway/moonshotai/kimi-k3`. Its output limit is 131,072 tokens on every built-in route. | 493 | + | Kimi K3 is built in as `kimi/k3`, `moonshotai/kimi-k3`, `moonshotai-cn/kimi-k3`, `opencode-go/kimi-k3`, `openrouter/moonshotai/kimi-k3`, and `vercel-ai-gateway/moonshotai/kimi-k3`. Its output limit is 131,072 tokens on every built-in route. |
| 494 | 494 | ||||
| 495 | You can add additional Kimi/Moonshot model IDs to `models.json` under the `kimi` provider. | 495 | You can add additional Kimi/Moonshot model IDs to `models.json` under the `kimi` provider. | ||
| 496 | 496 | ||||
M packages/provider/catalog_builtin.go +2 -0
| @@ -305,9 +305,11 @@ var builtinCatalog = []Model{ | |||
| 305 | 305 | {Provider: "opencode-go", ID: "glm-5", DisplayName: "GLM-5", ContextWindow: 202752, MaxOutput: 32768, Reasoning: true, PriceInput: 1, PriceOutput: 3.2, PriceCacheRead: 0.2, BaseURL: "https://opencode.ai/zen/go/v1"}, | |
| 306 | 306 | {Provider: "opencode-go", ID: "glm-5.1", DisplayName: "GLM-5.1", ContextWindow: 202752, MaxOutput: 32768, Reasoning: true, PriceInput: 1.4, PriceOutput: 4.4, PriceCacheRead: 0.26, BaseURL: "https://opencode.ai/zen/go/v1"}, | |
| 307 | 307 | {Provider: "opencode-go", ID: "glm-5.2", DisplayName: "GLM-5.2", ContextWindow: 1024000, MaxOutput: 128000, Reasoning: true, PriceInput: 0.91, PriceOutput: 2.86, PriceCacheRead: 0.169, BaseURL: "https://opencode.ai/zen/go/v1"}, | |
| 308 | + | {Provider: "opencode-go", ID: "grok-4.5", DisplayName: "Grok 4.5", ContextWindow: 500000, MaxOutput: 500000, Reasoning: true, PriceInput: 2, PriceOutput: 6, PriceCacheRead: 0.3, BaseURL: "https://opencode.ai/zen/go/v1"}, | |
| 308 | 309 | {Provider: "opencode-go", ID: "kimi-k2.5", DisplayName: "Kimi K2.5", ContextWindow: 262144, MaxOutput: 65536, Reasoning: true, PriceInput: 0.6, PriceOutput: 3, PriceCacheRead: 0.1, BaseURL: "https://opencode.ai/zen/go/v1"}, | |
| 309 | 310 | {Provider: "opencode-go", ID: "kimi-k2.6", DisplayName: "Kimi K2.6", ContextWindow: 262144, MaxOutput: 65536, Reasoning: true, PriceInput: 0.95, PriceOutput: 4, PriceCacheRead: 0.16, BaseURL: "https://opencode.ai/zen/go/v1"}, | |
| 310 | 311 | {Provider: "opencode-go", ID: "kimi-k2.7-code", DisplayName: "Kimi K2.7 Code", ContextWindow: 262144, MaxOutput: 16384, Reasoning: true, PriceInput: 0.74, PriceOutput: 3.5, PriceCacheRead: 0.15, BaseURL: "https://opencode.ai/zen/go/v1"}, | |
| 312 | + | {Provider: "opencode-go", ID: "kimi-k3", DisplayName: "Kimi K3", ContextWindow: 1048576, MaxOutput: 131072, Reasoning: true, PriceInput: 3, PriceOutput: 15, PriceCacheRead: 0.3, BaseURL: "https://opencode.ai/zen/go/v1"}, | |
| 311 | 313 | {Provider: "opencode-go", ID: "mimo-v2.5", DisplayName: "MiMo V2.5", ContextWindow: 1000000, MaxOutput: 128000, Reasoning: true, PriceInput: 0.4, PriceOutput: 2, PriceCacheRead: 0.08, BaseURL: "https://opencode.ai/zen/go/v1"}, | |
| 312 | 314 | {Provider: "opencode-go", ID: "mimo-v2.5-pro", DisplayName: "MiMo V2.5 Pro", ContextWindow: 1048576, MaxOutput: 128000, Reasoning: true, PriceInput: 1, PriceOutput: 3, PriceCacheRead: 0.2, BaseURL: "https://opencode.ai/zen/go/v1"}, | |
| 313 | 315 | {Provider: "opencode-go", ID: "minimax-m2.5", DisplayName: "MiniMax M2.5", ContextWindow: 204800, MaxOutput: 65536, Reasoning: true, PriceInput: 0.3, PriceOutput: 1.2, PriceCacheRead: 0.03, BaseURL: "https://opencode.ai/zen/go"}, | |
| @@ -305,9 +305,11 @@ var builtinCatalog = []Model{ | |||||
| 305 | {Provider: "opencode-go", ID: "glm-5", DisplayName: "GLM-5", ContextWindow: 202752, MaxOutput: 32768, Reasoning: true, PriceInput: 1, PriceOutput: 3.2, PriceCacheRead: 0.2, BaseURL: "https://opencode.ai/zen/go/v1"}, | 305 | {Provider: "opencode-go", ID: "glm-5", DisplayName: "GLM-5", ContextWindow: 202752, MaxOutput: 32768, Reasoning: true, PriceInput: 1, PriceOutput: 3.2, PriceCacheRead: 0.2, BaseURL: "https://opencode.ai/zen/go/v1"}, | ||
| 306 | {Provider: "opencode-go", ID: "glm-5.1", DisplayName: "GLM-5.1", ContextWindow: 202752, MaxOutput: 32768, Reasoning: true, PriceInput: 1.4, PriceOutput: 4.4, PriceCacheRead: 0.26, BaseURL: "https://opencode.ai/zen/go/v1"}, | 306 | {Provider: "opencode-go", ID: "glm-5.1", DisplayName: "GLM-5.1", ContextWindow: 202752, MaxOutput: 32768, Reasoning: true, PriceInput: 1.4, PriceOutput: 4.4, PriceCacheRead: 0.26, BaseURL: "https://opencode.ai/zen/go/v1"}, | ||
| 307 | {Provider: "opencode-go", ID: "glm-5.2", DisplayName: "GLM-5.2", ContextWindow: 1024000, MaxOutput: 128000, Reasoning: true, PriceInput: 0.91, PriceOutput: 2.86, PriceCacheRead: 0.169, BaseURL: "https://opencode.ai/zen/go/v1"}, | 307 | {Provider: "opencode-go", ID: "glm-5.2", DisplayName: "GLM-5.2", ContextWindow: 1024000, MaxOutput: 128000, Reasoning: true, PriceInput: 0.91, PriceOutput: 2.86, PriceCacheRead: 0.169, BaseURL: "https://opencode.ai/zen/go/v1"}, | ||
| 308 | + | {Provider: "opencode-go", ID: "grok-4.5", DisplayName: "Grok 4.5", ContextWindow: 500000, MaxOutput: 500000, Reasoning: true, PriceInput: 2, PriceOutput: 6, PriceCacheRead: 0.3, BaseURL: "https://opencode.ai/zen/go/v1"}, | |||
| 308 | {Provider: "opencode-go", ID: "kimi-k2.5", DisplayName: "Kimi K2.5", ContextWindow: 262144, MaxOutput: 65536, Reasoning: true, PriceInput: 0.6, PriceOutput: 3, PriceCacheRead: 0.1, BaseURL: "https://opencode.ai/zen/go/v1"}, | 309 | {Provider: "opencode-go", ID: "kimi-k2.5", DisplayName: "Kimi K2.5", ContextWindow: 262144, MaxOutput: 65536, Reasoning: true, PriceInput: 0.6, PriceOutput: 3, PriceCacheRead: 0.1, BaseURL: "https://opencode.ai/zen/go/v1"}, | ||
| 309 | {Provider: "opencode-go", ID: "kimi-k2.6", DisplayName: "Kimi K2.6", ContextWindow: 262144, MaxOutput: 65536, Reasoning: true, PriceInput: 0.95, PriceOutput: 4, PriceCacheRead: 0.16, BaseURL: "https://opencode.ai/zen/go/v1"}, | 310 | {Provider: "opencode-go", ID: "kimi-k2.6", DisplayName: "Kimi K2.6", ContextWindow: 262144, MaxOutput: 65536, Reasoning: true, PriceInput: 0.95, PriceOutput: 4, PriceCacheRead: 0.16, BaseURL: "https://opencode.ai/zen/go/v1"}, | ||
| 310 | {Provider: "opencode-go", ID: "kimi-k2.7-code", DisplayName: "Kimi K2.7 Code", ContextWindow: 262144, MaxOutput: 16384, Reasoning: true, PriceInput: 0.74, PriceOutput: 3.5, PriceCacheRead: 0.15, BaseURL: "https://opencode.ai/zen/go/v1"}, | 311 | {Provider: "opencode-go", ID: "kimi-k2.7-code", DisplayName: "Kimi K2.7 Code", ContextWindow: 262144, MaxOutput: 16384, Reasoning: true, PriceInput: 0.74, PriceOutput: 3.5, PriceCacheRead: 0.15, BaseURL: "https://opencode.ai/zen/go/v1"}, | ||
| 312 | + | {Provider: "opencode-go", ID: "kimi-k3", DisplayName: "Kimi K3", ContextWindow: 1048576, MaxOutput: 131072, Reasoning: true, PriceInput: 3, PriceOutput: 15, PriceCacheRead: 0.3, BaseURL: "https://opencode.ai/zen/go/v1"}, | |||
| 311 | {Provider: "opencode-go", ID: "mimo-v2.5", DisplayName: "MiMo V2.5", ContextWindow: 1000000, MaxOutput: 128000, Reasoning: true, PriceInput: 0.4, PriceOutput: 2, PriceCacheRead: 0.08, BaseURL: "https://opencode.ai/zen/go/v1"}, | 313 | {Provider: "opencode-go", ID: "mimo-v2.5", DisplayName: "MiMo V2.5", ContextWindow: 1000000, MaxOutput: 128000, Reasoning: true, PriceInput: 0.4, PriceOutput: 2, PriceCacheRead: 0.08, BaseURL: "https://opencode.ai/zen/go/v1"}, | ||
| 312 | {Provider: "opencode-go", ID: "mimo-v2.5-pro", DisplayName: "MiMo V2.5 Pro", ContextWindow: 1048576, MaxOutput: 128000, Reasoning: true, PriceInput: 1, PriceOutput: 3, PriceCacheRead: 0.2, BaseURL: "https://opencode.ai/zen/go/v1"}, | 314 | {Provider: "opencode-go", ID: "mimo-v2.5-pro", DisplayName: "MiMo V2.5 Pro", ContextWindow: 1048576, MaxOutput: 128000, Reasoning: true, PriceInput: 1, PriceOutput: 3, PriceCacheRead: 0.2, BaseURL: "https://opencode.ai/zen/go/v1"}, | ||
| 313 | {Provider: "opencode-go", ID: "minimax-m2.5", DisplayName: "MiniMax M2.5", ContextWindow: 204800, MaxOutput: 65536, Reasoning: true, PriceInput: 0.3, PriceOutput: 1.2, PriceCacheRead: 0.03, BaseURL: "https://opencode.ai/zen/go"}, | 315 | {Provider: "opencode-go", ID: "minimax-m2.5", DisplayName: "MiniMax M2.5", ContextWindow: 204800, MaxOutput: 65536, Reasoning: true, PriceInput: 0.3, PriceOutput: 1.2, PriceCacheRead: 0.03, BaseURL: "https://opencode.ai/zen/go"}, | ||
M packages/provider/provider_test.go +33 -0
| @@ -447,6 +447,39 @@ func TestGPT56CatalogEntries(t *testing.T) { | |||
| 447 | 447 | } | |
| 448 | 448 | } | |
| 449 | 449 | ||
| 450 | + | // TestOpenCodeGoCatalog pins the Grok 4.5 and Kimi K3 entries added to | |
| 451 | + | // the OpenCode Go provider. Both are listed in the vendor's current Go | |
| 452 | + | // model lineup (https://opencode.ai/docs/go) and were missing from the | |
| 453 | + | // baked-in catalog. | |
| 454 | + | func TestOpenCodeGoCatalog(t *testing.T) { | |
| 455 | + | cases := []struct { | |
| 456 | + | id string | |
| 457 | + | context int | |
| 458 | + | maxOut int | |
| 459 | + | priceIn float64 | |
| 460 | + | priceOut float64 | |
| 461 | + | cacheRead float64 | |
| 462 | + | }{ | |
| 463 | + | {"grok-4.5", 500000, 500000, 2, 6, 0.3}, | |
| 464 | + | {"kimi-k3", 1048576, 131072, 3, 15, 0.3}, | |
| 465 | + | } | |
| 466 | + | for _, tc := range cases { | |
| 467 | + | m, err := FindModel("opencode-go", tc.id) | |
| 468 | + | if err != nil { | |
| 469 | + | t.Fatal(err) | |
| 470 | + | } | |
| 471 | + | if m.ContextWindow != tc.context || m.MaxOutput != tc.maxOut || !m.Reasoning { | |
| 472 | + | t.Fatalf("opencode-go/%s limits: %+v", tc.id, m) | |
| 473 | + | } | |
| 474 | + | if m.PriceInput != tc.priceIn || m.PriceOutput != tc.priceOut || m.PriceCacheRead != tc.cacheRead { | |
| 475 | + | t.Fatalf("opencode-go/%s prices: %+v", tc.id, m) | |
| 476 | + | } | |
| 477 | + | if m.BaseURL != "https://opencode.ai/zen/go/v1" { | |
| 478 | + | t.Fatalf("opencode-go/%s baseURL: %s", tc.id, m.BaseURL) | |
| 479 | + | } | |
| 480 | + | } | |
| 481 | + | } | |
| 482 | + | ||
| 450 | 483 | // TestOpenAIOmitsZeroMaxTokens guards against sending max_tokens: 0 for | |
| 451 | 484 | // discovered models that don't advertise an output cap (MaxOutput == 0). | |
| 452 | 485 | func TestOpenAIOmitsZeroMaxTokens(t *testing.T) { | |
| @@ -447,6 +447,39 @@ func TestGPT56CatalogEntries(t *testing.T) { | |||||
| 447 | } | 447 | } | ||
| 448 | } | 448 | } | ||
| 449 | 449 | ||||
| 450 | + | // TestOpenCodeGoCatalog pins the Grok 4.5 and Kimi K3 entries added to | |||
| 451 | + | // the OpenCode Go provider. Both are listed in the vendor's current Go | |||
| 452 | + | // model lineup (https://opencode.ai/docs/go) and were missing from the | |||
| 453 | + | // baked-in catalog. | |||
| 454 | + | func TestOpenCodeGoCatalog(t *testing.T) { | |||
| 455 | + | cases := []struct { | |||
| 456 | + | id string | |||
| 457 | + | context int | |||
| 458 | + | maxOut int | |||
| 459 | + | priceIn float64 | |||
| 460 | + | priceOut float64 | |||
| 461 | + | cacheRead float64 | |||
| 462 | + | }{ | |||
| 463 | + | {"grok-4.5", 500000, 500000, 2, 6, 0.3}, | |||
| 464 | + | {"kimi-k3", 1048576, 131072, 3, 15, 0.3}, | |||
| 465 | + | } | |||
| 466 | + | for _, tc := range cases { | |||
| 467 | + | m, err := FindModel("opencode-go", tc.id) | |||
| 468 | + | if err != nil { | |||
| 469 | + | t.Fatal(err) | |||
| 470 | + | } | |||
| 471 | + | if m.ContextWindow != tc.context || m.MaxOutput != tc.maxOut || !m.Reasoning { | |||
| 472 | + | t.Fatalf("opencode-go/%s limits: %+v", tc.id, m) | |||
| 473 | + | } | |||
| 474 | + | if m.PriceInput != tc.priceIn || m.PriceOutput != tc.priceOut || m.PriceCacheRead != tc.cacheRead { | |||
| 475 | + | t.Fatalf("opencode-go/%s prices: %+v", tc.id, m) | |||
| 476 | + | } | |||
| 477 | + | if m.BaseURL != "https://opencode.ai/zen/go/v1" { | |||
| 478 | + | t.Fatalf("opencode-go/%s baseURL: %s", tc.id, m.BaseURL) | |||
| 479 | + | } | |||
| 480 | + | } | |||
| 481 | + | } | |||
| 482 | + | ||||
| 450 | // TestOpenAIOmitsZeroMaxTokens guards against sending max_tokens: 0 for | 483 | // TestOpenAIOmitsZeroMaxTokens guards against sending max_tokens: 0 for | ||
| 451 | // discovered models that don't advertise an output cap (MaxOutput == 0). | 484 | // discovered models that don't advertise an output cap (MaxOutput == 0). | ||
| 452 | func TestOpenAIOmitsZeroMaxTokens(t *testing.T) { | 485 | func TestOpenAIOmitsZeroMaxTokens(t *testing.T) { | ||