diff --git a/.opencode/opencode.jsonc b/.opencode/opencode.jsonc index c53abef944..bfe37f5df9 100644 --- a/.opencode/opencode.jsonc +++ b/.opencode/opencode.jsonc @@ -186,6 +186,10 @@ "messaging": { "embedding": "off" }, + // Provider catalogs for antigravity-direct, openai-codex, google, openai and + // cloudflare-gateway are sync-owned: their "models" live in the runtime overlay + // (~/.local/state/opencode/opencode-runtime.jsonc), layered over this file via + // OPENCODE_CONFIG — see code#4544. Everything else here is deliberate config. "provider": { "claude-code": { "npm": "@ai-sdk/openai-compatible", @@ -351,219 +355,135 @@ "options": { "baseURL": "https://gateway.ai.cloudflare.com/v1/234b866b99ce2b142d7963d8d139cbfa/opencode-gateway/workers-ai/v1", "apiKey": "{env:CLOUDFLARE_API_TOKEN}" + } + // "models": maintained by sync-models in the runtime overlay (~/.local/state/opencode/opencode-runtime.jsonc) — see code#4544. + }, + // OFF via disabled_providers (PROVIDER SWITCHBOARD, top of file). + "cloudflare-workers-ai": {}, + "cloudflare-ai-gateway": { + "npm": "@ai-sdk/openai-compatible", + "name": "Cloudflare AI Gateway (Unified Routing)", + "options": { + "baseURL": "https://gateway.ai.cloudflare.com/v1/234b866b99ce2b142d7963d8d139cbfa/opencode-gateway", + "apiKey": "{env:CLOUDFLARE_API_TOKEN}" }, "models": { - "@cf/deepseek-ai/deepseek-v4-flash-0731": { - "name": "DeepSeek V4 Flash (1M Context, Agentic)", - "variants": { - "low": { - "options": { - "reasoning_effort": "low" - } - }, - "medium": { - "options": { - "reasoning_effort": "medium" - } - }, - "high": { - "options": { - "reasoning_effort": "high" - } - } - }, + "anthropic/claude-sonnet-5.5": { + "name": "Claude Sonnet 5.5 (via AI Gateway)", "limit": { - "context": 1048576, - "output": 16384 - } - }, - "@cf/deepseek-ai/deepseek-v4-pro-0813": { - "name": "DeepSeek V4 Pro (1M Context, Deep Reasoning)", + "context": 1000000, + "output": 64000 + }, "variants": { "low": { "options": { - "reasoning_effort": "low" + "thinking": { + "type": "enabled", + "budget_tokens": 4096 + } } }, "medium": { "options": { - "reasoning_effort": "medium" + "thinking": { + "type": "enabled", + "budget_tokens": 16384 + } } }, "high": { "options": { - "reasoning_effort": "high" + "thinking": { + "type": "enabled", + "budget_tokens": 32768 + } } }, "max": { "options": { - "reasoning_effort": "high", - "max_tokens": 16384 - } - } - }, - "limit": { - "context": 1048576, - "output": 16384 - } - }, - "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b": { - "name": "DeepSeek R1 Distill Qwen 32B (Reasoning)", - "variants": { - "low": { - "options": { - "reasoning_effort": "low" - } - }, - "medium": { - "options": { - "reasoning_effort": "medium" - } - }, - "high": { - "options": { - "reasoning_effort": "high" + "thinking": { + "type": "enabled", + "budget_tokens": 64000 + } } } - }, - "limit": { - "context": 131072, - "output": 16384 } }, - "@cf/zai-org/glm-5.3-flash": { - "name": "GLM 5.3 Flash (1M Context, Fast Agentic)", - "variants": { - "low": { - "options": { - "reasoning_effort": "low" - } - }, - "medium": { - "options": { - "reasoning_effort": "medium" - } - }, - "high": { - "options": { - "reasoning_effort": "high" - } - } - }, + "anthropic/claude-opus-5.5": { + "name": "Claude Opus 5.5 (via AI Gateway)", "limit": { - "context": 1048576, - "output": 16384 - } - }, - "@cf/zai-org/glm-5.3": { - "name": "GLM 5.3 Flagship (1.3M Context, Multimodal)", - "variants": { - "low": { - "options": { - "reasoning_effort": "low" - } - }, - "medium": { - "options": { - "reasoning_effort": "medium" - } - }, - "high": { - "options": { - "reasoning_effort": "high" - } - } + "context": 1000000, + "output": 64000 }, - "limit": { - "context": 1310720, - "output": 16384 - } - }, - "@cf/meta/llama-4-scout-17b-16e-instruct": { - "name": "Llama 4 Scout 17B-16E (MoE, 131k Context)", "variants": { "low": { "options": { - "temperature": 0.2 + "thinking": { + "type": "enabled", + "budget_tokens": 8192 + } } }, "medium": { "options": { - "temperature": 0.5 + "thinking": { + "type": "enabled", + "budget_tokens": 16384 + } } }, "high": { "options": { - "temperature": 0.7 - } - } - }, - "limit": { - "context": 131072, - "output": 16384 - } - }, - "@cf/meta/llama-3.3-70b-instruct-fp8-fast": { - "name": "Llama 3.3 70B Instruct Fast (24k Context, FP8)", - "limit": { - "context": 24000, - "output": 8192 - }, - "variants": { - "low": { - "options": { - "temperature": 0.2 - } - }, - "medium": { - "options": { - "temperature": 0.5 + "thinking": { + "type": "enabled", + "budget_tokens": 32768 + } } }, - "high": { + "max": { "options": { - "temperature": 0.7 + "thinking": { + "type": "enabled", + "budget_tokens": 64000 + } } } } }, - "@cf/meta/llama-3.2-11b-vision-instruct": { - "name": "Llama 3.2 11B Vision Instruct (Multimodal)", - "limit": { - "context": 131072, - "output": 8192 - } - }, - "@cf/google/gemma-4-26b-a4b-it": { - "name": "Gemma 4 26B-A4B Instruct (Google Open Weights)", + "anthropic/claude-sonnet-4.5": { + "name": "Claude Sonnet 4.5 (via AI Gateway)", "limit": { - "context": 131072, - "output": 8192 + "context": 1000000, + "output": 64000 } }, - "@cf/qwen/qwen3.8-27b": { - "name": "Qwen 3.8 27B (262k Context)", + "openai/gpt-4o": { + "name": "GPT-4o (via AI Gateway)", "limit": { - "context": 262144, + "context": 128000, "output": 16384 } }, - "@cf/qwen/qwen3-30b-a3b-fp8": { - "name": "Qwen 3 MoE 30B-A3B (Edge Speed)", + "openai/gpt-4o-mini": { + "name": "GPT-4o mini (via AI Gateway)", "limit": { - "context": 131072, + "context": 128000, "output": 16384 } }, - "@cf/qwen/qwen2.5-coder-32b-instruct": { - "name": "Qwen 2.5 Coder 32B (Code Specialist)", + "openai/o1": { + "name": "o1 (via AI Gateway)", "limit": { - "context": 131072, - "output": 16384 + "context": 200000, + "output": 100000 } }, - "@cf/qwen/qwq-32b": { - "name": "QwQ 32B (Thinking / Math & Architecture)", + "openai/o3-mini": { + "name": "o3-mini (via AI Gateway)", + "limit": { + "context": 200000, + "output": 100000 + }, "variants": { "low": { "options": { @@ -580,526 +500,153 @@ "reasoning_effort": "high" } } - }, - "limit": { - "context": 131072, - "output": 16384 } }, - "@cf/moonshotai/kimi-k2.7-code": { - "name": "Kimi K2.7 Code (262k Context, Repo Analysis)", + "openai/gpt-5-mini": { + "name": "GPT-5 mini (via AI Gateway)", "limit": { - "context": 262144, - "output": 16384 + "context": 200000, + "output": 32768 } }, - "@cf/mistralai/mistral-small-3.1-24b-instruct": { - "name": "Mistral Small 3.1 24B Instruct", + "openai/gpt-5.6-sol": { + "name": "GPT-5.6-SOL (via AI Gateway)", "limit": { - "context": 131072, - "output": 16384 + "context": 1050000, + "output": 128000 } }, - "@cf/openai/gpt-oss-120b": { - "name": "GPT-OSS 120B (Open-Weight Flagship)", - "variants": { - "low": { - "options": { - "reasoning_effort": "low" - } - }, - "medium": { - "options": { - "reasoning_effort": "medium" - } - }, - "high": { - "options": { - "reasoning_effort": "high" - } - } - }, + "openai/gpt-5.6-sol-fast": { + "name": "GPT-5.6-SOL-FAST (via AI Gateway)", "limit": { - "context": 131072, - "output": 16384 + "context": 1050000, + "output": 128000 } }, - "@cf/openai/gpt-oss-20b": { - "name": "GPT-OSS 20B (Open-Weight Latency Tier)", + "openai/gpt-5.6-luna": { + "name": "GPT-5.6-LUNA (via AI Gateway)", "limit": { - "context": 131072, - "output": 16384 + "context": 1050000, + "output": 128000 } }, - "@cf/cloudflare/clef": { - "name": "Cloudflare Clef 27B (Typed Classifier)", - "system": "You are a deterministic classification engine. Output strictly raw JSON conforming to the requested schema. Do not generate conversational text, markdown formatting, or preamble.", + "openai/gpt-5.6-luna-fast": { + "name": "GPT-5.6-LUNA-FAST (via AI Gateway)", "limit": { - "context": 32768, - "output": 4096 + "context": 1050000, + "output": 128000 } }, - "@cf/cloudflare/clef-flash": { - "name": "Cloudflare Clef Flash 9B (Edge Classifier)", - "system": "You are a deterministic classification engine. Output strictly raw JSON conforming to the requested schema. Do not generate conversational text, markdown formatting, or preamble.", + "openai/gpt-5.6-terra": { + "name": "GPT-5.6-TERRA (via AI Gateway)", "limit": { - "context": 32768, - "output": 4096 + "context": 1050000, + "output": 128000 } }, - "@cf/meta/llama-guard-3-8b": { - "name": "Llama Guard 3 8B", + "openai/gpt-5.6-terra-fast": { + "name": "GPT-5.6-TERRA-FAST (via AI Gateway)", "limit": { - "context": 131072, - "output": 131072 + "context": 1050000, + "output": 128000 } }, - "@cf/meta/llama-3.1-8b-instruct-fp8": { - "name": "Llama 3.1 8B Instruct fp8", + "openai/gpt-6-sol": { + "name": "GPT-6-SOL (via AI Gateway)", "limit": { - "context": 32000, - "output": 32000 + "context": 1050000, + "output": 128000 } }, - "@cf/meta/llama-3.2-1b-instruct": { - "name": "Llama 3.2 1B Instruct", + "openai/gpt-6-sol-fast": { + "name": "GPT-6-SOL-FAST (via AI Gateway)", "limit": { - "context": 60000, - "output": 60000 + "context": 1050000, + "output": 128000 } }, - "@cf/meta/llama-3.2-3b-instruct": { - "name": "Llama 3.2 3B Instruct", + "openai/gpt-6.1-sol": { + "name": "GPT-6.1-SOL (via AI Gateway)", "limit": { - "context": 80000, - "output": 80000 + "context": 1050000, + "output": 128000 } }, - "@cf/aisingapore/gemma-sea-lion-v4-27b-it": { - "name": "Gemma Sea Lion V4 27B It", + "openai/gpt-6.1-sol-fast": { + "name": "GPT-6.1-SOL-FAST (via AI Gateway)", "limit": { - "context": 128000, + "context": 1050000, "output": 128000 } }, - "@cf/ibm-granite/granite-4.0-h-micro": { - "name": "Granite 4.0 H Micro", + "openai/gpt-6-luna": { + "name": "GPT-6-LUNA (via AI Gateway)", "limit": { - "context": 131000, - "output": 131000 + "context": 1050000, + "output": 128000 } }, - "@cf/moonshotai/kimi-k2.6": { - "name": "Kimi K2.6", + "openai/gpt-6-luna-fast": { + "name": "GPT-6-LUNA-FAST (via AI Gateway)", "limit": { - "context": 262144, - "output": 256000 - }, - "variants": { - "low": { - "options": { - "reasoning_effort": "low" - } - }, - "medium": { - "options": { - "reasoning_effort": "medium" - } - }, - "high": { - "options": { - "reasoning_effort": "high" - } - } + "context": 1050000, + "output": 128000 } }, - "@cf/zai-org/glm-4.7-flash": { - "name": "GLM-4.7-Flash", + "openai/gpt-6-astra": { + "name": "GPT-6-ASTRA (via AI Gateway)", "limit": { - "context": 131072, - "output": 131072 - }, - "variants": { - "low": { - "options": { - "reasoning_effort": "low" - } - }, - "medium": { - "options": { - "reasoning_effort": "medium" - } - }, - "high": { - "options": { - "reasoning_effort": "high" - } - } + "context": 1050000, + "output": 128000 } }, - "@cf/zai-org/glm-5.2": { - "name": "Glm 5.2", + "openai/gpt-6-astra-fast": { + "name": "GPT-6-ASTRA-FAST (via AI Gateway)", "limit": { - "context": 262144, - "output": 256000 - }, - "variants": { - "low": { - "options": { - "reasoning_effort": "low" - } - }, - "medium": { - "options": { - "reasoning_effort": "medium" - } - }, - "high": { - "options": { - "reasoning_effort": "high" - } - } + "context": 1050000, + "output": 128000 } }, - "@cf/nvidia/nemotron-3-120b-a12b": { - "name": "Nemotron 3 Super 120B", + "openai/gpt-5.5": { + "name": "GPT-5.5 (via AI Gateway)", "limit": { - "context": 256000, - "output": 256000 - }, - "variants": { - "low": { - "options": { - "reasoning_effort": "low" - } - }, - "medium": { - "options": { - "reasoning_effort": "medium" - } - }, - "high": { - "options": { - "reasoning_effort": "high" - } - } + "context": 1050000, + "output": 128000 } }, - "@cf/deepseek-ai/deepseek-v4.1-flash-1017": { - "name": "Deepseek V4.1 Flash 1017", - "limit": { - "context": 1048576, - "output": 1048576 - }, - "variants": { - "low": { - "options": { - "reasoning_effort": "low" - } - }, - "medium": { - "options": { - "reasoning_effort": "medium" - } - }, - "high": { - "options": { - "reasoning_effort": "high" - } - } - } - } - } - }, - // OFF via disabled_providers (PROVIDER SWITCHBOARD, top of file). - "cloudflare-workers-ai": {}, - "cloudflare-ai-gateway": { - "npm": "@ai-sdk/openai-compatible", - "name": "Cloudflare AI Gateway (Unified Routing)", - "options": { - "baseURL": "https://gateway.ai.cloudflare.com/v1/234b866b99ce2b142d7963d8d139cbfa/opencode-gateway", - "apiKey": "{env:CLOUDFLARE_API_TOKEN}" - }, - "models": { - "anthropic/claude-sonnet-5.5": { - "name": "Claude Sonnet 5.5 (via AI Gateway)", + "openai/gpt-5.5-fast": { + "name": "GPT-5.5-FAST (via AI Gateway)", "limit": { - "context": 1000000, - "output": 64000 - }, - "variants": { - "low": { - "options": { - "thinking": { - "type": "enabled", - "budget_tokens": 4096 - } - } - }, - "medium": { - "options": { - "thinking": { - "type": "enabled", - "budget_tokens": 16384 - } - } - }, - "high": { - "options": { - "thinking": { - "type": "enabled", - "budget_tokens": 32768 - } - } - }, - "max": { - "options": { - "thinking": { - "type": "enabled", - "budget_tokens": 64000 - } - } - } + "context": 1050000, + "output": 128000 } }, - "anthropic/claude-opus-5.5": { - "name": "Claude Opus 5.5 (via AI Gateway)", + "openai/gpt-5.4": { + "name": "GPT-5.4 (via AI Gateway)", "limit": { - "context": 1000000, - "output": 64000 - }, - "variants": { - "low": { - "options": { - "thinking": { - "type": "enabled", - "budget_tokens": 8192 - } - } - }, - "medium": { - "options": { - "thinking": { - "type": "enabled", - "budget_tokens": 16384 - } - } - }, - "high": { - "options": { - "thinking": { - "type": "enabled", - "budget_tokens": 32768 - } - } - }, - "max": { - "options": { - "thinking": { - "type": "enabled", - "budget_tokens": 64000 - } - } - } + "context": 1050000, + "output": 128000 } }, - "anthropic/claude-sonnet-4.5": { - "name": "Claude Sonnet 4.5 (via AI Gateway)", + "openai/gpt-5.4-pro": { + "name": "GPT-5.4-PRO (via AI Gateway)", "limit": { - "context": 1000000, - "output": 64000 + "context": 1050000, + "output": 128000 } }, - "openai/gpt-4o": { - "name": "GPT-4o (via AI Gateway)", + "openai/gpt-5.5-pro": { + "name": "GPT-5.5-PRO (via AI Gateway)", "limit": { - "context": 128000, - "output": 16384 + "context": 1050000, + "output": 128000 } }, - "openai/gpt-4o-mini": { - "name": "GPT-4o mini (via AI Gateway)", - "limit": { - "context": 128000, - "output": 16384 - } + "deepseek/deepseek-v4-pro": { + "name": "DeepSeek V4 Pro (via AI Gateway)" }, - "openai/o1": { - "name": "o1 (via AI Gateway)", - "limit": { - "context": 200000, - "output": 100000 - } - }, - "openai/o3-mini": { - "name": "o3-mini (via AI Gateway)", - "limit": { - "context": 200000, - "output": 100000 - }, - "variants": { - "low": { - "options": { - "reasoning_effort": "low" - } - }, - "medium": { - "options": { - "reasoning_effort": "medium" - } - }, - "high": { - "options": { - "reasoning_effort": "high" - } - } - } - }, - "openai/gpt-5-mini": { - "name": "GPT-5 mini (via AI Gateway)", - "limit": { - "context": 200000, - "output": 32768 - } - }, - "openai/gpt-5.6-sol": { - "name": "GPT-5.6-SOL (via AI Gateway)", - "limit": { - "context": 1050000, - "output": 128000 - } - }, - "openai/gpt-5.6-sol-fast": { - "name": "GPT-5.6-SOL-FAST (via AI Gateway)", - "limit": { - "context": 1050000, - "output": 128000 - } - }, - "openai/gpt-5.6-luna": { - "name": "GPT-5.6-LUNA (via AI Gateway)", - "limit": { - "context": 1050000, - "output": 128000 - } - }, - "openai/gpt-5.6-luna-fast": { - "name": "GPT-5.6-LUNA-FAST (via AI Gateway)", - "limit": { - "context": 1050000, - "output": 128000 - } - }, - "openai/gpt-5.6-terra": { - "name": "GPT-5.6-TERRA (via AI Gateway)", - "limit": { - "context": 1050000, - "output": 128000 - } - }, - "openai/gpt-5.6-terra-fast": { - "name": "GPT-5.6-TERRA-FAST (via AI Gateway)", - "limit": { - "context": 1050000, - "output": 128000 - } - }, - "openai/gpt-6-sol": { - "name": "GPT-6-SOL (via AI Gateway)", - "limit": { - "context": 1050000, - "output": 128000 - } - }, - "openai/gpt-6-sol-fast": { - "name": "GPT-6-SOL-FAST (via AI Gateway)", - "limit": { - "context": 1050000, - "output": 128000 - } - }, - "openai/gpt-6.1-sol": { - "name": "GPT-6.1-SOL (via AI Gateway)", - "limit": { - "context": 1050000, - "output": 128000 - } - }, - "openai/gpt-6.1-sol-fast": { - "name": "GPT-6.1-SOL-FAST (via AI Gateway)", - "limit": { - "context": 1050000, - "output": 128000 - } - }, - "openai/gpt-6-luna": { - "name": "GPT-6-LUNA (via AI Gateway)", - "limit": { - "context": 1050000, - "output": 128000 - } - }, - "openai/gpt-6-luna-fast": { - "name": "GPT-6-LUNA-FAST (via AI Gateway)", - "limit": { - "context": 1050000, - "output": 128000 - } - }, - "openai/gpt-6-astra": { - "name": "GPT-6-ASTRA (via AI Gateway)", - "limit": { - "context": 1050000, - "output": 128000 - } - }, - "openai/gpt-6-astra-fast": { - "name": "GPT-6-ASTRA-FAST (via AI Gateway)", - "limit": { - "context": 1050000, - "output": 128000 - } - }, - "openai/gpt-5.5": { - "name": "GPT-5.5 (via AI Gateway)", - "limit": { - "context": 1050000, - "output": 128000 - } - }, - "openai/gpt-5.5-fast": { - "name": "GPT-5.5-FAST (via AI Gateway)", - "limit": { - "context": 1050000, - "output": 128000 - } - }, - "openai/gpt-5.4": { - "name": "GPT-5.4 (via AI Gateway)", - "limit": { - "context": 1050000, - "output": 128000 - } - }, - "openai/gpt-5.4-pro": { - "name": "GPT-5.4-PRO (via AI Gateway)", - "limit": { - "context": 1050000, - "output": 128000 - } - }, - "openai/gpt-5.5-pro": { - "name": "GPT-5.5-PRO (via AI Gateway)", - "limit": { - "context": 1050000, - "output": 128000 - } - }, - "deepseek/deepseek-v4-pro": { - "name": "DeepSeek V4 Pro (via AI Gateway)" - }, - "minimax/m3.1-flash": { - "name": "MiniMax-M3.1-Flash (via AI Gateway)" + "minimax/m3.1-flash": { + "name": "MiniMax-M3.1-Flash (via AI Gateway)" }, "alibaba/qwen3.8-max": { "name": "Qwen3.8 Max (via AI Gateway)" @@ -1262,2637 +809,18 @@ } } - }, - "google": { - "models": { - "antigravity-claude-sonnet-5.5": { - "name": "Claude Sonnet 5.5 (Antigravity)", - "limit": { - "context": 1000000, - "output": 64000 - }, - "modalities": { - "input": [ - "text", - "image", - "pdf" - ], - "output": [ - "text" - ] - }, - "variants": { - "low": { - "thinkingConfig": { - "thinkingBudget": 4096 - } - }, - "medium": { - "thinkingConfig": { - "thinkingBudget": 16384 - } - }, - "high": { - "thinkingConfig": { - "thinkingBudget": 32768 - } - }, - "xhigh": { - "thinkingConfig": { - "thinkingBudget": 48000 - } - }, - "max": { - "thinkingConfig": { - "thinkingBudget": 64000 - } - } - } - }, - "antigravity-claude-sonnet-5.5-thinking": { - "name": "Claude Sonnet 5.5 Thinking (Antigravity)", - "limit": { - "context": 1000000, - "output": 64000 - }, - "modalities": { - "input": [ - "text", - "image", - "pdf" - ], - "output": [ - "text" - ] - }, - "variants": { - "low": { - "thinkingConfig": { - "thinkingBudget": 4096 - } - }, - "medium": { - "thinkingConfig": { - "thinkingBudget": 16384 - } - }, - "high": { - "thinkingConfig": { - "thinkingBudget": 32768 - } - }, - "xhigh": { - "thinkingConfig": { - "thinkingBudget": 48000 - } - }, - "max": { - "thinkingConfig": { - "thinkingBudget": 64000 - } - } - } - }, - "antigravity-claude-sonnet-5-5": { - "name": "Claude Sonnet 5.5 (Antigravity, agy-compat)", - "limit": { - "context": 1000000, - "output": 64000 - }, - "modalities": { - "input": [ - "text", - "image", - "pdf" - ], - "output": [ - "text" - ] - }, - "variants": { - "low": { - "thinkingConfig": { - "thinkingBudget": 4096 - } - }, - "medium": { - "thinkingConfig": { - "thinkingBudget": 16384 - } - }, - "high": { - "thinkingConfig": { - "thinkingBudget": 32768 - } - }, - "xhigh": { - "thinkingConfig": { - "thinkingBudget": 48000 - } - }, - "max": { - "thinkingConfig": { - "thinkingBudget": 64000 - } - } - } - }, - "antigravity-claude-opus-5.5": { - "name": "Claude Opus 5.5 (Antigravity)", - "limit": { - "context": 1000000, - "output": 64000 - }, - "modalities": { - "input": [ - "text", - "image", - "pdf" - ], - "output": [ - "text" - ] - }, - "variants": { - "low": { - "thinkingConfig": { - "thinkingBudget": 8192 - } - }, - "medium": { - "thinkingConfig": { - "thinkingBudget": 16384 - } - }, - "high": { - "thinkingConfig": { - "thinkingBudget": 32768 - } - }, - "xhigh": { - "thinkingConfig": { - "thinkingBudget": 48000 - } - }, - "max": { - "thinkingConfig": { - "thinkingBudget": 64000 - } - } - } - }, - "antigravity-claude-opus-5.5-thinking": { - "name": "Claude Opus 5.5 Thinking (Antigravity)", - "limit": { - "context": 1000000, - "output": 64000 - }, - "modalities": { - "input": [ - "text", - "image", - "pdf" - ], - "output": [ - "text" - ] - }, - "variants": { - "low": { - "thinkingConfig": { - "thinkingBudget": 8192 - } - }, - "medium": { - "thinkingConfig": { - "thinkingBudget": 16384 - } - }, - "high": { - "thinkingConfig": { - "thinkingBudget": 32768 - } - }, - "xhigh": { - "thinkingConfig": { - "thinkingBudget": 48000 - } - }, - "max": { - "thinkingConfig": { - "thinkingBudget": 64000 - } - } - } - }, - "antigravity-claude-opus-5-5": { - "name": "Claude Opus 5.5 (Antigravity, agy-compat)", - "limit": { - "context": 1000000, - "output": 64000 - }, - "modalities": { - "input": [ - "text", - "image", - "pdf" - ], - "output": [ - "text" - ] - }, - "variants": { - "low": { - "thinkingConfig": { - "thinkingBudget": 8192 - } - }, - "medium": { - "thinkingConfig": { - "thinkingBudget": 16384 - } - }, - "high": { - "thinkingConfig": { - "thinkingBudget": 32768 - } - }, - "xhigh": { - "thinkingConfig": { - "thinkingBudget": 48000 - } - }, - "max": { - "thinkingConfig": { - "thinkingBudget": 64000 - } - } - } - }, - "antigravity-claude-sonnet-4-6": { - "name": "Claude Sonnet 4.6 (Antigravity)", - "limit": { - "context": 1000000, - "output": 64000 - }, - "modalities": { - "input": [ - "text", - "image", - "pdf" - ], - "output": [ - "text" - ] - } - }, - "antigravity-claude-opus-4-6-thinking": { - "name": "Claude Opus 4.6 Thinking (Antigravity)", - "limit": { - "context": 1000000, - "output": 64000 - }, - "modalities": { - "input": [ - "text", - "image", - "pdf" - ], - "output": [ - "text" - ] - }, - "variants": { - "low": { - "thinkingConfig": { - "thinkingBudget": 8192 - } - }, - "medium": { - "thinkingConfig": { - "thinkingBudget": 16384 - } - }, - "high": { - "thinkingConfig": { - "thinkingBudget": 32768 - } - }, - "max": { - "thinkingConfig": { - "thinkingBudget": 64000 - } - } - } - }, - "antigravity-gemini-3.8-flash": { - "name": "Gemini 3.8 Flash (Antigravity)", - "limit": { - "context": 1048576, - "output": 65536 - }, - "modalities": { - "input": [ - "text", - "image", - "pdf" - ], - "output": [ - "text" - ] - }, - "variants": { - "minimal": { - "thinkingLevel": "minimal" - }, - "low": { - "thinkingLevel": "low" - }, - "medium": { - "thinkingLevel": "medium" - }, - "high": { - "thinkingLevel": "high" - }, - "max": { - "thinkingLevel": "high" - } - } - }, - "antigravity-gemini-3.7-flash": { - "name": "Gemini 3.7 Flash (Antigravity)", - "limit": { - "context": 1048576, - "output": 65536 - }, - "modalities": { - "input": [ - "text", - "image", - "pdf" - ], - "output": [ - "text" - ] - }, - "variants": { - "minimal": { - "thinkingLevel": "minimal" - }, - "low": { - "thinkingLevel": "low" - }, - "medium": { - "thinkingLevel": "medium" - }, - "high": { - "thinkingLevel": "high" - } - } - }, - "antigravity-gemini-3.6-flash": { - "name": "Gemini 3.6 Flash (Antigravity)", - "limit": { - "context": 1048576, - "output": 65536 - }, - "modalities": { - "input": [ - "text", - "image", - "pdf" - ], - "output": [ - "text" - ] - }, - "variants": { - "low": { - "thinkingLevel": "low" - }, - "medium": { - "thinkingLevel": "medium" - }, - "high": { - "thinkingLevel": "high" - } - } - }, - "antigravity-gemini-3.1-pro": { - "name": "Gemini 3.1 Pro (Antigravity)", - "limit": { - "context": 1048576, - "output": 65536 - }, - "modalities": { - "input": [ - "text", - "image", - "pdf" - ], - "output": [ - "text" - ] - }, - "variants": { - "low": { - "thinkingLevel": "low" - }, - "high": { - "thinkingLevel": "high" - }, - "max": { - "thinkingLevel": "high" - } - } - }, - "antigravity-gpt-oss-120b": { - "name": "GPT-OSS 120B (Antigravity)", - "limit": { - "context": 131072, - "output": 16384 - }, - "modalities": { - "input": [ - "text" - ], - "output": [ - "text" - ] - }, - "variants": { - "low": { - "thinkingLevel": "low" - }, - "medium": { - "thinkingLevel": "medium" - }, - "high": { - "thinkingLevel": "high" - } - } - }, - "gemini-flash-latest": { - "name": "Gemini Flash Latest", - "limit": { - "context": 1048576, - "output": 65536 - }, - "variants": { - "low": { - "options": { - "thinkingLevel": "low" - } - }, - "high": { - "options": { - "thinkingLevel": "high" - } - } - } - }, - "gemma-4-31b-it": { - "name": "Gemma 4 31B IT", - "limit": { - "context": 262144, - "output": 32768 - }, - "variants": { - "low": { - "options": { - "thinkingLevel": "low" - } - }, - "high": { - "options": { - "thinkingLevel": "high" - } - } - } - }, - "gemini-omni-flash-preview": { - "name": "Gemini Omni Flash Preview", - "limit": { - "context": 131072, - "output": 65536 - }, - "variants": { - "low": { - "options": { - "thinkingLevel": "low" - } - }, - "high": { - "options": { - "thinkingLevel": "high" - } - } - } - }, - "gemini-3.1-flash-image-preview": { - "name": "Nano Banana 2", - "limit": { - "context": 65536, - "output": 65536 - }, - "variants": { - "low": { - "options": { - "thinkingLevel": "low" - } - }, - "high": { - "options": { - "thinkingLevel": "high" - } - } - } - }, - "veo-3.1-lite-generate-preview": { - "name": "Veo 3.1 lite", - "limit": { - "context": 480, - "output": 8192 - } - }, - "lyria-3-pro-preview": { - "name": "Lyria 3 Pro Preview", - "limit": { - "context": 1048576, - "output": 65536 - } - }, - "gemini-3.1-flash-tts-preview": { - "name": "Gemini 3.1 Flash TTS Preview", - "limit": { - "context": 8192, - "output": 16384 - }, - "variants": { - "low": { - "options": { - "thinkingLevel": "low" - } - }, - "high": { - "options": { - "thinkingLevel": "high" - } - } - } - }, - "gemini-2.5-flash-image": { - "name": "Nano Banana", - "limit": { - "context": 32768, - "output": 32768 - }, - "variants": { - "low": { - "options": { - "thinkingLevel": "low" - } - }, - "high": { - "options": { - "thinkingLevel": "high" - } - } - } - }, - "gemini-flash-lite-latest": { - "name": "Gemini Flash-Lite Latest", - "limit": { - "context": 1048576, - "output": 65536 - }, - "variants": { - "low": { - "options": { - "thinkingLevel": "low" - } - }, - "high": { - "options": { - "thinkingLevel": "high" - } - } - } - }, - "gemini-embedding-2": { - "name": "Gemini Embedding 2", - "limit": { - "context": 8192, - "output": 1 - } - }, - "gemini-3.6-flash": { - "name": "Gemini 3.6 Flash", - "limit": { - "context": 1048576, - "output": 65536 - }, - "variants": { - "low": { - "options": { - "thinkingLevel": "low" - } - }, - "high": { - "options": { - "thinkingLevel": "high" - } - } - } - }, - "gemma-4-26b-a4b-it": { - "name": "Gemma 4 26B A4B IT", - "limit": { - "context": 262144, - "output": 32768 - }, - "variants": { - "low": { - "options": { - "thinkingLevel": "low" - } - }, - "high": { - "options": { - "thinkingLevel": "high" - } - } - } - }, - "gemini-3-pro-image-preview": { - "name": "Nano Banana Pro", - "limit": { - "context": 131072, - "output": 32768 - }, - "variants": { - "low": { - "options": { - "thinkingLevel": "low" - } - }, - "high": { - "options": { - "thinkingLevel": "high" - } - } - } - }, - "gemini-2.5-pro-preview-tts": { - "name": "Gemini 2.5 Pro Preview TTS", - "limit": { - "context": 8192, - "output": 16384 - } - }, - "gemini-3.5-flash-lite": { - "name": "Gemini 3.5 Flash Lite", - "limit": { - "context": 1048576, - "output": 65536 - }, - "variants": { - "low": { - "options": { - "thinkingLevel": "low" - } - }, - "high": { - "options": { - "thinkingLevel": "high" - } - } - } - }, - "gemini-3.1-flash-image": { - "name": "Nano Banana 2", - "limit": { - "context": 131072, - "output": 32768 - }, - "variants": { - "low": { - "options": { - "thinkingLevel": "low" - } - }, - "high": { - "options": { - "thinkingLevel": "high" - } - } - } - }, - "lyria-3-clip-preview": { - "name": "Lyria 3 Clip Preview", - "limit": { - "context": 1048576, - "output": 65536 - } - }, - "gemini-3.1-pro-preview": { - "name": "Gemini 3.1 Pro Preview", - "limit": { - "context": 1048576, - "output": 65536 - }, - "variants": { - "low": { - "options": { - "thinkingLevel": "low" - } - }, - "high": { - "options": { - "thinkingLevel": "high" - } - } - } - }, - "gemini-2.5-computer-use-preview-10-2025": { - "name": "Gemini 2.5 Computer Use Preview 10-2025", - "limit": { - "context": 128000, - "output": 64000 - }, - "variants": { - "low": { - "options": { - "thinkingLevel": "low" - } - }, - "high": { - "options": { - "thinkingLevel": "high" - } - } - } - }, - "gemini-3.5-flash": { - "name": "Gemini 3.5 Flash", - "limit": { - "context": 1048576, - "output": 65536 - }, - "variants": { - "low": { - "options": { - "thinkingLevel": "low" - } - }, - "high": { - "options": { - "thinkingLevel": "high" - } - } - } - }, - "gemini-2.5-pro": { - "name": "Gemini 2.5 Pro", - "limit": { - "context": 1048576, - "output": 65536 - }, - "variants": { - "low": { - "options": { - "thinkingLevel": "low" - } - }, - "high": { - "options": { - "thinkingLevel": "high" - } - } - } - }, - "gemini-3-pro-image": { - "name": "Nano Banana Pro", - "limit": { - "context": 65536, - "output": 32768 - }, - "variants": { - "low": { - "options": { - "thinkingLevel": "low" - } - }, - "high": { - "options": { - "thinkingLevel": "high" - } - } - } - }, - "gemini-2.5-flash": { - "name": "Gemini 2.5 Flash", - "limit": { - "context": 1048576, - "output": 65536 - }, - "variants": { - "low": { - "options": { - "thinkingLevel": "low" - } - }, - "high": { - "options": { - "thinkingLevel": "high" - } - } - } - }, - "gemini-2.5-flash-preview-tts": { - "name": "Gemini 2.5 Flash Preview TTS", - "limit": { - "context": 8192, - "output": 16384 - } - }, - "gemini-3.1-flash-lite-image": { - "name": "Nano Banana 2 Lite", - "limit": { - "context": 65536, - "output": 4096 - }, - "variants": { - "low": { - "options": { - "thinkingLevel": "low" - } - }, - "high": { - "options": { - "thinkingLevel": "high" - } - } - } - }, - "deep-research-preview-04-2026": { - "name": "Deep Research Preview (Apr-21-2026)", - "limit": { - "context": 131072, - "output": 65536 - }, - "variants": { - "low": { - "options": { - "thinkingLevel": "low" - } - }, - "high": { - "options": { - "thinkingLevel": "high" - } - } - } - }, - "deep-research-max-preview-04-2026": { - "name": "Deep Research Max Preview (Apr-21-2026)", - "limit": { - "context": 131072, - "output": 65536 - }, - "variants": { - "low": { - "options": { - "thinkingLevel": "low" - } - }, - "high": { - "options": { - "thinkingLevel": "high" - } - } - } - }, - "veo-3.1-fast-generate-preview": { - "name": "Veo 3.1 fast", - "limit": { - "context": 480, - "output": 8192 - } - }, - "gemini-3.7-flash": { - "name": "Gemini 3.7 Flash", - "limit": { - "context": 1048576, - "output": 65536 - }, - "variants": { - "low": { - "options": { - "thinkingLevel": "low" - } - }, - "high": { - "options": { - "thinkingLevel": "high" - } - } - } - }, - "veo-3.1-generate-preview": { - "name": "Veo 3.1", - "limit": { - "context": 480, - "output": 8192 - } - }, - "gemini-3.1-pro-preview-customtools": { - "name": "Gemini 3.1 Pro Preview Custom Tools", - "limit": { - "context": 1048576, - "output": 65536 - }, - "variants": { - "low": { - "options": { - "thinkingLevel": "low" - } - }, - "high": { - "options": { - "thinkingLevel": "high" - } - } - } - }, - "gemini-3-flash-preview": { - "name": "Gemini 3 Flash Preview", - "limit": { - "context": 1048576, - "output": 65536 - }, - "variants": { - "low": { - "options": { - "thinkingLevel": "low" - } - }, - "high": { - "options": { - "thinkingLevel": "high" - } - } - } - }, - "gemini-3.8-flash": { - "name": "Gemini 3.8 Flash", - "limit": { - "context": 1048576, - "output": 65536 - }, - "variants": { - "low": { - "options": { - "thinkingLevel": "low" - } - }, - "high": { - "options": { - "thinkingLevel": "high" - } - } - } - }, - "gemini-3.5-live-translate-preview": { - "name": "Gemini 3.5 Live Translate Preview", - "limit": { - "context": 16384, - "output": 32768 - } - }, - "gemini-2.5-flash-lite": { - "name": "Gemini 2.5 Flash-Lite", - "limit": { - "context": 1048576, - "output": 65536 - }, - "variants": { - "low": { - "options": { - "thinkingLevel": "low" - } - }, - "high": { - "options": { - "thinkingLevel": "high" - } - } - } - }, - "gemini-embedding-001": { - "name": "Gemini Embedding 001", - "limit": { - "context": 2048, - "output": 1 - } - }, - "gemini-3.1-flash-lite-preview": { - "name": "Gemini 3.1 Flash Lite Preview", - "limit": { - "context": 1048576, - "output": 65536 - }, - "variants": { - "low": { - "options": { - "thinkingLevel": "low" - } - }, - "high": { - "options": { - "thinkingLevel": "high" - } - } - } - }, - "gemini-3.1-flash-live-preview": { - "name": "Gemini 3.1 Flash Live Preview", - "limit": { - "context": 131072, - "output": 65536 - }, - "variants": { - "low": { - "options": { - "thinkingLevel": "low" - } - }, - "high": { - "options": { - "thinkingLevel": "high" - } - } - } - }, - "gemini-3.1-flash-lite": { - "name": "Gemini 3.1 Flash Lite", - "limit": { - "context": 1048576, - "output": 65536 - }, - "variants": { - "low": { - "options": { - "thinkingLevel": "low" - } - }, - "high": { - "options": { - "thinkingLevel": "high" - } - } - } - }, - "gemini-4-argon": { - "name": "Gemini 4 Argon", - "limit": { - "context": 1048576, - "output": 32768 - }, - "variants": { - "low": { - "options": { - "thinkingLevel": "low" - } - }, - "high": { - "options": { - "thinkingLevel": "high" - } - } - } - }, - "gemini-pro-latest": { - "name": "Gemini Pro Latest", - "limit": { - "context": 1048576, - "output": 65536 - }, - "variants": { - "low": { - "options": { - "thinkingLevel": "low" - } - }, - "high": { - "options": { - "thinkingLevel": "high" - } - } - } - } - } - }, - "antigravity-agy": { - "npm": "@ai-sdk/openai-compatible", - "name": "Antigravity CLI (via agy)", - "options": { - "baseURL": "http://127.0.0.1:{env:AGY_PROXY_PORT:-18743}/v1", - "apiKey": "agy-local" - }, - "models": { - "gemini-4-argon": { - "name": "Gemini 4 Argon (agy)", - "variants": { - "low": { - "options": { - "reasoning_effort": "low" - } - }, - "medium": { - "options": { - "reasoning_effort": "medium" - } - }, - "high": { - "options": { - "reasoning_effort": "high" - } - } - }, - "limit": { - "context": 1048576, - "output": 65536 - } - }, - "gemini-4-argon-low": { - "name": "Gemini 4 Argon Low (agy)" - }, - "gemini-4-argon-medium": { - "name": "Gemini 4 Argon Medium (agy)" - }, - "gemini-4-argon-high": { - "name": "Gemini 4 Argon High (agy)" - }, - "gemini-3.8-flash": { - "name": "Gemini 3.8 Flash (agy)", - "variants": { - "low": { - "options": { - "reasoning_effort": "low" - } - }, - "medium": { - "options": { - "reasoning_effort": "medium" - } - }, - "high": { - "options": { - "reasoning_effort": "high" - } - } - }, - "limit": { - "context": 1048576, - "output": 65536 - } - }, - "claude-sonnet-5-5": { - "name": "Claude Sonnet 5.5 (agy)", - "variants": { - "low": { - "options": { - "reasoning_effort": "low" - } - }, - "medium": { - "options": { - "reasoning_effort": "medium" - } - }, - "high": { - "options": { - "reasoning_effort": "high" - } - } - }, - "limit": { - "context": 1000000, - "output": 64000 - } - }, - "claude-opus-5-5": { - "name": "Claude Opus 5.5 (agy)", - "variants": { - "low": { - "options": { - "reasoning_effort": "low" - } - }, - "medium": { - "options": { - "reasoning_effort": "medium" - } - }, - "high": { - "options": { - "reasoning_effort": "high" - } - } - }, - "limit": { - "context": 1000000, - "output": 64000 - } - }, - "gemini-2.5-flash": { - "name": "Gemini 3.5 Flash Lite (agy)", - "limit": { - "context": 1048576, - "output": 65536 - } - }, - "gemini-2.5-flash-lite": { - "name": "Gemini 3.5 Flash Lite (agy)", - "limit": { - "context": 1048576, - "output": 65536 - } - }, - "gemini-2.5-flash-thinking": { - "name": "Gemini 3.5 Flash Lite (agy)", - "limit": { - "context": 1048576, - "output": 65536 - } - }, - "gemini-2.5-pro": { - "name": "Gemini 2.5 Pro (agy)", - "limit": { - "context": 1048576, - "output": 65536 - } - }, - "gemini-3-flash": { - "name": "Gemini 3 Flash (agy)", - "limit": { - "context": 1048576, - "output": 65536 - } - }, - "gemini-3.1-flash-image": { - "name": "Gemini 3.1 Flash Image (agy)", - "limit": { - "context": 1048576, - "output": 65536 - } - }, - "gemini-3.1-flash-lite": { - "name": "Gemini 3.1 Flash Lite (agy)", - "limit": { - "context": 1048576, - "output": 65536 - } - }, - "gemini-3.5-flash-lite": { - "name": "Gemini 3.5 Flash Lite (agy)", - "limit": { - "context": 1048576, - "output": 65536 - } - }, - "gemini-3.8-flash-tiered": { - "name": "gemini-3.8-flash-tiered (agy)", - "limit": { - "context": 1048576, - "output": 65536 - } - }, - "gpt-oss-120b": { - "name": "GPT-OSS 120B (agy)", - "limit": { - "context": 131072, - "output": 16384 - }, - "variants": { - "medium": { - "options": { - "reasoning_effort": "medium" - } - } - } - }, - "gemini-3.8-flash-low": { - "name": "Gemini 3.8 Flash Low (agy)" - }, - "gemini-3.8-flash-medium": { - "name": "Gemini 3.8 Flash Medium (agy)" - }, - "gemini-3.8-flash-high": { - "name": "Gemini 3.8 Flash High (agy)" - }, - "gemini-3.7-flash": { - "name": "Gemini 3.7 Flash (agy)" - }, - "gemini-3.7-flash-low": { - "name": "Gemini 3.7 Flash Low (agy)" - }, - "gemini-3.7-flash-medium": { - "name": "Gemini 3.7 Flash Medium (agy)" - }, - "gemini-3.7-flash-high": { - "name": "Gemini 3.7 Flash High (agy)" - }, - "gemini-3.6-flash": { - "name": "Gemini 3.6 Flash (agy)" - }, - "gemini-3.6-flash-low": { - "name": "Gemini 3.6 Flash Low (agy)" - }, - "gemini-3.6-flash-medium": { - "name": "Gemini 3.6 Flash Medium (agy)" - }, - "gemini-3.6-flash-high": { - "name": "Gemini 3.6 Flash High (agy)" - }, - "gemini-3.1-pro": { - "name": "Gemini 3.1 Pro (agy)" - }, - "gemini-3.1-pro-low": { - "name": "Gemini 3.1 Pro Low (agy)" - }, - "gemini-3.1-pro-high": { - "name": "Gemini 3.1 Pro High (agy)" - }, - "claude-sonnet-5-5-low": { - "name": "Claude Sonnet 5.5 Low (agy)" - }, - "claude-sonnet-5-5-medium": { - "name": "Claude Sonnet 5.5 Medium (agy)" - }, - "claude-sonnet-5-5-high": { - "name": "Claude Sonnet 5.5 High (agy)" - }, - "claude-opus-5-5-low": { - "name": "Claude Opus 5.5 Low (agy)" - }, - "claude-opus-5-5-medium": { - "name": "Claude Opus 5.5 Medium (agy)" - }, - "claude-opus-5-5-high": { - "name": "Claude Opus 5.5 High (agy)" - }, - "gpt-oss-120b-medium": { - "name": "GPT-OSS 120B Medium (agy)" - } - - } - }, - "antigravity-direct": { - "npm": "@ai-sdk/openai-compatible", - "name": "Antigravity Direct (CLI wire clone)", - "options": { - "baseURL": "http://127.0.0.1:{env:ANTIGRAVITY_DIRECT_PORT:-18751}/v1", - "apiKey": "antigravity-direct-local" - }, - "models": { - "gemini-4-argon": { - "name": "Gemini 4 Argon (direct)", - "variants": { - "low": { - "options": { - "reasoning_effort": "low" - } - }, - "medium": { - "options": { - "reasoning_effort": "medium" - } - }, - "high": { - "options": { - "reasoning_effort": "high" - } - } - }, - "limit": { - "context": 1048576, - "output": 65536 - } - }, - "gemini-4-argon-low": { - "name": "Gemini 4 Argon Low (direct)" - }, - "gemini-4-argon-medium": { - "name": "Gemini 4 Argon Medium (direct)" - }, - "gemini-4-argon-high": { - "name": "Gemini 4 Argon High (direct)" - }, - "gemini-3.8-flash": { - "name": "Gemini 3.8 Flash (direct)", - "variants": { - "low": { - "options": { - "reasoning_effort": "low" - } - }, - "medium": { - "options": { - "reasoning_effort": "medium" - } - }, - "high": { - "options": { - "reasoning_effort": "high" - } - } - }, - "limit": { - "context": 1048576, - "output": 65536 - } - }, - "gemini-3.8-flash-low": { - "name": "Gemini 3.8 Flash Low (direct)" - }, - "gemini-3.8-flash-medium": { - "name": "Gemini 3.8 Flash Medium (direct)" - }, - "gemini-3.8-flash-high": { - "name": "Gemini 3.8 Flash High (direct)" - }, - "claude-sonnet-5-5": { - "name": "Claude Sonnet 5.5 (direct)", - "variants": { - "low": { - "options": { - "reasoning_effort": "low" - } - }, - "medium": { - "options": { - "reasoning_effort": "medium" - } - }, - "high": { - "options": { - "reasoning_effort": "high" - } - } - }, - "limit": { - "context": 1000000, - "output": 64000 - } - }, - "claude-sonnet-5-5-low": { - "name": "Claude Sonnet 5.5 Low (direct)" - }, - "claude-sonnet-5-5-medium": { - "name": "Claude Sonnet 5.5 Medium (direct)" - }, - "claude-sonnet-5-5-high": { - "name": "Claude Sonnet 5.5 High (direct)" - }, - "claude-opus-5-5": { - "name": "Claude Opus 5.5 (direct)", - "variants": { - "low": { - "options": { - "reasoning_effort": "low" - } - }, - "medium": { - "options": { - "reasoning_effort": "medium" - } - }, - "high": { - "options": { - "reasoning_effort": "high" - } - } - }, - "limit": { - "context": 1000000, - "output": 64000 - } - }, - "claude-opus-5-5-low": { - "name": "Claude Opus 5.5 Low (direct)" - }, - "claude-opus-5-5-medium": { - "name": "Claude Opus 5.5 Medium (direct)" - }, - "claude-opus-5-5-high": { - "name": "Claude Opus 5.5 High (direct)" - }, - "gpt-oss-120b": { - "name": "GPT-OSS 120B (direct)", - "limit": { - "context": 131072, - "output": 16384 - }, - "variants": { - "medium": { - "options": { - "reasoning_effort": "medium" - } - } - } - }, - "gpt-oss-120b-medium": { - "name": "GPT-OSS 120B Medium (direct)" - }, - "gemini-2.5-flash": { - "name": "Gemini 3.5 Flash Lite (direct)", - "limit": { - "context": 1048576, - "output": 65536 - } - }, - "gemini-2.5-flash-lite": { - "name": "Gemini 3.5 Flash Lite (direct)", - "limit": { - "context": 1048576, - "output": 65536 - } - }, - "gemini-2.5-flash-thinking": { - "name": "Gemini 3.5 Flash Lite (direct)", - "limit": { - "context": 1048576, - "output": 65536 - } - }, - "gemini-2.5-pro": { - "name": "Gemini 2.5 Pro (direct)", - "limit": { - "context": 1048576, - "output": 65536 - } - }, - "gemini-3-flash": { - "name": "Gemini 3 Flash (direct)", - "limit": { - "context": 1048576, - "output": 65536 - } - }, - "gemini-3.1-flash-image": { - "name": "Gemini 3.1 Flash Image (direct)", - "limit": { - "context": 1048576, - "output": 65536 - } - }, - "gemini-3.1-flash-lite": { - "name": "Gemini 3.1 Flash Lite (direct)", - "limit": { - "context": 1048576, - "output": 65536 - } - }, - "gemini-3.5-flash-lite": { - "name": "Gemini 3.5 Flash Lite (direct)", - "limit": { - "context": 1048576, - "output": 65536 - } - }, - "gemini-3.8-flash-tiered": { - "name": "gemini-3.8-flash-tiered (direct)", - "limit": { - "context": 1048576, - "output": 65536 - } - } - } - }, - "antigravity-ls": { - "npm": "@ai-sdk/openai-compatible", - "name": "Antigravity Language Server (Direct gRPC/ConnectRPC)", - "options": { - "baseURL": "http://127.0.0.1:{env:ANTIGRAVITY_LS_PROXY_PORT:-18745}/v1", - "apiKey": "antigravity-local" - }, - "models": { - "gemini-3.8-flash": { - "name": "Gemini 3.8 Flash (Direct LS)", - "variants": { - "low": { - "options": { - "reasoning_effort": "low" - } - }, - "medium": { - "options": { - "reasoning_effort": "medium" - } - }, - "high": { - "options": { - "reasoning_effort": "high" - } - } - }, - "limit": { - "context": 1048576, - "output": 65536 - } - }, - "claude-sonnet-5-5": { - "name": "Claude Sonnet 5.5 (Direct LS)", - "variants": { - "low": { - "options": { - "reasoning_effort": "low" - } - }, - "medium": { - "options": { - "reasoning_effort": "medium" - } - }, - "high": { - "options": { - "reasoning_effort": "high" - } - } - }, - "limit": { - "context": 1000000, - "output": 64000 - } - }, - "claude-opus-5-5": { - "name": "Claude Opus 5.5 (Direct LS)", - "variants": { - "low": { - "options": { - "reasoning_effort": "low" - } - }, - "medium": { - "options": { - "reasoning_effort": "medium" - } - }, - "high": { - "options": { - "reasoning_effort": "high" - } - } - }, - "limit": { - "context": 1000000, - "output": 64000 - } - }, - "gemini-2.5-flash": { - "name": "Gemini 3.5 Flash Lite (Direct LS)", - "limit": { - "context": 1048576, - "output": 65536 - } - }, - "gemini-2.5-flash-lite": { - "name": "Gemini 3.5 Flash Lite (Direct LS)", - "limit": { - "context": 1048576, - "output": 65536 - } - }, - "gemini-2.5-flash-thinking": { - "name": "Gemini 3.5 Flash Lite (Direct LS)", - "limit": { - "context": 1048576, - "output": 65536 - } - }, - "gemini-2.5-pro": { - "name": "Gemini 2.5 Pro (Direct LS)", - "limit": { - "context": 1048576, - "output": 65536 - } - }, - "gemini-3-flash": { - "name": "Gemini 3 Flash (Direct LS)", - "limit": { - "context": 1048576, - "output": 65536 - } - }, - "gemini-3.1-flash-image": { - "name": "Gemini 3.1 Flash Image (Direct LS)", - "limit": { - "context": 1048576, - "output": 65536 - } - }, - "gemini-3.1-flash-lite": { - "name": "Gemini 3.1 Flash Lite (Direct LS)", - "limit": { - "context": 1048576, - "output": 65536 - } - }, - "gemini-3.5-flash-lite": { - "name": "Gemini 3.5 Flash Lite (Direct LS)", - "limit": { - "context": 1048576, - "output": 65536 - } - }, - "gemini-3.8-flash-tiered": { - "name": "gemini-3.8-flash-tiered (Direct LS)", - "limit": { - "context": 1048576, - "output": 65536 - } - }, - "gpt-oss-120b": { - "name": "GPT-OSS 120B (Direct LS)", - "limit": { - "context": 131072, - "output": 16384 - }, - "variants": { - "medium": { - "options": { - "reasoning_effort": "medium" - } - } - } - }, - "gemini-3.8-flash-low": { - "name": "Gemini 3.8 Flash Low (Direct LS)" - }, - "gemini-3.8-flash-medium": { - "name": "Gemini 3.8 Flash Medium (Direct LS)" - }, - "gemini-3.8-flash-high": { - "name": "Gemini 3.8 Flash High (Direct LS)" - }, - "gemini-3.7-flash": { - "name": "Gemini 3.7 Flash (Direct LS)" - }, - "gemini-3.7-flash-low": { - "name": "Gemini 3.7 Flash Low (Direct LS)" - }, - "gemini-3.7-flash-medium": { - "name": "Gemini 3.7 Flash Medium (Direct LS)" - }, - "gemini-3.7-flash-high": { - "name": "Gemini 3.7 Flash High (Direct LS)" - }, - "gemini-3.6-flash": { - "name": "Gemini 3.6 Flash (Direct LS)" - }, - "gemini-3.6-flash-low": { - "name": "Gemini 3.6 Flash Low (Direct LS)" - }, - "gemini-3.6-flash-medium": { - "name": "Gemini 3.6 Flash Medium (Direct LS)" - }, - "gemini-3.6-flash-high": { - "name": "Gemini 3.6 Flash High (Direct LS)" - }, - "gemini-3.1-pro": { - "name": "Gemini 3.1 Pro (Direct LS)" - }, - "gemini-3.1-pro-low": { - "name": "Gemini 3.1 Pro Low (Direct LS)" - }, - "gemini-3.1-pro-high": { - "name": "Gemini 3.1 Pro High (Direct LS)" - }, - "claude-sonnet-5-5-low": { - "name": "Claude Sonnet 5.5 Low (Direct LS)" - }, - "claude-sonnet-5-5-medium": { - "name": "Claude Sonnet 5.5 Medium (Direct LS)" - }, - "claude-sonnet-5-5-high": { - "name": "Claude Sonnet 5.5 High (Direct LS)" - }, - "claude-opus-5-5-low": { - "name": "Claude Opus 5.5 Low (Direct LS)" - }, - "claude-opus-5-5-medium": { - "name": "Claude Opus 5.5 Medium (Direct LS)" - }, - "claude-opus-5-5-high": { - "name": "Claude Opus 5.5 High (Direct LS)" - }, - "gpt-oss-120b-medium": { - "name": "GPT-OSS 120B Medium (Direct LS)" - }, - "chat_20706": { - "name": "chat_20706 (Direct LS)" - }, - "chat_23310": { - "name": "chat_23310 (Direct LS)" - }, - "tab_flash_lite_preview": { - "name": "tab_flash_lite_preview (Direct LS)" - }, - "tab_jump_flash_lite_preview": { - "name": "tab_jump_flash_lite_preview (Direct LS)" - } - - } - }, - "openai": { - "models": { - "gpt-4o": { - "limit": { - "context": 128000, - "output": 16384 - } - }, - "gpt-4o-mini": { - "limit": { - "context": 128000, - "output": 16384 - } - }, - "o1": { - "limit": { - "context": 200000, - "output": 100000 - } - }, - "o3-mini": { - "limit": { - "context": 200000, - "output": 100000 - } - }, - "gpt-5.6-sol": { - "limit": { - "context": 1050000, - "output": 128000 - } - }, - "gpt-5.6-sol-fast": { - "limit": { - "context": 1050000, - "output": 128000 - } - }, - "gpt-5.6-luna": { - "limit": { - "context": 1050000, - "output": 128000 - } - }, - "gpt-5.6-luna-fast": { - "limit": { - "context": 1050000, - "output": 128000 - } - }, - "gpt-5.6-terra": { - "limit": { - "context": 1050000, - "output": 128000 - } - }, - "gpt-5.6-terra-fast": { - "limit": { - "context": 1050000, - "output": 128000 - } - }, - "gpt-6-sol": { - "limit": { - "context": 1050000, - "output": 128000 - } - }, - "gpt-6-sol-fast": { - "limit": { - "context": 1050000, - "output": 128000 - } - }, - "gpt-6.1-sol": { - "limit": { - "context": 1050000, - "output": 128000 - } - }, - "gpt-6.1-sol-fast": { - "limit": { - "context": 1050000, - "output": 128000 - } - }, - "gpt-6.1-terra": { - "limit": { - "context": 1050000, - "output": 128000 - } - }, - "gpt-6-luna": { - "limit": { - "context": 1050000, - "output": 128000 - } - }, - "gpt-6-luna-fast": { - "limit": { - "context": 1050000, - "output": 128000 - } - }, - "gpt-6-astra": { - "limit": { - "context": 1050000, - "output": 128000 - } - }, - "gpt-6-astra-fast": { - "limit": { - "context": 1050000, - "output": 128000 - } - }, - "gpt-5.5": { - "limit": { - "context": 1050000, - "output": 128000 - } - }, - "gpt-5.5-fast": { - "limit": { - "context": 1050000, - "output": 128000 - } - }, - "gpt-5.4": { - "limit": { - "context": 1050000, - "output": 128000 - } - }, - "gpt-5.4-pro": { - "limit": { - "context": 1050000, - "output": 128000 - } - }, - "gpt-5.5-pro": { - "limit": { - "context": 1050000, - "output": 128000 - } - }, - "gpt-5": { - "limit": { - "context": 400000, - "output": 128000 - } - }, - "gpt-5-mini": { - "limit": { - "context": 400000, - "output": 128000 - } - }, - "gpt-5.1": { - "limit": { - "context": 400000, - "output": 128000 - } - }, - "gpt-5.2": { - "limit": { - "context": 400000, - "output": 128000 - } - }, - "gpt-5.3-codex": { - "limit": { - "context": 400000, - "output": 128000 - } - }, - "gpt-5.4-mini": { - "limit": { - "context": 400000, - "output": 128000 - } - }, - "chatgpt-image-latest": { - "name": "chatgpt-image-latest", - "limit": { - "context": 0, - "input": 0, - "output": 0 - } - }, - "gpt-3.5-turbo": { - "name": "GPT-3.5-turbo", - "limit": { - "context": 16385, - "output": 4096 - } - }, - "text-embedding-3-small": { - "name": "text-embedding-3-small", - "limit": { - "context": 8191, - "output": 1536 - } - }, - "gpt-5.4-nano": { - "name": "GPT-5.4 nano", - "limit": { - "context": 400000, - "input": 272000, - "output": 128000 - }, - "variants": { - "low": { - "options": { - "reasoning_effort": "low" - } - }, - "medium": { - "options": { - "reasoning_effort": "medium" - } - }, - "high": { - "options": { - "reasoning_effort": "high" - } - } - } - }, - "gpt-realtime-2.1": { - "name": "GPT-Realtime-2.1", - "limit": { - "context": 128000, - "input": 96000, - "output": 32000 - }, - "variants": { - "low": { - "options": { - "reasoning_effort": "low" - } - }, - "medium": { - "options": { - "reasoning_effort": "medium" - } - }, - "high": { - "options": { - "reasoning_effort": "high" - } - } - } - }, - "gpt-4o-2024-05-13": { - "name": "GPT-4o (2024-05-13)", - "limit": { - "context": 128000, - "output": 4096 - } - }, - "gpt-image-2": { - "name": "gpt-image-2", - "limit": { - "context": 0, - "input": 0, - "output": 0 - } - }, - "gpt-5.2-pro": { - "name": "GPT-5.2 Pro", - "limit": { - "context": 400000, - "input": 272000, - "output": 128000 - }, - "variants": { - "low": { - "options": { - "reasoning_effort": "low" - } - }, - "medium": { - "options": { - "reasoning_effort": "medium" - } - }, - "high": { - "options": { - "reasoning_effort": "high" - } - } - } - }, - "o4-mini": { - "name": "o4-mini", - "limit": { - "context": 200000, - "output": 100000 - }, - "variants": { - "low": { - "options": { - "reasoning_effort": "low" - } - }, - "medium": { - "options": { - "reasoning_effort": "medium" - } - }, - "high": { - "options": { - "reasoning_effort": "high" - } - } - } - }, - "text-embedding-ada-002": { - "name": "text-embedding-ada-002", - "limit": { - "context": 8192, - "output": 1536 - } - }, - "gpt-4": { - "name": "GPT-4", - "limit": { - "context": 8192, - "output": 8192 - } - }, - "gpt-4.1-nano": { - "name": "GPT-4.1 nano", - "limit": { - "context": 1047576, - "output": 32768 - } - }, - "gpt-5-nano": { - "name": "GPT-5 Nano", - "limit": { - "context": 400000, - "input": 272000, - "output": 128000 - }, - "variants": { - "low": { - "options": { - "reasoning_effort": "low" - } - }, - "medium": { - "options": { - "reasoning_effort": "medium" - } - }, - "high": { - "options": { - "reasoning_effort": "high" - } - } - } - }, - "gpt-5.6": { - "name": "GPT-5.6", - "limit": { - "context": 1050000, - "input": 922000, - "output": 128000 - }, - "variants": { - "low": { - "options": { - "reasoning_effort": "low" - } - }, - "medium": { - "options": { - "reasoning_effort": "medium" - } - }, - "high": { - "options": { - "reasoning_effort": "high" - } - } - } - }, - "gpt-5.2-chat-latest": { - "name": "GPT-5.2 Chat", - "limit": { - "context": 128000, - "output": 16384 - }, - "variants": { - "low": { - "options": { - "reasoning_effort": "low" - } - }, - "medium": { - "options": { - "reasoning_effort": "medium" - } - }, - "high": { - "options": { - "reasoning_effort": "high" - } - } - } - }, - "gpt-5-pro": { - "name": "GPT-5 Pro", - "limit": { - "context": 400000, - "input": 272000, - "output": 272000 - }, - "variants": { - "low": { - "options": { - "reasoning_effort": "low" - } - }, - "medium": { - "options": { - "reasoning_effort": "medium" - } - }, - "high": { - "options": { - "reasoning_effort": "high" - } - } - } - }, - "gpt-5.3-codex-spark": { - "name": "GPT-5.3 Codex Spark", - "limit": { - "context": 128000, - "input": 100000, - "output": 32000 - }, - "variants": { - "low": { - "options": { - "reasoning_effort": "low" - } - }, - "medium": { - "options": { - "reasoning_effort": "medium" - } - }, - "high": { - "options": { - "reasoning_effort": "high" - } - } - } - }, - "text-embedding-3-large": { - "name": "text-embedding-3-large", - "limit": { - "context": 8191, - "output": 3072 - } - }, - "gpt-4o-2024-08-06": { - "name": "GPT-4o (2024-08-06)", - "limit": { - "context": 128000, - "output": 16384 - } - }, - "o3-pro": { - "name": "o3-pro", - "limit": { - "context": 200000, - "output": 100000 - }, - "variants": { - "low": { - "options": { - "reasoning_effort": "low" - } - }, - "medium": { - "options": { - "reasoning_effort": "medium" - } - }, - "high": { - "options": { - "reasoning_effort": "high" - } - } - } - }, - "gpt-image-1": { - "name": "gpt-image-1", - "limit": { - "context": 0, - "input": 0, - "output": 0 - } - }, - "gpt-daybreak-blue-latest": { - "name": "Daybreak Blue", - "limit": { - "context": 1050000, - "input": 922000, - "output": 128000 - }, - "variants": { - "low": { - "options": { - "reasoning_effort": "low" - } - }, - "medium": { - "options": { - "reasoning_effort": "medium" - } - }, - "high": { - "options": { - "reasoning_effort": "high" - } - } - } - }, - "gpt-4.1": { - "name": "GPT-4.1", - "limit": { - "context": 1047576, - "output": 32768 - } - }, - "gpt-4o-2024-11-20": { - "name": "GPT-4o (2024-11-20)", - "limit": { - "context": 128000, - "output": 16384 - } - }, - "gpt-4.1-mini": { - "name": "GPT-4.1 mini", - "limit": { - "context": 1047576, - "output": 32768 - } - }, - "gpt-5.3-chat-latest": { - "name": "GPT-5.3 Chat (latest)", - "limit": { - "context": 128000, - "output": 16384 - } - }, - "gpt-image-1-mini": { - "name": "gpt-image-1-mini", - "limit": { - "context": 0, - "input": 0, - "output": 0 - } - }, - "gpt-image-1.5": { - "name": "gpt-image-1.5", - "limit": { - "context": 0, - "input": 0, - "output": 0 - } - }, - "gpt-4-turbo": { - "name": "GPT-4 Turbo", - "limit": { - "context": 128000, - "output": 4096 - } - }, - "gpt-daybreak-red-latest": { - "name": "Daybreak Red", - "limit": { - "context": 400000, - "input": 272000, - "output": 128000 - }, - "variants": { - "low": { - "options": { - "reasoning_effort": "low" - } - }, - "medium": { - "options": { - "reasoning_effort": "medium" - } - }, - "high": { - "options": { - "reasoning_effort": "high" - } - } - } - }, - "o3": { - "name": "o3", - "limit": { - "context": 200000, - "output": 100000 - }, - "variants": { - "low": { - "options": { - "reasoning_effort": "low" - } - }, - "medium": { - "options": { - "reasoning_effort": "medium" - } - }, - "high": { - "options": { - "reasoning_effort": "high" - } - } - } - }, - "o1-pro": { - "name": "o1-pro", - "limit": { - "context": 200000, - "output": 100000 - }, - "variants": { - "low": { - "options": { - "reasoning_effort": "low" - } - }, - "medium": { - "options": { - "reasoning_effort": "medium" - } - }, - "high": { - "options": { - "reasoning_effort": "high" - } - } - } - } - } - }, - "openai-codex": { - "npm": "@ai-sdk/openai-compatible", - "name": "OpenAI Codex CLI (via codex)", - "options": { - "baseURL": "http://127.0.0.1:{env:CODEX_PROXY_PORT:-18744}/v1", - "apiKey": "codex-local" - }, - "models": { - "gpt-6.1-sol": { - "name": "GPT-6.1 Sol (codex)", - "variants": { - "low": { - "options": { - "reasoning_effort": "low" - } - }, - "medium": { - "options": { - "reasoning_effort": "medium" - } - }, - "high": { - "options": { - "reasoning_effort": "high" - } - }, - "xhigh": { - "options": { - "reasoning_effort": "xhigh" - } - }, - "max": { - "options": { - "reasoning_effort": "max" - } - }, - "ultra": { - "options": { - "reasoning_effort": "ultra" - } - } - }, - "limit": { - "context": 1000000, - "output": 128000 - } - }, - "gpt-6.1-terra": { - "name": "GPT-6.1 Terra (codex)", - "variants": { - "low": { - "options": { - "reasoning_effort": "low" - } - }, - "medium": { - "options": { - "reasoning_effort": "medium" - } - }, - "high": { - "options": { - "reasoning_effort": "high" - } - }, - "xhigh": { - "options": { - "reasoning_effort": "xhigh" - } - }, - "max": { - "options": { - "reasoning_effort": "max" - } - }, - "ultra": { - "options": { - "reasoning_effort": "ultra" - } - } - }, - "limit": { - "context": 1000000, - "output": 128000 - } - }, - "gpt-6-astra": { - "name": "GPT-6 Astra (codex)", - "variants": { - "low": { - "options": { - "reasoning_effort": "low" - } - }, - "medium": { - "options": { - "reasoning_effort": "medium" - } - }, - "high": { - "options": { - "reasoning_effort": "high" - } - }, - "xhigh": { - "options": { - "reasoning_effort": "xhigh" - } - }, - "max": { - "options": { - "reasoning_effort": "max" - } - }, - "ultra": { - "options": { - "reasoning_effort": "ultra" - } - } - }, - "limit": { - "context": 1000000, - "output": 128000 - } - }, - "gpt-6-sol": { - "name": "GPT-6 Sol (codex)", + }, + // "google": model catalog maintained by sync-models in the runtime overlay (~/.local/state/opencode/opencode-runtime.jsonc) — see code#4544. + "antigravity-agy": { + "npm": "@ai-sdk/openai-compatible", + "name": "Antigravity CLI (via agy)", + "options": { + "baseURL": "http://127.0.0.1:{env:AGY_PROXY_PORT:-18743}/v1", + "apiKey": "agy-local" + }, + "models": { + "gemini-4-argon": { + "name": "Gemini 4 Argon (agy)", "variants": { "low": { "options": { @@ -3908,30 +836,24 @@ "options": { "reasoning_effort": "high" } - }, - "xhigh": { - "options": { - "reasoning_effort": "xhigh" - } - }, - "max": { - "options": { - "reasoning_effort": "max" - } - }, - "ultra": { - "options": { - "reasoning_effort": "ultra" - } } }, "limit": { - "context": 1000000, - "output": 128000 + "context": 1048576, + "output": 65536 } }, - "gpt-6-luna": { - "name": "GPT-6 Luna (codex)", + "gemini-4-argon-low": { + "name": "Gemini 4 Argon Low (agy)" + }, + "gemini-4-argon-medium": { + "name": "Gemini 4 Argon Medium (agy)" + }, + "gemini-4-argon-high": { + "name": "Gemini 4 Argon High (agy)" + }, + "gemini-3.8-flash": { + "name": "Gemini 3.8 Flash (agy)", "variants": { "low": { "options": { @@ -3947,25 +869,15 @@ "options": { "reasoning_effort": "high" } - }, - "xhigh": { - "options": { - "reasoning_effort": "xhigh" - } - }, - "max": { - "options": { - "reasoning_effort": "max" - } } }, "limit": { - "context": 1000000, - "output": 128000 + "context": 1048576, + "output": 65536 } }, - "gpt-5.6-sol": { - "name": "GPT-5.6 Sol (codex)", + "claude-sonnet-5-5": { + "name": "Claude Sonnet 5.5 (agy)", "variants": { "low": { "options": { @@ -3981,30 +893,15 @@ "options": { "reasoning_effort": "high" } - }, - "xhigh": { - "options": { - "reasoning_effort": "xhigh" - } - }, - "max": { - "options": { - "reasoning_effort": "max" - } - }, - "ultra": { - "options": { - "reasoning_effort": "ultra" - } } }, "limit": { "context": 1000000, - "output": 128000 + "output": 64000 } }, - "gpt-5.6-terra": { - "name": "GPT-5.6 Terra (codex)", + "claude-opus-5-5": { + "name": "Claude Opus 5.5 (agy)", "variants": { "low": { "options": { @@ -4020,64 +917,175 @@ "options": { "reasoning_effort": "high" } - }, - "xhigh": { - "options": { - "reasoning_effort": "xhigh" - } - }, - "max": { - "options": { - "reasoning_effort": "max" - } - }, - "ultra": { - "options": { - "reasoning_effort": "ultra" - } } }, "limit": { "context": 1000000, - "output": 128000 + "output": 64000 } }, - "gpt-5.6-luna": { - "name": "GPT-5.6 Luna (codex)", + "gemini-2.5-flash": { + "name": "Gemini 3.5 Flash Lite (agy)", + "limit": { + "context": 1048576, + "output": 65536 + } + }, + "gemini-2.5-flash-lite": { + "name": "Gemini 3.5 Flash Lite (agy)", + "limit": { + "context": 1048576, + "output": 65536 + } + }, + "gemini-2.5-flash-thinking": { + "name": "Gemini 3.5 Flash Lite (agy)", + "limit": { + "context": 1048576, + "output": 65536 + } + }, + "gemini-2.5-pro": { + "name": "Gemini 2.5 Pro (agy)", + "limit": { + "context": 1048576, + "output": 65536 + } + }, + "gemini-3-flash": { + "name": "Gemini 3 Flash (agy)", + "limit": { + "context": 1048576, + "output": 65536 + } + }, + "gemini-3.1-flash-image": { + "name": "Gemini 3.1 Flash Image (agy)", + "limit": { + "context": 1048576, + "output": 65536 + } + }, + "gemini-3.1-flash-lite": { + "name": "Gemini 3.1 Flash Lite (agy)", + "limit": { + "context": 1048576, + "output": 65536 + } + }, + "gemini-3.5-flash-lite": { + "name": "Gemini 3.5 Flash Lite (agy)", + "limit": { + "context": 1048576, + "output": 65536 + } + }, + "gemini-3.8-flash-tiered": { + "name": "gemini-3.8-flash-tiered (agy)", + "limit": { + "context": 1048576, + "output": 65536 + } + }, + "gpt-oss-120b": { + "name": "GPT-OSS 120B (agy)", + "limit": { + "context": 131072, + "output": 16384 + }, "variants": { - "low": { - "options": { - "reasoning_effort": "low" - } - }, "medium": { "options": { "reasoning_effort": "medium" } - }, - "high": { - "options": { - "reasoning_effort": "high" - } - }, - "xhigh": { - "options": { - "reasoning_effort": "xhigh" - } - }, - "max": { - "options": { - "reasoning_effort": "max" - } } - }, - "limit": { - "context": 1000000, - "output": 128000 } }, - "gpt-5.5": { - "name": "GPT-5.5 (codex)", + "gemini-3.8-flash-low": { + "name": "Gemini 3.8 Flash Low (agy)" + }, + "gemini-3.8-flash-medium": { + "name": "Gemini 3.8 Flash Medium (agy)" + }, + "gemini-3.8-flash-high": { + "name": "Gemini 3.8 Flash High (agy)" + }, + "gemini-3.7-flash": { + "name": "Gemini 3.7 Flash (agy)" + }, + "gemini-3.7-flash-low": { + "name": "Gemini 3.7 Flash Low (agy)" + }, + "gemini-3.7-flash-medium": { + "name": "Gemini 3.7 Flash Medium (agy)" + }, + "gemini-3.7-flash-high": { + "name": "Gemini 3.7 Flash High (agy)" + }, + "gemini-3.6-flash": { + "name": "Gemini 3.6 Flash (agy)" + }, + "gemini-3.6-flash-low": { + "name": "Gemini 3.6 Flash Low (agy)" + }, + "gemini-3.6-flash-medium": { + "name": "Gemini 3.6 Flash Medium (agy)" + }, + "gemini-3.6-flash-high": { + "name": "Gemini 3.6 Flash High (agy)" + }, + "gemini-3.1-pro": { + "name": "Gemini 3.1 Pro (agy)" + }, + "gemini-3.1-pro-low": { + "name": "Gemini 3.1 Pro Low (agy)" + }, + "gemini-3.1-pro-high": { + "name": "Gemini 3.1 Pro High (agy)" + }, + "claude-sonnet-5-5-low": { + "name": "Claude Sonnet 5.5 Low (agy)" + }, + "claude-sonnet-5-5-medium": { + "name": "Claude Sonnet 5.5 Medium (agy)" + }, + "claude-sonnet-5-5-high": { + "name": "Claude Sonnet 5.5 High (agy)" + }, + "claude-opus-5-5-low": { + "name": "Claude Opus 5.5 Low (agy)" + }, + "claude-opus-5-5-medium": { + "name": "Claude Opus 5.5 Medium (agy)" + }, + "claude-opus-5-5-high": { + "name": "Claude Opus 5.5 High (agy)" + }, + "gpt-oss-120b-medium": { + "name": "GPT-OSS 120B Medium (agy)" + } + + } + }, + "antigravity-direct": { + "npm": "@ai-sdk/openai-compatible", + "name": "Antigravity Direct (CLI wire clone)", + "options": { + "baseURL": "http://127.0.0.1:{env:ANTIGRAVITY_DIRECT_PORT:-18751}/v1", + "apiKey": "antigravity-direct-local" + } + // "models": maintained by sync-models in the runtime overlay (~/.local/state/opencode/opencode-runtime.jsonc) — see code#4544. + }, + "antigravity-ls": { + "npm": "@ai-sdk/openai-compatible", + "name": "Antigravity Language Server (Direct gRPC/ConnectRPC)", + "options": { + "baseURL": "http://127.0.0.1:{env:ANTIGRAVITY_LS_PROXY_PORT:-18745}/v1", + "apiKey": "antigravity-local" + }, + "models": { + "gemini-3.8-flash": { + "name": "Gemini 3.8 Flash (Direct LS)", "variants": { "low": { "options": { @@ -4093,20 +1101,15 @@ "options": { "reasoning_effort": "high" } - }, - "xhigh": { - "options": { - "reasoning_effort": "xhigh" - } } }, "limit": { - "context": 1000000, - "output": 128000 + "context": 1048576, + "output": 65536 } }, - "gpt-reserve": { - "name": "GPT Reserve (codex)", + "claude-sonnet-5-5": { + "name": "Claude Sonnet 5.5 (Direct LS)", "variants": { "low": { "options": { @@ -4122,25 +1125,15 @@ "options": { "reasoning_effort": "high" } - }, - "xhigh": { - "options": { - "reasoning_effort": "xhigh" - } - }, - "max": { - "options": { - "reasoning_effort": "max" - } } }, "limit": { "context": 1000000, - "output": 128000 + "output": 64000 } }, - "codex-auto-review": { - "name": "Codex Auto Review", + "claude-opus-5-5": { + "name": "Claude Opus 5.5 (Direct LS)", "variants": { "low": { "options": { @@ -4156,188 +1149,178 @@ "options": { "reasoning_effort": "high" } - }, - "xhigh": { - "options": { - "reasoning_effort": "xhigh" - } - }, - "max": { - "options": { - "reasoning_effort": "max" - } } }, "limit": { "context": 1000000, - "output": 128000 + "output": 64000 } }, - "gpt-6.1-sol-low": { - "name": "GPT-6.1 Sol Low (codex)" - }, - "gpt-6.1-sol-medium": { - "name": "GPT-6.1 Sol Medium (codex)" - }, - "gpt-6.1-sol-high": { - "name": "GPT-6.1 Sol High (codex)" - }, - "gpt-6.1-sol-xhigh": { - "name": "GPT-6.1 Sol XHigh (codex)" - }, - "gpt-6.1-sol-max": { - "name": "GPT-6.1 Sol Max (codex)" - }, - "gpt-6.1-sol-ultra": { - "name": "GPT-6.1 Sol Ultra (codex)" - }, - "gpt-6-astra-low": { - "name": "GPT-6 Astra Low (codex)" - }, - "gpt-6-astra-medium": { - "name": "GPT-6 Astra Medium (codex)" - }, - "gpt-6-astra-high": { - "name": "GPT-6 Astra High (codex)" - }, - "gpt-6-astra-xhigh": { - "name": "GPT-6 Astra XHigh (codex)" - }, - "gpt-6-astra-max": { - "name": "GPT-6 Astra Max (codex)" - }, - "gpt-6-astra-ultra": { - "name": "GPT-6 Astra Ultra (codex)" - }, - "gpt-6-sol-low": { - "name": "GPT-6 Sol Low (codex)" - }, - "gpt-6-sol-medium": { - "name": "GPT-6 Sol Medium (codex)" - }, - "gpt-6-sol-high": { - "name": "GPT-6 Sol High (codex)" - }, - "gpt-6-sol-xhigh": { - "name": "GPT-6 Sol XHigh (codex)" - }, - "gpt-6-sol-max": { - "name": "GPT-6 Sol Max (codex)" - }, - "gpt-6-sol-ultra": { - "name": "GPT-6 Sol Ultra (codex)" - }, - "gpt-6-luna-low": { - "name": "GPT-6 Luna Low (codex)" - }, - "gpt-6-luna-medium": { - "name": "GPT-6 Luna Medium (codex)" + "gemini-2.5-flash": { + "name": "Gemini 3.5 Flash Lite (Direct LS)", + "limit": { + "context": 1048576, + "output": 65536 + } }, - "gpt-6-luna-high": { - "name": "GPT-6 Luna High (codex)" + "gemini-2.5-flash-lite": { + "name": "Gemini 3.5 Flash Lite (Direct LS)", + "limit": { + "context": 1048576, + "output": 65536 + } }, - "gpt-6-luna-xhigh": { - "name": "GPT-6 Luna XHigh (codex)" + "gemini-2.5-flash-thinking": { + "name": "Gemini 3.5 Flash Lite (Direct LS)", + "limit": { + "context": 1048576, + "output": 65536 + } }, - "gpt-6-luna-max": { - "name": "GPT-6 Luna Max (codex)" + "gemini-2.5-pro": { + "name": "Gemini 2.5 Pro (Direct LS)", + "limit": { + "context": 1048576, + "output": 65536 + } }, - "gpt-5.6-sol-low": { - "name": "GPT-5.6 Sol Low (codex)" + "gemini-3-flash": { + "name": "Gemini 3 Flash (Direct LS)", + "limit": { + "context": 1048576, + "output": 65536 + } }, - "gpt-5.6-sol-medium": { - "name": "GPT-5.6 Sol Medium (codex)" + "gemini-3.1-flash-image": { + "name": "Gemini 3.1 Flash Image (Direct LS)", + "limit": { + "context": 1048576, + "output": 65536 + } }, - "gpt-5.6-sol-high": { - "name": "GPT-5.6 Sol High (codex)" + "gemini-3.1-flash-lite": { + "name": "Gemini 3.1 Flash Lite (Direct LS)", + "limit": { + "context": 1048576, + "output": 65536 + } }, - "gpt-5.6-sol-xhigh": { - "name": "GPT-5.6 Sol XHigh (codex)" + "gemini-3.5-flash-lite": { + "name": "Gemini 3.5 Flash Lite (Direct LS)", + "limit": { + "context": 1048576, + "output": 65536 + } }, - "gpt-5.6-sol-max": { - "name": "GPT-5.6 Sol Max (codex)" + "gemini-3.8-flash-tiered": { + "name": "gemini-3.8-flash-tiered (Direct LS)", + "limit": { + "context": 1048576, + "output": 65536 + } }, - "gpt-5.6-sol-ultra": { - "name": "GPT-5.6 Sol Ultra (codex)" + "gpt-oss-120b": { + "name": "GPT-OSS 120B (Direct LS)", + "limit": { + "context": 131072, + "output": 16384 + }, + "variants": { + "medium": { + "options": { + "reasoning_effort": "medium" + } + } + } }, - "gpt-5.6-terra-low": { - "name": "GPT-5.6 Terra Low (codex)" + "gemini-3.8-flash-low": { + "name": "Gemini 3.8 Flash Low (Direct LS)" }, - "gpt-5.6-terra-medium": { - "name": "GPT-5.6 Terra Medium (codex)" + "gemini-3.8-flash-medium": { + "name": "Gemini 3.8 Flash Medium (Direct LS)" }, - "gpt-5.6-terra-high": { - "name": "GPT-5.6 Terra High (codex)" + "gemini-3.8-flash-high": { + "name": "Gemini 3.8 Flash High (Direct LS)" }, - "gpt-5.6-terra-xhigh": { - "name": "GPT-5.6 Terra XHigh (codex)" + "gemini-3.7-flash": { + "name": "Gemini 3.7 Flash (Direct LS)" }, - "gpt-5.6-terra-max": { - "name": "GPT-5.6 Terra Max (codex)" + "gemini-3.7-flash-low": { + "name": "Gemini 3.7 Flash Low (Direct LS)" }, - "gpt-5.6-terra-ultra": { - "name": "GPT-5.6 Terra Ultra (codex)" + "gemini-3.7-flash-medium": { + "name": "Gemini 3.7 Flash Medium (Direct LS)" }, - "gpt-5.6-luna-low": { - "name": "GPT-5.6 Luna Low (codex)" + "gemini-3.7-flash-high": { + "name": "Gemini 3.7 Flash High (Direct LS)" }, - "gpt-5.6-luna-medium": { - "name": "GPT-5.6 Luna Medium (codex)" + "gemini-3.6-flash": { + "name": "Gemini 3.6 Flash (Direct LS)" }, - "gpt-5.6-luna-high": { - "name": "GPT-5.6 Luna High (codex)" + "gemini-3.6-flash-low": { + "name": "Gemini 3.6 Flash Low (Direct LS)" }, - "gpt-5.6-luna-xhigh": { - "name": "GPT-5.6 Luna XHigh (codex)" + "gemini-3.6-flash-medium": { + "name": "Gemini 3.6 Flash Medium (Direct LS)" }, - "gpt-5.6-luna-max": { - "name": "GPT-5.6 Luna Max (codex)" + "gemini-3.6-flash-high": { + "name": "Gemini 3.6 Flash High (Direct LS)" }, - "gpt-5.5-low": { - "name": "GPT-5.5 Low (codex)" + "gemini-3.1-pro": { + "name": "Gemini 3.1 Pro (Direct LS)" }, - "gpt-5.5-medium": { - "name": "GPT-5.5 Medium (codex)" + "gemini-3.1-pro-low": { + "name": "Gemini 3.1 Pro Low (Direct LS)" }, - "gpt-5.5-high": { - "name": "GPT-5.5 High (codex)" + "gemini-3.1-pro-high": { + "name": "Gemini 3.1 Pro High (Direct LS)" }, - "gpt-5.5-xhigh": { - "name": "GPT-5.5 XHigh (codex)" + "claude-sonnet-5-5-low": { + "name": "Claude Sonnet 5.5 Low (Direct LS)" }, - "gpt-reserve-low": { - "name": "GPT Reserve Low (codex)" + "claude-sonnet-5-5-medium": { + "name": "Claude Sonnet 5.5 Medium (Direct LS)" }, - "gpt-reserve-medium": { - "name": "GPT Reserve Medium (codex)" + "claude-sonnet-5-5-high": { + "name": "Claude Sonnet 5.5 High (Direct LS)" }, - "gpt-reserve-high": { - "name": "GPT Reserve High (codex)" + "claude-opus-5-5-low": { + "name": "Claude Opus 5.5 Low (Direct LS)" }, - "gpt-reserve-xhigh": { - "name": "GPT Reserve XHigh (codex)" + "claude-opus-5-5-medium": { + "name": "Claude Opus 5.5 Medium (Direct LS)" }, - "gpt-reserve-max": { - "name": "GPT Reserve Max (codex)" + "claude-opus-5-5-high": { + "name": "Claude Opus 5.5 High (Direct LS)" }, - "codex-auto-review-low": { - "name": "Codex Auto Review Low (codex)" + "gpt-oss-120b-medium": { + "name": "GPT-OSS 120B Medium (Direct LS)" }, - "codex-auto-review-medium": { - "name": "Codex Auto Review Medium (codex)" + "chat_20706": { + "name": "chat_20706 (Direct LS)" }, - "codex-auto-review-high": { - "name": "Codex Auto Review High (codex)" + "chat_23310": { + "name": "chat_23310 (Direct LS)" }, - "codex-auto-review-xhigh": { - "name": "Codex Auto Review XHigh (codex)" + "tab_flash_lite_preview": { + "name": "tab_flash_lite_preview (Direct LS)" }, - "codex-auto-review-max": { - "name": "Codex Auto Review Max (codex)" + "tab_jump_flash_lite_preview": { + "name": "tab_jump_flash_lite_preview (Direct LS)" } } }, + // "openai": model catalog maintained by sync-models in the runtime overlay (~/.local/state/opencode/opencode-runtime.jsonc) — see code#4544. + "openai-codex": { + "npm": "@ai-sdk/openai-compatible", + "name": "OpenAI Codex CLI (via codex)", + "options": { + "baseURL": "http://127.0.0.1:{env:CODEX_PROXY_PORT:-18744}/v1", + "apiKey": "codex-local" + } + // "models": maintained by sync-models in the runtime overlay (~/.local/state/opencode/opencode-runtime.jsonc) — see code#4544. + }, "chatgpt": { "npm": "@ai-sdk/openai-compatible", "name": "ChatGPT (via Codex)", diff --git a/bin/opencode-route-proxy.mjs b/bin/opencode-route-proxy.mjs index 1ccd9c651a..c8bc2c435c 100755 --- a/bin/opencode-route-proxy.mjs +++ b/bin/opencode-route-proxy.mjs @@ -37,6 +37,12 @@ // ~/.local/share/opencode/opencode.jsonc, // else ../.opencode/opencode.jsonc // relative to this file) +// OPENCODE_ROUTE_PROXY_RUNTIME_CONFIG +// runtime overlay jsonc whose provider +// catalogs are deep-merged over the +// config's (default: +// ~/.local/state/opencode/opencode-runtime.jsonc; +// absent = no overlay) (#4544) // OPENCODE_ROUTE_PROXY_DB opencode.db path (default: // ~/.local/share/opencode/opencode.db) // OPENCODE_ROUTE_PROXY_NOW_MS pin the clock (epoch ms) used for @@ -59,6 +65,9 @@ const CONFIG_PATH = process.env.OPENCODE_ROUTE_PROXY_CONFIG || join(homedir(), ".local/share/opencode/opencode.jsonc"); const CONFIG_FALLBACK = join(HERE, "..", ".opencode", "opencode.jsonc"); +const RUNTIME_CONFIG_PATH = + process.env.OPENCODE_ROUTE_PROXY_RUNTIME_CONFIG || + join(homedir(), ".local/state/opencode/opencode-runtime.jsonc"); const DB_PATH = process.env.OPENCODE_ROUTE_PROXY_DB || join(homedir(), ".local/share/opencode/opencode.db"); @@ -152,6 +161,18 @@ const parseJsonc = (text) => { } }; +const isPlainObj = (v) => + v !== null && typeof v === "object" && !Array.isArray(v); +// Deep-merge plain objects (overlay wins on scalars): mirrors the fork +// server's config layering for the runtime overlay (#4544), so the proxy +// resolves the same effective provider catalog the server does. +const deepMergePlain = (base, over) => { + if (!isPlainObj(base) || !isPlainObj(over)) return over; + const out = { ...base }; + for (const k of Object.keys(over)) out[k] = deepMergePlain(base[k], over[k]); + return out; +}; + let cfgCache = null; const loadConfig = () => { let path = CONFIG_PATH; @@ -162,15 +183,37 @@ const loadConfig = () => { path = CONFIG_FALLBACK; st = statSync(path); } - if (cfgCache && cfgCache.path === path && cfgCache.mtimeMs === st.mtimeMs) + let rtSt = null; + try { + rtSt = statSync(RUNTIME_CONFIG_PATH); + } catch { + rtSt = null; + } + const rtMtimeMs = rtSt ? rtSt.mtimeMs : null; + if ( + cfgCache && + cfgCache.path === path && + cfgCache.mtimeMs === st.mtimeMs && + cfgCache.rtMtimeMs === rtMtimeMs + ) return cfgCache; const raw = parseJsonc(readFileSync(path, "utf8")); + if (rtSt) { + try { + const rt = parseJsonc(readFileSync(RUNTIME_CONFIG_PATH, "utf8")); + if (rt && typeof rt === "object" && rt.provider) + raw.provider = deepMergePlain(raw.provider || {}, rt.provider); + } catch { + // Overlay unreadable: serve the tracked default alone rather than fail. + } + } const windows = raw.experimental?.model_route_windows || raw.model_route_windows || {}; warnInvalidWindows(windows); cfgCache = { path, mtimeMs: st.mtimeMs, + rtMtimeMs, providers: raw.provider || {}, providerRoutes: raw.experimental?.provider_routes || raw.provider_routes || {}, diff --git a/bin/provider-catalog-sync.mjs b/bin/provider-catalog-sync.mjs index c6fe77aeb1..029b629be9 100644 --- a/bin/provider-catalog-sync.mjs +++ b/bin/provider-catalog-sync.mjs @@ -35,6 +35,13 @@ // route membership, never in the catalog — so this tool only ever ADDS, // through a reviewable PR. // +// #4544 split: the tracked configured default no longer carries the model +// catalogs sync-models owns (antigravity-direct, openai-codex, google, +// openai, cloudflare-gateway) — those live in the runtime overlay +// (~/.local/state/opencode/opencode-runtime.jsonc). This tool diffs the +// merged effective config (default + overlay; --runtime-config) and skips +// the sync-owned providers on --apply; sync-models owns their writes. +// // Sources: laptop proxies are enumerated over HTTP on 127.0.0.1 (run this on // the laptop, or pass --source-dir with .json snapshots for an offline // reproducible run). models.dev is a cross-check for every provider and the @@ -498,9 +505,45 @@ async function loadModelsDev(spec) { // --------------------------------------------------------------------------- // Run // --------------------------------------------------------------------------- -export async function runSync({ configPath, modelsDevSpec, sourceDir }) { +// Providers whose model catalogs bin/sync-models.mjs owns in the runtime +// overlay (#4544). Catalog-sync diffs them (via the merged effective config) +// but never writes them into the tracked configured default on --apply. +export const SYNC_OWNED_PROVIDERS = new Set([ + 'antigravity-direct', + 'openai-codex', + 'google', + 'openai', + 'cloudflare-gateway', +]); + +// Deep-merge plain objects (overlay wins on scalars) — the same layering +// the OpenCode server applies to OPENCODE_CONFIG. +export function deepMergeProviders(base, over) { + const isObj = (v) => v !== null && typeof v === 'object' && !Array.isArray(v); + if (!isObj(base) || !isObj(over)) return over; + const out = { ...base }; + for (const k of Object.keys(over)) out[k] = deepMergeProviders(base[k], over[k]); + return out; +} + +export async function runSync({ configPath, modelsDevSpec, sourceDir, runtimeConfigPath }) { const configText = fs.readFileSync(configPath, 'utf8'); const config = parseJsonc(configText); + // #4544: diff against the merged effective config (tracked default + + // runtime overlay) so the sync-owned providers still enumerate and their + // vanishings still surface exactly as before the split. + let runtimeOverlay = null; + if (runtimeConfigPath && fs.existsSync(runtimeConfigPath)) { + try { + const overlay = parseJsonc(fs.readFileSync(runtimeConfigPath, 'utf8')); + if (overlay && typeof overlay === 'object' && overlay.provider) { + config.provider = deepMergeProviders(config.provider ?? {}, overlay.provider); + runtimeOverlay = runtimeConfigPath; + } + } catch { + runtimeOverlay = null; + } + } const providers = config.provider ?? {}; let modelsDev = null; let modelsDevError = null; @@ -512,6 +555,7 @@ export async function runSync({ configPath, modelsDevSpec, sourceDir }) { const report = { generated_at: new Date().toISOString(), config: configPath, + runtime_overlay: runtimeOverlay, models_dev: modelsDev ? 'loaded' : `unavailable (${modelsDevError})`, providers: {}, totals: { additions_validated: 0, additions_unverified: 0, vanishings: 0, unverifiable: 0 }, @@ -735,11 +779,11 @@ export function openPrCommands({ branch, branchExists, date, bodyFile }) { // hard-error code, matching the sibling usage-error pattern from // #3419/#3295) that names the offending flag. // --------------------------------------------------------------------------- -export const VALUE_OPTIONS = ['--config', '--models-dev', '--source-dir', '--repo']; +export const VALUE_OPTIONS = ['--config', '--models-dev', '--source-dir', '--repo', '--runtime-config']; export const FLAG_OPTIONS = ['--apply', '--open-pr', '--json', '--help']; export const USAGE = 'usage: provider-catalog-sync [--config ] [--models-dev ] ' + - '[--source-dir ] [--repo ] [--apply] [--open-pr] [--json]'; + '[--source-dir ] [--repo ] [--runtime-config ] [--apply] [--open-pr] [--json]'; export class UsageError extends Error {} @@ -783,12 +827,25 @@ async function main(argv) { const root = path.resolve(path.dirname(new URL(import.meta.url).pathname), '..'); const configPath = process.env.OPENCODE_CONFIG_PATH || opt('--config', path.join(root, '.opencode', 'opencode.jsonc')); + const runtimeConfigPath = opt( + '--runtime-config', + process.env.OPENCODE_RUNTIME_CONFIG || + path.join( + process.env.HOME || '/home/user', + '.local/state/opencode/opencode-runtime.jsonc', + ), + ); const modelsDevSpec = opt('--models-dev', 'https://models.dev/api.json'); const sourceDir = opt('--source-dir', null); const apply = flags.has('--apply'); const openPr = flags.has('--open-pr'); - const { report, configText, config } = await runSync({ configPath, modelsDevSpec, sourceDir }); + const { report, configText, config } = await runSync({ + configPath, + modelsDevSpec, + sourceDir, + runtimeConfigPath, + }); if (!apply) { if (flags.has('--json')) console.log(JSON.stringify(report, null, 2)); @@ -804,10 +861,23 @@ async function main(argv) { try { modelsDev = await loadModelsDev(modelsDevSpec); } catch {} - const { text, added } = applyAdditions(configText, config, report, modelsDev); + // #4544: never write sync-models-owned catalogs into the tracked default; + // sync-models lands them in the runtime overlay instead. + const applyReport = { ...report, providers: {} }; + for (const [pid, entry] of Object.entries(report.providers)) { + if (SYNC_OWNED_PROVIDERS.has(pid) && (entry.additions_validated ?? []).length > 0) { + console.log( + `[catalog-sync] skipping ${pid}: ${entry.additions_validated.length} validated addition(s) owned by sync-models (runtime overlay)`, + ); + applyReport.providers[pid] = { ...entry, additions_validated: [] }; + } else { + applyReport.providers[pid] = entry; + } + } + const { text, added } = applyAdditions(configText, config, applyReport, modelsDev); assertCatalogOnly(configText, text, added); fs.writeFileSync(configPath, text); - const body = renderPrBody(report, added); + const body = renderPrBody(applyReport, added); console.log(body); if (openPr) { const repoDir = opt('--repo', path.dirname(path.dirname(configPath))); diff --git a/bin/provider-catalog-sync.test.mjs b/bin/provider-catalog-sync.test.mjs index 285aacc6fa..d52f16a162 100644 --- a/bin/provider-catalog-sync.test.mjs +++ b/bin/provider-catalog-sync.test.mjs @@ -19,6 +19,9 @@ import { catalogSyncBranch, assertNotDefaultBranch, openPrCommands, + runSync, + deepMergeProviders, + SYNC_OWNED_PROVIDERS, } from './provider-catalog-sync.mjs'; const FIXTURE = `{ @@ -335,3 +338,56 @@ test('CLI control: dry run exits 3 without writing; --apply exits 0 and writes', assert.equal(applied.status, 0, `apply: ${applied.stdout} ${applied.stderr}`); assert.ok(fs.readFileSync(configPath, 'utf8').includes('acme-2')); }); + +// --------------------------------------------------------------------------- +// #4544: runtime overlay (sync-models-owned catalogs outside the tracked +// configured default) +// --------------------------------------------------------------------------- + +test('SYNC_OWNED_PROVIDERS names exactly the five sync-models-owned providers (#4544)', () => { + assert.deepEqual( + [...SYNC_OWNED_PROVIDERS].sort(), + ['antigravity-direct', 'cloudflare-gateway', 'google', 'openai', 'openai-codex'], + ); +}); + +test('deepMergeProviders merges catalogs per model, overlay wins on conflict (#4544)', () => { + const base = { google: { models: { a: { name: 'A' }, b: { name: 'B', limit: { context: 1 } } } }, x: { models: { m: {} } } }; + const over = { google: { models: { b: { name: 'B2' }, c: { name: 'C' } } } }; + const merged = deepMergeProviders(base, over); + assert.deepEqual(Object.keys(merged.google.models).sort(), ['a', 'b', 'c']); + assert.equal(merged.google.models.b.name, 'B2'); + assert.equal(merged.google.models.a.name, 'A'); + assert.deepEqual(Object.keys(merged.x.models), ['m']); +}); + +test('runSync diffs the merged effective config when a runtime overlay exists (#4544)', async () => { + const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'catalog-sync-overlay-')); + const configPath = path.join(dir, 'opencode.jsonc'); + // Tracked default post-split: no google block at all (it was models-only). + fs.writeFileSync(configPath, '{ "provider": { "deepseek": { "models": { "ds-1": {} } } } }'); + const overlayPath = path.join(dir, 'opencode-runtime.jsonc'); + fs.writeFileSync( + overlayPath, + JSON.stringify({ provider: { google: { models: { 'gem-a': {}, 'gem-b': {} } } } }), + ); + const modelsDev = path.join(dir, 'models-dev.json'); + fs.writeFileSync(modelsDev, '{}'); + const { report } = await runSync({ + configPath, + modelsDevSpec: modelsDev, + sourceDir: null, + runtimeConfigPath: overlayPath, + }); + assert.equal(report.runtime_overlay, overlayPath); + assert.equal(report.providers.google.config_count, 2); + // Without the overlay the same tracked file has no google provider at all. + const bare = await runSync({ + configPath, + modelsDevSpec: modelsDev, + sourceDir: null, + runtimeConfigPath: path.join(dir, 'absent.jsonc'), + }); + assert.equal(bare.report.runtime_overlay, null); + assert.equal(bare.report.providers.google, undefined); +}); diff --git a/bin/sync-models.mjs b/bin/sync-models.mjs index 9b04be76fe..6e307cab2c 100755 --- a/bin/sync-models.mjs +++ b/bin/sync-models.mjs @@ -16,17 +16,30 @@ const VERBOSE = process.argv.includes('--verbose') || process.argv.includes('-v' const ROOT_DIR = path.resolve(import.meta.dirname, '..'); const HOME_DIR = process.env.HOME || '/home/user'; -// Config resolution (#591): in a repo checkout, sync the repo's own -// .opencode/opencode.jsonc. When home-manager installs this script it lands -// alone in the Nix store, so ROOT_DIR resolves to /nix and the repo-relative -// path never exists — fall back to the deployed user config, which is the -// file the sync-models service actually maintains. $OPENCODE_CONFIG_PATH -// overrides both. +// Config resolution (#591, #4544): the model catalogs this script maintains +// live in the runtime overlay (~/.local/state/opencode/opencode-runtime.jsonc), +// which the OpenCode server layers over the tracked configured default via +// OPENCODE_CONFIG. The tracked file carries deliberate configuration only, +// so these automatic rewrites never dirty the repo tree. $OPENCODE_CONFIG_PATH +// overrides everything. When no runtime overlay exists yet (pre-split +// installs), fall back to the historical chain: in a repo checkout, sync the +// repo's own .opencode/opencode.jsonc; when home-manager installs this script +// it lands alone in the Nix store, so ROOT_DIR resolves to /nix and the +// repo-relative path never exists — fall back to the deployed user config, +// which is the file the sync-models service actually maintains. +const RUNTIME_CONFIG_PATH = path.join( + HOME_DIR, + '.local/state/opencode/opencode-runtime.jsonc', +); const REPO_CONFIG_PATH = path.join(ROOT_DIR, '.opencode/opencode.jsonc'); const USER_CONFIG_PATH = path.join(HOME_DIR, '.config/opencode/opencode.jsonc'); const OPENCODE_CONFIG_PATH = process.env.OPENCODE_CONFIG_PATH || - (fs.existsSync(REPO_CONFIG_PATH) ? REPO_CONFIG_PATH : USER_CONFIG_PATH); + (fs.existsSync(RUNTIME_CONFIG_PATH) + ? RUNTIME_CONFIG_PATH + : fs.existsSync(REPO_CONFIG_PATH) + ? REPO_CONFIG_PATH + : USER_CONFIG_PATH); const POLICY_PATH = path.join(import.meta.dirname, 'sync-models.policy.json'); const CODEX_CACHE_PATH = path.join(HOME_DIR, '.codex/models_cache.json'); const GEMINI_CACHE_PATH = path.join(HOME_DIR, '.gemini/antigravity_models_cache.json'); diff --git a/home/common/default.nix b/home/common/default.nix index 6a71e60845..3baef6a057 100644 --- a/home/common/default.nix +++ b/home/common/default.nix @@ -877,6 +877,11 @@ in }; Service = { Type = "oneshot"; + # #4544: sync-models maintains the runtime overlay, never the tracked + # configured default — its rewrites must not dirty the repo tree. + Environment = [ + "OPENCODE_CONFIG_PATH=%h/.local/state/opencode/opencode-runtime.jsonc" + ]; ExecStart = toString ( pkgs.writeShellScript "sync-models-run" '' export PATH="/run/current-system/sw/bin:$HOME/.gemini/bin:$HOME/.local/bin:$PATH" @@ -1596,6 +1601,13 @@ in # reads OPENCODE_DISABLE_FILEWATCHER; the EXPERIMENTAL_ name was # read nowhere, so the watcher was silently still on.) OPENCODE_DISABLE_FILEWATCHER = "1"; + # Config split (#4544): the runtime overlay — the provider catalogs + # sync-models maintains, plus the server's own runtime config patches + # — layers over the tracked configured default + # (.opencode/opencode.jsonc). OPENCODE_CONFIG is the server's explicit + # config layer; OPENCODE_CONFIG_PATH points sync-models at the file. + OPENCODE_CONFIG = "$HOME/.local/state/opencode/opencode-runtime.jsonc"; + OPENCODE_CONFIG_PATH = "$HOME/.local/state/opencode/opencode-runtime.jsonc"; # XDG_CACHE_HOME = "$HOME/.cache"; # XDG_CONFIG_DIRS = "/etc/xdg"; # XDG_CONFIG_HOME = "$HOME/.config"; diff --git a/pm-stack/aggregator/scripts/collect-fleet-feed.ts b/pm-stack/aggregator/scripts/collect-fleet-feed.ts index d29310adc0..b91592a87a 100644 --- a/pm-stack/aggregator/scripts/collect-fleet-feed.ts +++ b/pm-stack/aggregator/scripts/collect-fleet-feed.ts @@ -169,6 +169,8 @@ const snapshotOutboxPath = process.env.USAGE_SNAPSHOT_OUTBOX_PATH ?? join(HIDDEN const chargeCandidatesPath = process.env.CHARGE_CANDIDATES_PATH ?? join(HIDDEN, "charges-candidates.json"); const chargesSurfacedStatePath = process.env.CHARGES_SURFACED_STATE_PATH ?? join(HIDDEN, "charges-surfaced-state.json"); const opencodeConfigPath = process.env.AA_OPENCODE_CONFIG_PATH ?? join(PKG, "..", "..", ".opencode", "opencode.jsonc"); +const opencodeRuntimeConfigPath = + process.env.AA_OPENCODE_RUNTIME_CONFIG_PATH ?? join(HOME, ".local", "state", "opencode", "opencode-runtime.jsonc"); const serverUrl = process.env.OPENCODE_SERVER_URL ?? process.env.SANDBOX_OPENCODE_URL ?? "http://127.0.0.1:4096"; /** Session source label for the scraped server: the collector's home host * decides — the laptop collector labels its local server @@ -505,7 +507,15 @@ async function collectAaSection(generatedAt: string): Promise { } catch { console.error("collector: opencode.jsonc unreadable; AA coverage omitted this run"); } - const section = aaSectionFromSupabase(raw, configText, generatedAt); + // #4544: the sync-models-owned provider catalogs live in the runtime + // overlay; read it when present so AA coverage sees the effective config. + let runtimeText: string | null = null; + try { + runtimeText = await readFile(opencodeRuntimeConfigPath, "utf8"); + } catch { + runtimeText = null; + } + const section = aaSectionFromSupabase(raw, configText, generatedAt, runtimeText); if (!section) return degrade("Supabase payload failed its structural check"); await writeAaLastGood({ batch: section.batch, configFingerprint: fingerprint, section }); return section; diff --git a/pm-stack/aggregator/src/aa.ts b/pm-stack/aggregator/src/aa.ts index bebbbc30e1..d255813f64 100644 --- a/pm-stack/aggregator/src/aa.ts +++ b/pm-stack/aggregator/src/aa.ts @@ -206,6 +206,34 @@ export interface OpencodeCoverageInputs { pooled: string[]; } +/** + * Merge the runtime overlay (#4544: the sync-models-owned provider catalogs + * that live outside the tracked configured default and are layered over it + * via OPENCODE_CONFIG) into the base config text, returning the effective + * config as JSON text. Returns null when either side does not parse — + * callers fall back to the base text alone. + */ +export function mergeOpencodeConfigTexts(baseText: string, overlayText: string): string | null { + let base: unknown; + let overlay: unknown; + try { + base = JSON.parse(stripJsonComments(baseText)); + overlay = JSON.parse(stripJsonComments(overlayText)); + } catch { + return null; + } + if (typeof base !== "object" || base === null || typeof overlay !== "object" || overlay === null) return null; + const isObj = (v: unknown): v is Record => + typeof v === "object" && v !== null && !Array.isArray(v); + const merge = (b: unknown, o: unknown): unknown => { + if (!isObj(b) || !isObj(o)) return o; + const out: Record = { ...b }; + for (const k of Object.keys(o)) out[k] = merge(b[k], o[k]); + return out; + }; + return JSON.stringify(merge(base, overlay)); +} + /** * Extract the provider catalog and the pooled leaf set from the repo's * .opencode/opencode.jsonc. Returns null when the file does not parse — @@ -1073,6 +1101,7 @@ export function aaSectionFromSupabase( raw: AaRawPayload, opencodeConfigText: string | null, generatedAt: string, + opencodeRuntimeText: string | null = null, ): AaSection | null { if (typeof raw.batch !== "string" || !Array.isArray(raw.rankings) || !Array.isArray(raw.configs)) return null; const rankings = raw.rankings.map(rankingFromRaw).filter((r): r is AaRanking => r !== null); @@ -1093,9 +1122,16 @@ export function aaSectionFromSupabase( let coverage: AaCoverage | undefined; let catalog: AaCatalogEntry[] | undefined; if (opencodeConfigText) { - const inputs = parseOpencodeCoverageInputs(opencodeConfigText); + // #4544: coverage and the catalog are computed from the effective config + // (tracked default + runtime overlay) so the sync-owned providers' + // models stay visible after the split. + const effectiveText = + (opencodeRuntimeText + ? mergeOpencodeConfigTexts(opencodeConfigText, opencodeRuntimeText) + : null) ?? opencodeConfigText; + const inputs = parseOpencodeCoverageInputs(effectiveText); if (inputs) coverage = computeAaCoverage(measuredNames, inputs); - catalog = aaCatalogFromConfig(opencodeConfigText, { configs, rankings }, prices) ?? undefined; + catalog = aaCatalogFromConfig(effectiveText, { configs, rankings }, prices) ?? undefined; } return { status: "ok",