Fix Vertex Gemini Flash output limits
- commit
- 197d59886014315f37969aab392048d33e02c04f
- author
- patriceckhart · · 2026-07-18 08:15 UTC
- parent
- a4d9270
- signature
- unsigned
2 files · +14 -2
M packages/provider/catalog_builtin.go +2 -2
| @@ -178,9 +178,9 @@ var builtinCatalog = []Model{ | |||
| 178 | 178 | {Provider: "google-vertex", ID: "gemini-2.5-pro", DisplayName: "Gemini 2.5 Pro (Vertex)", ContextWindow: 1048576, MaxOutput: 65536, Reasoning: true, PriceInput: 1.25, PriceOutput: 10, PriceCacheRead: 0.125, BaseURL: "https://{location}-aiplatform.googleapis.com"}, | |
| 179 | 179 | {Provider: "google-vertex", ID: "gemini-3-flash-preview", DisplayName: "Gemini 3 Flash Preview (Vertex)", ContextWindow: 1048576, MaxOutput: 65536, Reasoning: true, PriceInput: 0.5, PriceOutput: 3, PriceCacheRead: 0.05, BaseURL: "https://{location}-aiplatform.googleapis.com"}, | |
| 180 | 180 | {Provider: "google-vertex", ID: "gemini-3-pro-preview", DisplayName: "Gemini 3 Pro Preview (Vertex)", ContextWindow: 1000000, MaxOutput: 64000, Reasoning: true, PriceInput: 2, PriceOutput: 12, PriceCacheRead: 0.2, BaseURL: "https://{location}-aiplatform.googleapis.com"}, | |
| 181 | - | {Provider: "google-vertex", ID: "gemini-3.1-flash-lite", DisplayName: "Gemini 3.1 Flash Lite (Vertex)", ContextWindow: 1048576, MaxOutput: 65536, Reasoning: true, PriceInput: 0.25, PriceOutput: 1.5, PriceCacheRead: 0.025, BaseURL: "https://{location}-aiplatform.googleapis.com"}, | |
| 181 | + | {Provider: "google-vertex", ID: "gemini-3.1-flash-lite", DisplayName: "Gemini 3.1 Flash Lite (Vertex)", ContextWindow: 1048576, MaxOutput: 65535, Reasoning: true, PriceInput: 0.25, PriceOutput: 1.5, PriceCacheRead: 0.025, BaseURL: "https://{location}-aiplatform.googleapis.com"}, | |
| 182 | 182 | {Provider: "google-vertex", ID: "gemini-3.1-pro-preview", DisplayName: "Gemini 3.1 Pro Preview (Vertex)", ContextWindow: 1048576, MaxOutput: 65536, Reasoning: true, PriceInput: 2, PriceOutput: 12, PriceCacheRead: 0.2, BaseURL: "https://{location}-aiplatform.googleapis.com"}, | |
| 183 | - | {Provider: "google-vertex", ID: "gemini-3.5-flash", DisplayName: "Gemini 3.5 Flash (Vertex)", ContextWindow: 1048576, MaxOutput: 65536, Reasoning: true, PriceInput: 1.5, PriceOutput: 9, PriceCacheRead: 0.15, BaseURL: "https://{location}-aiplatform.googleapis.com"}, | |
| 183 | + | {Provider: "google-vertex", ID: "gemini-3.5-flash", DisplayName: "Gemini 3.5 Flash (Vertex)", ContextWindow: 1048576, MaxOutput: 65535, Reasoning: true, PriceInput: 1.5, PriceOutput: 9, PriceCacheRead: 0.15, BaseURL: "https://{location}-aiplatform.googleapis.com"}, | |
| 184 | 184 | // ----- groq ----- | |
| 185 | 185 | {Provider: "groq", ID: "deepseek-r1-distill-llama-70b", DisplayName: "DeepSeek R1 Distill Llama 70B", ContextWindow: 131072, MaxOutput: 8192, Reasoning: true, PriceInput: 0.75, PriceOutput: 0.99, PriceCacheRead: 0, BaseURL: "https://api.groq.com/openai/v1"}, | |
| 186 | 186 | {Provider: "groq", ID: "gemma2-9b-it", DisplayName: "Gemma 2 9B", ContextWindow: 8192, MaxOutput: 8192, Reasoning: false, PriceInput: 0.2, PriceOutput: 0.2, PriceCacheRead: 0, BaseURL: "https://api.groq.com/openai/v1"}, | |
| @@ -178,9 +178,9 @@ var builtinCatalog = []Model{ | |||||
| 178 | {Provider: "google-vertex", ID: "gemini-2.5-pro", DisplayName: "Gemini 2.5 Pro (Vertex)", ContextWindow: 1048576, MaxOutput: 65536, Reasoning: true, PriceInput: 1.25, PriceOutput: 10, PriceCacheRead: 0.125, BaseURL: "https://{location}-aiplatform.googleapis.com"}, | 178 | {Provider: "google-vertex", ID: "gemini-2.5-pro", DisplayName: "Gemini 2.5 Pro (Vertex)", ContextWindow: 1048576, MaxOutput: 65536, Reasoning: true, PriceInput: 1.25, PriceOutput: 10, PriceCacheRead: 0.125, BaseURL: "https://{location}-aiplatform.googleapis.com"}, | ||
| 179 | {Provider: "google-vertex", ID: "gemini-3-flash-preview", DisplayName: "Gemini 3 Flash Preview (Vertex)", ContextWindow: 1048576, MaxOutput: 65536, Reasoning: true, PriceInput: 0.5, PriceOutput: 3, PriceCacheRead: 0.05, BaseURL: "https://{location}-aiplatform.googleapis.com"}, | 179 | {Provider: "google-vertex", ID: "gemini-3-flash-preview", DisplayName: "Gemini 3 Flash Preview (Vertex)", ContextWindow: 1048576, MaxOutput: 65536, Reasoning: true, PriceInput: 0.5, PriceOutput: 3, PriceCacheRead: 0.05, BaseURL: "https://{location}-aiplatform.googleapis.com"}, | ||
| 180 | {Provider: "google-vertex", ID: "gemini-3-pro-preview", DisplayName: "Gemini 3 Pro Preview (Vertex)", ContextWindow: 1000000, MaxOutput: 64000, Reasoning: true, PriceInput: 2, PriceOutput: 12, PriceCacheRead: 0.2, BaseURL: "https://{location}-aiplatform.googleapis.com"}, | 180 | {Provider: "google-vertex", ID: "gemini-3-pro-preview", DisplayName: "Gemini 3 Pro Preview (Vertex)", ContextWindow: 1000000, MaxOutput: 64000, Reasoning: true, PriceInput: 2, PriceOutput: 12, PriceCacheRead: 0.2, BaseURL: "https://{location}-aiplatform.googleapis.com"}, | ||
| 181 | - | {Provider: "google-vertex", ID: "gemini-3.1-flash-lite", DisplayName: "Gemini 3.1 Flash Lite (Vertex)", ContextWindow: 1048576, MaxOutput: 65536, Reasoning: true, PriceInput: 0.25, PriceOutput: 1.5, PriceCacheRead: 0.025, BaseURL: "https://{location}-aiplatform.googleapis.com"}, | 181 | + | {Provider: "google-vertex", ID: "gemini-3.1-flash-lite", DisplayName: "Gemini 3.1 Flash Lite (Vertex)", ContextWindow: 1048576, MaxOutput: 65535, Reasoning: true, PriceInput: 0.25, PriceOutput: 1.5, PriceCacheRead: 0.025, BaseURL: "https://{location}-aiplatform.googleapis.com"}, |
| 182 | {Provider: "google-vertex", ID: "gemini-3.1-pro-preview", DisplayName: "Gemini 3.1 Pro Preview (Vertex)", ContextWindow: 1048576, MaxOutput: 65536, Reasoning: true, PriceInput: 2, PriceOutput: 12, PriceCacheRead: 0.2, BaseURL: "https://{location}-aiplatform.googleapis.com"}, | 182 | {Provider: "google-vertex", ID: "gemini-3.1-pro-preview", DisplayName: "Gemini 3.1 Pro Preview (Vertex)", ContextWindow: 1048576, MaxOutput: 65536, Reasoning: true, PriceInput: 2, PriceOutput: 12, PriceCacheRead: 0.2, BaseURL: "https://{location}-aiplatform.googleapis.com"}, | ||
| 183 | - | {Provider: "google-vertex", ID: "gemini-3.5-flash", DisplayName: "Gemini 3.5 Flash (Vertex)", ContextWindow: 1048576, MaxOutput: 65536, Reasoning: true, PriceInput: 1.5, PriceOutput: 9, PriceCacheRead: 0.15, BaseURL: "https://{location}-aiplatform.googleapis.com"}, | 183 | + | {Provider: "google-vertex", ID: "gemini-3.5-flash", DisplayName: "Gemini 3.5 Flash (Vertex)", ContextWindow: 1048576, MaxOutput: 65535, Reasoning: true, PriceInput: 1.5, PriceOutput: 9, PriceCacheRead: 0.15, BaseURL: "https://{location}-aiplatform.googleapis.com"}, |
| 184 | // ----- groq ----- | 184 | // ----- groq ----- | ||
| 185 | {Provider: "groq", ID: "deepseek-r1-distill-llama-70b", DisplayName: "DeepSeek R1 Distill Llama 70B", ContextWindow: 131072, MaxOutput: 8192, Reasoning: true, PriceInput: 0.75, PriceOutput: 0.99, PriceCacheRead: 0, BaseURL: "https://api.groq.com/openai/v1"}, | 185 | {Provider: "groq", ID: "deepseek-r1-distill-llama-70b", DisplayName: "DeepSeek R1 Distill Llama 70B", ContextWindow: 131072, MaxOutput: 8192, Reasoning: true, PriceInput: 0.75, PriceOutput: 0.99, PriceCacheRead: 0, BaseURL: "https://api.groq.com/openai/v1"}, | ||
| 186 | {Provider: "groq", ID: "gemma2-9b-it", DisplayName: "Gemma 2 9B", ContextWindow: 8192, MaxOutput: 8192, Reasoning: false, PriceInput: 0.2, PriceOutput: 0.2, PriceCacheRead: 0, BaseURL: "https://api.groq.com/openai/v1"}, | 186 | {Provider: "groq", ID: "gemma2-9b-it", DisplayName: "Gemma 2 9B", ContextWindow: 8192, MaxOutput: 8192, Reasoning: false, PriceInput: 0.2, PriceOutput: 0.2, PriceCacheRead: 0, BaseURL: "https://api.groq.com/openai/v1"}, | ||
M packages/provider/provider_test.go +12 -0
| @@ -41,6 +41,18 @@ func TestModelCatalog(t *testing.T) { | |||
| 41 | 41 | } | |
| 42 | 42 | } | |
| 43 | 43 | ||
| 44 | + | func TestVertexGeminiFlashCatalogLimits(t *testing.T) { | |
| 45 | + | for _, id := range []string{"gemini-3.1-flash-lite", "gemini-3.5-flash"} { | |
| 46 | + | m, err := FindModel("google-vertex", id) | |
| 47 | + | if err != nil { | |
| 48 | + | t.Fatal(err) | |
| 49 | + | } | |
| 50 | + | if m.ContextWindow != 1048576 || m.MaxOutput != 65535 || !m.Reasoning { | |
| 51 | + | t.Errorf("%s metadata = %+v", id, m) | |
| 52 | + | } | |
| 53 | + | } | |
| 54 | + | } | |
| 55 | + | ||
| 44 | 56 | func TestComputeCost(t *testing.T) { | |
| 45 | 57 | m, _ := FindModel("anthropic", "claude-sonnet-4-5") | |
| 46 | 58 | cost := ComputeCost(m, Usage{InputTokens: 1_000_000, OutputTokens: 1_000_000}) | |
| @@ -41,6 +41,18 @@ func TestModelCatalog(t *testing.T) { | |||||
| 41 | } | 41 | } | ||
| 42 | } | 42 | } | ||
| 43 | 43 | ||||
| 44 | + | func TestVertexGeminiFlashCatalogLimits(t *testing.T) { | |||
| 45 | + | for _, id := range []string{"gemini-3.1-flash-lite", "gemini-3.5-flash"} { | |||
| 46 | + | m, err := FindModel("google-vertex", id) | |||
| 47 | + | if err != nil { | |||
| 48 | + | t.Fatal(err) | |||
| 49 | + | } | |||
| 50 | + | if m.ContextWindow != 1048576 || m.MaxOutput != 65535 || !m.Reasoning { | |||
| 51 | + | t.Errorf("%s metadata = %+v", id, m) | |||
| 52 | + | } | |||
| 53 | + | } | |||
| 54 | + | } | |||
| 55 | + | ||||
| 44 | func TestComputeCost(t *testing.T) { | 56 | func TestComputeCost(t *testing.T) { | ||
| 45 | m, _ := FindModel("anthropic", "claude-sonnet-4-5") | 57 | m, _ := FindModel("anthropic", "claude-sonnet-4-5") | ||
| 46 | cost := ComputeCost(m, Usage{InputTokens: 1_000_000, OutputTokens: 1_000_000}) | 58 | cost := ComputeCost(m, Usage{InputTokens: 1_000_000, OutputTokens: 1_000_000}) | ||