summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorKujtim Hoxha <[email protected]>2025-04-15 11:54:38 +0200
committerGitHub <[email protected]>2025-04-15 11:54:38 +0200
commit6b1c64bcc75b89c530294b6a2d4404682b435d56 (patch)
tree48366a399e2ef4ded23e60097fc98c1ab053b7f5
parent9004b91bf98856717333b009a2ca8d60dd6e804b (diff)
parent633d1d286a17d4b8605b96b400f696819b3e9c17 (diff)
downloadopencode-6b1c64bcc75b89c530294b6a2d4404682b435d56.tar.gz
opencode-6b1c64bcc75b89c530294b6a2d4404682b435d56.zip
Merge pull request #30 from jdlms/update/config-GPT4.1
OpenAI model config changed to GPT-4.1
-rw-r--r--internal/config/config.go4
-rw-r--r--internal/config/config_test.go6
-rw-r--r--internal/llm/models/models.go16
3 files changed, 13 insertions, 13 deletions
diff --git a/internal/config/config.go b/internal/config/config.go
index 661dfc4bb..fdfacd11a 100644
--- a/internal/config/config.go
+++ b/internal/config/config.go
@@ -116,8 +116,8 @@ func Load(debug bool) error {
viper.SetDefault("providers.openai.apiKey", os.Getenv("OPENAI_API_KEY"))
viper.SetDefault("providers.openai.enabled", true)
if !defaultModelSet {
- viper.SetDefault("model.coder", models.GPT4o)
- viper.SetDefault("model.task", models.GPT4o)
+ viper.SetDefault("model.coder", models.GPT41)
+ viper.SetDefault("model.task", models.GPT41)
defaultModelSet = true
}
}
diff --git a/internal/config/config_test.go b/internal/config/config_test.go
index 9af6b479f..9111aa0fa 100644
--- a/internal/config/config_test.go
+++ b/internal/config/config_test.go
@@ -223,7 +223,7 @@ func TestLoad(t *testing.T) {
anthropicKey: "",
openaiKey: "test-key",
geminiKey: "test-key",
- expectedModel: models.GPT4o,
+ expectedModel: models.GPT41,
},
{
name: "fallback to gemini when no others",
@@ -237,9 +237,9 @@ func TestLoad(t *testing.T) {
anthropicKey: "test-key",
openaiKey: "test-key",
geminiKey: "test-key",
- explicitModel: models.GPT4o,
+ explicitModel: models.GPT41,
useExplicitModel: true,
- expectedModel: models.GPT4o,
+ expectedModel: models.GPT41,
},
}
diff --git a/internal/llm/models/models.go b/internal/llm/models/models.go
index 4791218c4..140693237 100644
--- a/internal/llm/models/models.go
+++ b/internal/llm/models/models.go
@@ -23,7 +23,7 @@ const (
Claude3Haiku ModelID = "claude-3-haiku"
Claude37Sonnet ModelID = "claude-3.7-sonnet"
// OpenAI
- GPT4o ModelID = "gpt-4o"
+ GPT41 ModelID = "gpt-4.1"
// GEMINI
GEMINI25 ModelID = "gemini-2.5"
@@ -78,15 +78,15 @@ var SupportedModels = map[ModelID]Model{
},
// OpenAI
- GPT4o: {
- ID: GPT4o,
- Name: "GPT-4o",
+ GPT41: {
+ ID: GPT41,
+ Name: "GPT-4.1",
Provider: ProviderOpenAI,
- APIModel: "gpt-4o",
- CostPer1MIn: 2.50,
- CostPer1MInCached: 1.25,
+ APIModel: "gpt-4.1",
+ CostPer1MIn: 2.00,
+ CostPer1MInCached: 0.50,
CostPer1MOutCached: 0,
- CostPer1MOut: 10.00,
+ CostPer1MOut: 8.00,
},
// GEMINI