diff options
| author | mineo <[email protected]> | 2025-05-16 03:25:21 +0900 |
|---|---|---|
| committer | adamdottv <[email protected]> | 2025-05-15 13:35:06 -0500 |
| commit | 87237b6462b9dfd379b22e69712e8dc516afad9d (patch) | |
| tree | ffce4fab0e86ad05684738834c52de2f7f1f7a76 /internal/llm/models | |
| parent | 5f5f9dad877300bab3fe5442ea141551ba89421b (diff) | |
| download | opencode-87237b6462b9dfd379b22e69712e8dc516afad9d.tar.gz opencode-87237b6462b9dfd379b22e69712e8dc516afad9d.zip | |
feat: support VertexAI provider (#153)
* support: vertexai
fix
fix
set default for vertexai
added comment
fix
fix
* create schema
* fix README.md
* fix order
* added pupularity
* set tools if tools is exists
restore commentout
* fix comment
* set summarizer model
Diffstat (limited to 'internal/llm/models')
| -rw-r--r-- | internal/llm/models/models.go | 2 | ||||
| -rw-r--r-- | internal/llm/models/vertexai.go | 38 |
2 files changed, 40 insertions, 0 deletions
diff --git a/internal/llm/models/models.go b/internal/llm/models/models.go index 16fd406c8..e4fe6603b 100644 --- a/internal/llm/models/models.go +++ b/internal/llm/models/models.go @@ -43,6 +43,7 @@ var ProviderPopularity = map[ModelProvider]int{ ProviderOpenRouter: 5, ProviderBedrock: 6, ProviderAzure: 7, + ProviderVertexAI: 8, } var SupportedModels = map[ModelID]Model{ @@ -95,4 +96,5 @@ func init() { maps.Copy(SupportedModels, AzureModels) maps.Copy(SupportedModels, OpenRouterModels) maps.Copy(SupportedModels, XAIModels) + maps.Copy(SupportedModels, VertexAIGeminiModels) } diff --git a/internal/llm/models/vertexai.go b/internal/llm/models/vertexai.go new file mode 100644 index 000000000..d71dfc0be --- /dev/null +++ b/internal/llm/models/vertexai.go @@ -0,0 +1,38 @@ +package models + +const ( + ProviderVertexAI ModelProvider = "vertexai" + + // Models + VertexAIGemini25Flash ModelID = "vertexai.gemini-2.5-flash" + VertexAIGemini25 ModelID = "vertexai.gemini-2.5" +) + +var VertexAIGeminiModels = map[ModelID]Model{ + VertexAIGemini25Flash: { + ID: VertexAIGemini25Flash, + Name: "VertexAI: Gemini 2.5 Flash", + Provider: ProviderVertexAI, + APIModel: "gemini-2.5-flash-preview-04-17", + CostPer1MIn: GeminiModels[Gemini25Flash].CostPer1MIn, + CostPer1MInCached: GeminiModels[Gemini25Flash].CostPer1MInCached, + CostPer1MOut: GeminiModels[Gemini25Flash].CostPer1MOut, + CostPer1MOutCached: GeminiModels[Gemini25Flash].CostPer1MOutCached, + ContextWindow: GeminiModels[Gemini25Flash].ContextWindow, + DefaultMaxTokens: GeminiModels[Gemini25Flash].DefaultMaxTokens, + SupportsAttachments: true, + }, + VertexAIGemini25: { + ID: VertexAIGemini25, + Name: "VertexAI: Gemini 2.5 Pro", + Provider: ProviderVertexAI, + APIModel: "gemini-2.5-pro-preview-03-25", + CostPer1MIn: GeminiModels[Gemini25].CostPer1MIn, + CostPer1MInCached: GeminiModels[Gemini25].CostPer1MInCached, + CostPer1MOut: GeminiModels[Gemini25].CostPer1MOut, + CostPer1MOutCached: GeminiModels[Gemini25].CostPer1MOutCached, + ContextWindow: GeminiModels[Gemini25].ContextWindow, + DefaultMaxTokens: GeminiModels[Gemini25].DefaultMaxTokens, + SupportsAttachments: true, + }, +} |
