fix: cap gemini-3.1-pro maxOutputTokens and filter live models
- Reduce maxOutputTokens from 131072 to 65535 for gemini-3.1-pro-high and gemini-3.1-pro-low, fixing 400 "invalid argument" errors from Open WebUI when no max_tokens is specified (upstream limit is 65535) - Filter non-viable models (gemini-3.1-flash-image-preview, gemini-2.5-flash-preview-image-generation, gemini-3-pro-high/low) from the live upstream API response in /api/providers/[id]/models
This commit is contained in:
@@ -154,7 +154,15 @@ const PROVIDER_MODELS_CONFIG: Record<string, ProviderModelsConfigEntry> = {
|
||||
authHeader: "Authorization",
|
||||
authPrefix: "Bearer ",
|
||||
body: {},
|
||||
parseResponse: (data) => data.models || [],
|
||||
parseResponse: (data) => {
|
||||
const excluded = new Set([
|
||||
"gemini-2.5-flash-preview-image-generation",
|
||||
"gemini-3.1-flash-image-preview",
|
||||
"gemini-3-pro-low",
|
||||
"gemini-3-pro-high",
|
||||
]);
|
||||
return (data.models || []).filter((m: any) => !excluded.has(m.model || m.id));
|
||||
},
|
||||
},
|
||||
openai: {
|
||||
url: "https://api.openai.com/v1/models",
|
||||
|
||||
@@ -32,7 +32,7 @@ export const MODEL_SPECS: Record<string, ModelSpec> = {
|
||||
|
||||
// ── Gemini 3.1 Pro High ─────────────────────────────────────────
|
||||
"gemini-3.1-pro-high": {
|
||||
maxOutputTokens: 131072,
|
||||
maxOutputTokens: 65535,
|
||||
contextWindow: 1048576,
|
||||
defaultThinkingBudget: 24576,
|
||||
thinkingBudgetCap: 32768,
|
||||
@@ -45,7 +45,7 @@ export const MODEL_SPECS: Record<string, ModelSpec> = {
|
||||
|
||||
// ── Gemini 3.1 Pro Low ──────────────────────────────────────────
|
||||
"gemini-3.1-pro-low": {
|
||||
maxOutputTokens: 131072,
|
||||
maxOutputTokens: 65535,
|
||||
contextWindow: 1048576,
|
||||
defaultThinkingBudget: 8192,
|
||||
thinkingBudgetCap: 16000,
|
||||
|
||||
Reference in New Issue
Block a user