Skip to content

Add DeepSeek integration support #329

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
14 changes: 14 additions & 0 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,9 @@ func setProviderDefaults() {
if apiKey := os.Getenv("XAI_API_KEY"); apiKey != "" {
viper.SetDefault("providers.xai.apiKey", apiKey)
}
if apiKey := os.Getenv("DEEPSEEK_API_KEY"); apiKey != "" {
viper.SetDefault("providers.deepseek.apiKey", apiKey)
}
if apiKey := os.Getenv("AZURE_OPENAI_ENDPOINT"); apiKey != "" {
// api-key may be empty when using Entra ID credentials – that's okay
viper.SetDefault("providers.azure.apiKey", os.Getenv("AZURE_OPENAI_API_KEY"))
Expand Down Expand Up @@ -358,6 +361,15 @@ func setProviderDefaults() {
return
}

// DeepSeek configuration
if key := viper.GetString("providers.deepseek.apiKey"); strings.TrimSpace(key) != "" {
viper.SetDefault("agents.coder.model", models.DeepSeekChat)
viper.SetDefault("agents.summarizer.model", models.DeepSeekChat)
viper.SetDefault("agents.task.model", models.DeepSeekChat)
viper.SetDefault("agents.title.model", models.DeepSeekChat)
return
}

// AWS Bedrock configuration
if hasAWSCredentials() {
viper.SetDefault("agents.coder.model", models.BedrockClaude37Sonnet)
Expand Down Expand Up @@ -663,6 +675,8 @@ func getProviderAPIKey(provider models.ModelProvider) string {
if hasVertexAICredentials() {
return "vertex-ai-credentials-available"
}
case models.ProviderDeepSeek:
return os.Getenv("DEEPSEEK_API_KEY")
}
return ""
}
Expand Down
38 changes: 38 additions & 0 deletions internal/llm/models/deepseek.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package models

const (
ProviderDeepSeek ModelProvider = "deepseek"

DeepSeekChat ModelID = "deepseek-chat"
DeepSeekReasoner ModelID = "deepseek-reasoner"
)

var DeepSeekModels = map[ModelID]Model{
DeepSeekChat: {
ID: DeepSeekChat,
Name: "DeepSeek Chat",
Provider: ProviderDeepSeek,
APIModel: "deepseek-chat",
CostPer1MIn: 0.14,
CostPer1MInCached: 0.014,
CostPer1MOut: 0.28,
CostPer1MOutCached: 0.028,
ContextWindow: 163_840,
DefaultMaxTokens: 8192,
SupportsAttachments: true,
},
DeepSeekReasoner: {
ID: DeepSeekReasoner,
Name: "DeepSeek Reasoner",
Provider: ProviderDeepSeek,
APIModel: "deepseek-reasoner",
CostPer1MIn: 0.55,
CostPer1MInCached: 0.055,
CostPer1MOut: 2.19,
CostPer1MOutCached: 0.219,
ContextWindow: 163_840,
DefaultMaxTokens: 8192,
CanReason: true,
SupportsAttachments: true, // Reasoner supports tools!
},
}
2 changes: 2 additions & 0 deletions internal/llm/models/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ var ProviderPopularity = map[ModelProvider]int{
ProviderBedrock: 7,
ProviderAzure: 8,
ProviderVertexAI: 9,
ProviderDeepSeek: 10,
}

var SupportedModels = map[ModelID]Model{
Expand Down Expand Up @@ -95,4 +96,5 @@ func init() {
maps.Copy(SupportedModels, XAIModels)
maps.Copy(SupportedModels, VertexAIGeminiModels)
maps.Copy(SupportedModels, CopilotModels)
maps.Copy(SupportedModels, DeepSeekModels)
}
Loading