Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions backend/internal/capability/capability.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ var rules = []rule{
{"o4", []core.Capability{core.CapToolCalling, core.CapReasoning, core.CapStructuredOutput}, false},
{"claude", []core.Capability{core.CapToolCalling, core.CapVision, core.CapReasoning, core.CapLongContext}, false},
{"gemini", []core.Capability{core.CapToolCalling, core.CapVision, core.CapAudioInput, core.CapLongContext}, false},
{"deepseek-v4", []core.Capability{core.CapToolCalling, core.CapVision, core.CapReasoning, core.CapLongContext}, false},
{"deepseek", []core.Capability{core.CapToolCalling, core.CapReasoning}, false},
{"glm", []core.Capability{core.CapToolCalling, core.CapLongContext}, false},
{"minimax", []core.Capability{core.CapToolCalling, core.CapLongContext}, false},
Expand Down
2 changes: 1 addition & 1 deletion backend/internal/connectors/catalog.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ func apiKeyProviders() []ProviderSpec {
{ID: "deepseek", DisplayName: "DeepSeek", Alias: "ds", Dialect: core.DialectOpenAI,
BaseURL: "https://api.deepseek.com", AuthKind: "api_key", ServiceKinds: llm(),
Color: "#4D6BFE", Website: "https://deepseek.com", APIKeyURL: "https://platform.deepseek.com/api_keys",
InputPerM: 0.27, OutputPerM: 1.1},
InputPerM: 0.14, OutputPerM: 0.28},
{ID: "glm", DisplayName: "GLM Coding", Alias: "glm", Dialect: core.DialectAnthropic,
BaseURL: "https://api.z.ai/api/anthropic/v1", AuthKind: "api_key", ServiceKinds: llm(),
Color: "#2563EB", Website: "https://open.bigmodel.cn", APIKeyURL: "https://open.bigmodel.cn/usercenter/apikeys",
Expand Down
24 changes: 24 additions & 0 deletions backend/internal/connectors/catalog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,35 @@ func TestFindModel(t *testing.T) {
if _, ok := FindModel("commandcode", "deepseek/deepseek-v4-pro"); !ok {
t.Error("expected to find commandcode/deepseek/deepseek-v4-pro")
}
if _, ok := FindModel("deepseek", "deepseek-v4-pro-max"); !ok {
t.Error("expected to find deepseek/deepseek-v4-pro-max")
}
if _, ok := FindModel("deepseek", "deepseek-v4-pro-none"); !ok {
t.Error("expected to find deepseek/deepseek-v4-pro-none")
}
if _, ok := FindModel("openai", "nonexistent-model"); ok {
t.Error("expected miss for nonexistent model")
}
}

func TestDeepSeekPricing(t *testing.T) {
flash, ok := ModelPriceByProviderModel("deepseek", "deepseek-v4-flash")
if !ok {
t.Fatal("missing deepseek-v4-flash price")
}
if flash.InputPerM != 0.14 || flash.OutputPerM != 0.28 || flash.CachedInputPerM != 0.0028 || flash.ReasoningPerM != 0.28 {
t.Fatalf("unexpected deepseek-v4-flash pricing: %+v", flash)
}

pro, ok := ModelPriceByProviderModel("deepseek", "deepseek-v4-pro")
if !ok {
t.Fatal("missing deepseek-v4-pro price")
}
if pro.InputPerM != 0.435 || pro.OutputPerM != 0.87 || pro.CachedInputPerM != 0.003625 || pro.ReasoningPerM != 0.87 {
t.Fatalf("unexpected deepseek-v4-pro pricing: %+v", pro)
}
}

func TestCommandCodeCatalogVisible(t *testing.T) {
spec, ok := SpecByID("commandcode")
if !ok {
Expand Down
12 changes: 9 additions & 3 deletions backend/internal/connectors/model_prices.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,15 @@ func anthropicModelPrices() []ModelPrice {

func deepseekModelPrices() []ModelPrice {
return []ModelPrice{
{Provider: "deepseek", Model: "deepseek-chat", InputPerM: 0.27, OutputPerM: 1.1, CachedInputPerM: 0.07, CacheWritePerM: 0.27},
{Provider: "deepseek", Model: "deepseek-coder", InputPerM: 0.27, OutputPerM: 1.1, CachedInputPerM: 0.07, CacheWritePerM: 0.27},
{Provider: "deepseek", Model: "deepseek-reasoner", InputPerM: 0.55, OutputPerM: 2.19, CachedInputPerM: 0.14, CacheWritePerM: 0.55, ReasoningPerM: 2.19},
{Provider: "deepseek", Model: "deepseek-chat", InputPerM: 0.14, OutputPerM: 0.28, CachedInputPerM: 0.0028, CacheWritePerM: 0.14, ReasoningPerM: 0.28},
{Provider: "deepseek", Model: "deepseek-reasoner", InputPerM: 0.14, OutputPerM: 0.28, CachedInputPerM: 0.0028, CacheWritePerM: 0.14, ReasoningPerM: 0.28},
{Provider: "deepseek", Model: "deepseek-r1", InputPerM: 0.14, OutputPerM: 0.28, CachedInputPerM: 0.0028, CacheWritePerM: 0.14, ReasoningPerM: 0.28},
{Provider: "deepseek", Model: "deepseek-v3.2-chat", InputPerM: 0.14, OutputPerM: 0.28, CachedInputPerM: 0.0028, CacheWritePerM: 0.14, ReasoningPerM: 0.28},
{Provider: "deepseek", Model: "deepseek-v3.2-reasoner", InputPerM: 0.14, OutputPerM: 0.28, CachedInputPerM: 0.0028, CacheWritePerM: 0.14, ReasoningPerM: 0.28},
{Provider: "deepseek", Model: "deepseek-v4-flash", InputPerM: 0.14, OutputPerM: 0.28, CachedInputPerM: 0.0028, CacheWritePerM: 0.14, ReasoningPerM: 0.28},
{Provider: "deepseek", Model: "deepseek-v4-pro", InputPerM: 0.435, OutputPerM: 0.87, CachedInputPerM: 0.003625, CacheWritePerM: 0.435, ReasoningPerM: 0.87},
{Provider: "deepseek", Model: "deepseek-v4-pro-max", InputPerM: 0.435, OutputPerM: 0.87, CachedInputPerM: 0.003625, CacheWritePerM: 0.435, ReasoningPerM: 0.87},
{Provider: "deepseek", Model: "deepseek-v4-pro-none", InputPerM: 0.435, OutputPerM: 0.87, CachedInputPerM: 0.003625, CacheWritePerM: 0.435, ReasoningPerM: 0.87},
}
}

Expand Down
5 changes: 3 additions & 2 deletions backend/internal/connectors/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ var providerModels = map[string][]ModelSpec{
m("claude-3-5-sonnet-20241022", "Claude 3.5 Sonnet"),
},
"deepseek": {
m("deepseek-chat", "DeepSeek Chat"), m("deepseek-reasoner", "DeepSeek Reasoner"),
m("deepseek-v4-pro", "DeepSeek V4 Pro"), m("deepseek-v4-flash", "DeepSeek V4 Flash"),
m("deepseek-v4-pro", "DeepSeek V4 Pro"), m("deepseek-v4-pro-max", "DeepSeek V4 Pro Max"),
m("deepseek-v4-pro-none", "DeepSeek V4 Pro No Thinking"), m("deepseek-v4-flash", "DeepSeek V4 Flash"),
m("deepseek-chat", "DeepSeek V3.2 Chat"), m("deepseek-reasoner", "DeepSeek V3.2 Reasoner"),
},
"glm": {m("glm-5.1", "GLM 5.1"), m("glm-5", "GLM 5"), m("glm-4.7", "GLM 4.7"), m("glm-4.6v", "GLM 4.6V (Vision)")},
"glm-cn": {m("glm-5.1", "GLM 5.1"), m("glm-5", "GLM 5"), m("glm-4.7", "GLM-4.7"), m("glm-4.6", "GLM-4.6"), m("glm-4.5-air", "GLM-4.5-Air")},
Expand Down
Loading
Loading