xonecas.io
79113
Ma

mini-coding-agent / commit b4d6182

feat(providers): dynamic list of models (based on auth)

xonecas2026-10-08 b4d61825a7b74de42ff2db5a94804678e5532eb2 parent 7b93a0e

5 files changed

src/catalog.zig+0−160
@@ -1,160 +0,0 @@
1-// Generated by tools/gen_catalog.py. Do not edit.
2-// Refresh with `python3 tools/gen_catalog.py`.
3-
4-const std = @import("std");
5-
6-pub const ModelInfo = struct {
7- provider: []const u8,
8- id: []const u8,
9- name: []const u8,
10- api: []const u8,
11- base_url: []const u8,
12- images: bool,
13- reasoning: bool,
14- context: u64,
15- max_output: u64,
16- effort: []const []const u8,
17- cost_input: f64,
18- cost_output: f64,
19- cost_cache_read: f64,
20-};
21-
22-pub const entries = [_]ModelInfo{
23- .{ .provider = "opencode", .id = "big-pickle", .name = "Big Pickle", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = false, .reasoning = true, .context = 200000, .max_output = 32000, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
24- .{ .provider = "opencode", .id = "claude-fable-5", .name = "Claude Fable 5", .api = "anthropic-messages", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 128000, .effort = &.{ "low", "medium", "high", "xhigh", "max" }, .cost_input = 10.0, .cost_output = 50.0, .cost_cache_read = 1.0 },
25- .{ .provider = "opencode", .id = "claude-fable-5-1", .name = "Claude Fable 5.1", .api = "anthropic-messages", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 128000, .effort = &.{ "low", "medium", "high", "xhigh", "max" }, .cost_input = 10.0, .cost_output = 50.0, .cost_cache_read = 0.25 },
26- .{ .provider = "opencode", .id = "claude-haiku-4-5", .name = "Claude Haiku 4.5", .api = "anthropic-messages", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 200000, .max_output = 64000, .effort = &.{}, .cost_input = 1.0, .cost_output = 5.0, .cost_cache_read = 0.1 },
27- .{ .provider = "opencode", .id = "claude-haiku-5-5", .name = "Claude Haiku 5.5", .api = "anthropic-messages", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 128000, .effort = &.{ "low", "medium", "high", "xhigh", "max" }, .cost_input = 0.1, .cost_output = 0.5, .cost_cache_read = 0.01 },
28- .{ .provider = "opencode", .id = "claude-opus-4-5", .name = "Claude Opus 4.5", .api = "anthropic-messages", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 200000, .max_output = 64000, .effort = &.{ "low", "medium", "high" }, .cost_input = 5.0, .cost_output = 25.0, .cost_cache_read = 0.5 },
29- .{ .provider = "opencode", .id = "claude-opus-4-6", .name = "Claude Opus 4.6", .api = "anthropic-messages", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 128000, .effort = &.{ "low", "medium", "high", "max" }, .cost_input = 5.0, .cost_output = 25.0, .cost_cache_read = 0.5 },
30- .{ .provider = "opencode", .id = "claude-opus-4-7", .name = "Claude Opus 4.7", .api = "anthropic-messages", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 128000, .effort = &.{ "low", "medium", "high", "xhigh", "max" }, .cost_input = 5.0, .cost_output = 25.0, .cost_cache_read = 0.5 },
31- .{ .provider = "opencode", .id = "claude-opus-4-8", .name = "Claude Opus 4.8", .api = "anthropic-messages", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 128000, .effort = &.{ "low", "medium", "high", "xhigh", "max" }, .cost_input = 5.0, .cost_output = 25.0, .cost_cache_read = 0.5 },
32- .{ .provider = "opencode", .id = "claude-opus-5", .name = "Claude Opus 5", .api = "anthropic-messages", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 128000, .effort = &.{ "low", "medium", "high", "xhigh", "max" }, .cost_input = 5.0, .cost_output = 25.0, .cost_cache_read = 0.5 },
33- .{ .provider = "opencode", .id = "claude-opus-5-5", .name = "Claude Opus 5.5", .api = "anthropic-messages", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 128000, .effort = &.{ "low", "medium", "high", "xhigh", "max" }, .cost_input = 4.0, .cost_output = 20.0, .cost_cache_read = 0.2 },
34- .{ .provider = "opencode", .id = "claude-sonnet-4", .name = "Claude Sonnet 4", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 64000, .effort = &.{}, .cost_input = 3.0, .cost_output = 15.0, .cost_cache_read = 0.3 },
35- .{ .provider = "opencode", .id = "claude-sonnet-4-5", .name = "Claude Sonnet 4.5", .api = "anthropic-messages", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 64000, .effort = &.{}, .cost_input = 3.0, .cost_output = 15.0, .cost_cache_read = 0.3 },
36- .{ .provider = "opencode", .id = "claude-sonnet-4-6", .name = "Claude Sonnet 4.6", .api = "anthropic-messages", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 64000, .effort = &.{ "low", "medium", "high", "max" }, .cost_input = 3.0, .cost_output = 15.0, .cost_cache_read = 0.3 },
37- .{ .provider = "opencode", .id = "claude-sonnet-5", .name = "Claude Sonnet 5", .api = "anthropic-messages", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 128000, .effort = &.{ "low", "medium", "high", "xhigh", "max" }, .cost_input = 2.0, .cost_output = 10.0, .cost_cache_read = 0.2 },
38- .{ .provider = "opencode", .id = "claude-sonnet-5-5", .name = "Claude Sonnet 5.5", .api = "anthropic-messages", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 128000, .effort = &.{ "low", "medium", "high", "xhigh", "max" }, .cost_input = 2.0, .cost_output = 10.0, .cost_cache_read = 0.2 },
39- .{ .provider = "opencode", .id = "deepseek-v4-flash", .name = "DeepSeek V4 Flash", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = false, .reasoning = true, .context = 1000000, .max_output = 384000, .effort = &.{ "low", "high", "max" }, .cost_input = 0.14, .cost_output = 0.28, .cost_cache_read = 0.028 },
40- .{ .provider = "opencode", .id = "deepseek-v4-flash-vision-exp", .name = "DeepSeek V4 Flash Vision Exp", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 384000, .effort = &.{ "low", "high", "max" }, .cost_input = 0.14, .cost_output = 0.28, .cost_cache_read = 0.028 },
41- .{ .provider = "opencode", .id = "deepseek-v4-pro", .name = "DeepSeek V4 Pro", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = false, .reasoning = true, .context = 1000000, .max_output = 384000, .effort = &.{ "high", "max" }, .cost_input = 1.74, .cost_output = 3.84, .cost_cache_read = 0.145 },
42- .{ .provider = "opencode", .id = "deepseek-v4.1-flash", .name = "DeepSeek V4.1 Flash", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 384000, .effort = &.{ "low", "high", "max" }, .cost_input = 0.3, .cost_output = 1.2, .cost_cache_read = 0.006 },
43- .{ .provider = "opencode", .id = "exo-free", .name = "Exo Free", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1048576, .max_output = 131072, .effort = &.{"high"}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
44- .{ .provider = "opencode", .id = "gemini-3-flash", .name = "Gemini 3 Flash", .api = "google-generative-ai", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1048576, .max_output = 65536, .effort = &.{ "minimal", "low", "medium", "high" }, .cost_input = 0.5, .cost_output = 3.0, .cost_cache_read = 0.05 },
45- .{ .provider = "opencode", .id = "gemini-3.1-pro", .name = "Gemini 3.1 Pro Preview", .api = "google-generative-ai", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1048576, .max_output = 65536, .effort = &.{ "low", "medium", "high" }, .cost_input = 2.0, .cost_output = 12.0, .cost_cache_read = 0.2 },
46- .{ .provider = "opencode", .id = "gemini-3.5-flash", .name = "Gemini 3.5 Flash", .api = "google-generative-ai", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1048576, .max_output = 65536, .effort = &.{ "minimal", "low", "medium", "high" }, .cost_input = 1.5, .cost_output = 9.0, .cost_cache_read = 0.15 },
47- .{ .provider = "opencode", .id = "gemini-3.5-flash-lite", .name = "Gemini 3.5 Flash Lite", .api = "google-generative-ai", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1048576, .max_output = 65536, .effort = &.{ "minimal", "low", "medium", "high" }, .cost_input = 0.3, .cost_output = 2.5, .cost_cache_read = 0.03 },
48- .{ .provider = "opencode", .id = "gemini-3.6-flash", .name = "Gemini 3.6 Flash", .api = "google-generative-ai", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1048576, .max_output = 65536, .effort = &.{ "minimal", "low", "medium", "high" }, .cost_input = 1.5, .cost_output = 7.5, .cost_cache_read = 0.15 },
49- .{ .provider = "opencode", .id = "gemini-3.7-flash", .name = "Gemini 3.7 Flash", .api = "google-generative-ai", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1048576, .max_output = 65536, .effort = &.{ "low", "medium", "high" }, .cost_input = 1.5, .cost_output = 7.5, .cost_cache_read = 0.15 },
50- .{ .provider = "opencode", .id = "gemini-3.8-flash", .name = "Gemini 3.8 Flash", .api = "google-generative-ai", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1048576, .max_output = 65536, .effort = &.{ "low", "medium", "high" }, .cost_input = 1.5, .cost_output = 7.5, .cost_cache_read = 0.15 },
51- .{ .provider = "opencode", .id = "glm-5", .name = "GLM-5", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = false, .reasoning = true, .context = 204800, .max_output = 131072, .effort = &.{}, .cost_input = 1.0, .cost_output = 3.2, .cost_cache_read = 0.2 },
52- .{ .provider = "opencode", .id = "glm-5.1", .name = "GLM-5.1", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = false, .reasoning = true, .context = 204800, .max_output = 131072, .effort = &.{}, .cost_input = 1.4, .cost_output = 4.4, .cost_cache_read = 0.26 },
53- .{ .provider = "opencode", .id = "glm-5.2", .name = "GLM-5.2", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = false, .reasoning = true, .context = 1000000, .max_output = 131072, .effort = &.{ "high", "max" }, .cost_input = 1.4, .cost_output = 4.4, .cost_cache_read = 0.26 },
54- .{ .provider = "opencode", .id = "glm-5.3", .name = "GLM-5.3", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = false, .reasoning = true, .context = 1000000, .max_output = 131072, .effort = &.{ "low", "high", "max" }, .cost_input = 1.4, .cost_output = 4.4, .cost_cache_read = 0.26 },
55- .{ .provider = "opencode", .id = "glm-5.3-flash", .name = "GLM-5.3-Flash", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 131072, .effort = &.{ "low", "high", "max" }, .cost_input = 0.15, .cost_output = 0.5, .cost_cache_read = 0.03 },
56- .{ .provider = "opencode", .id = "gpt-5", .name = "GPT-5", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 400000, .max_output = 128000, .effort = &.{ "minimal", "low", "medium", "high" }, .cost_input = 1.07, .cost_output = 8.5, .cost_cache_read = 0.107 },
57- .{ .provider = "opencode", .id = "gpt-5-codex", .name = "GPT-5 Codex", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 400000, .max_output = 128000, .effort = &.{ "low", "medium", "high" }, .cost_input = 1.07, .cost_output = 8.5, .cost_cache_read = 0.107 },
58- .{ .provider = "opencode", .id = "gpt-5-nano", .name = "GPT-5 Nano", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 400000, .max_output = 128000, .effort = &.{ "minimal", "low", "medium", "high" }, .cost_input = 0.05, .cost_output = 0.4, .cost_cache_read = 0.005 },
59- .{ .provider = "opencode", .id = "gpt-5.1", .name = "GPT-5.1", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 400000, .max_output = 128000, .effort = &.{ "none", "low", "medium", "high" }, .cost_input = 1.07, .cost_output = 8.5, .cost_cache_read = 0.107 },
60- .{ .provider = "opencode", .id = "gpt-5.1-codex", .name = "GPT-5.1 Codex", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 400000, .max_output = 128000, .effort = &.{ "low", "medium", "high" }, .cost_input = 1.07, .cost_output = 8.5, .cost_cache_read = 0.107 },
61- .{ .provider = "opencode", .id = "gpt-5.1-codex-max", .name = "GPT-5.1 Codex Max", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 400000, .max_output = 128000, .effort = &.{ "low", "medium", "high", "xhigh" }, .cost_input = 1.25, .cost_output = 10.0, .cost_cache_read = 0.125 },
62- .{ .provider = "opencode", .id = "gpt-5.1-codex-mini", .name = "GPT-5.1 Codex Mini", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 400000, .max_output = 128000, .effort = &.{ "low", "medium", "high" }, .cost_input = 0.25, .cost_output = 2.0, .cost_cache_read = 0.025 },
63- .{ .provider = "opencode", .id = "gpt-5.2", .name = "GPT-5.2", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 400000, .max_output = 128000, .effort = &.{ "none", "low", "medium", "high", "xhigh" }, .cost_input = 1.75, .cost_output = 14.0, .cost_cache_read = 0.175 },
64- .{ .provider = "opencode", .id = "gpt-5.2-codex", .name = "GPT-5.2 Codex", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 400000, .max_output = 128000, .effort = &.{ "low", "medium", "high", "xhigh" }, .cost_input = 1.75, .cost_output = 14.0, .cost_cache_read = 0.175 },
65- .{ .provider = "opencode", .id = "gpt-5.3-codex", .name = "GPT-5.3 Codex", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 400000, .max_output = 128000, .effort = &.{ "none", "low", "medium", "high", "xhigh" }, .cost_input = 1.75, .cost_output = 14.0, .cost_cache_read = 0.175 },
66- .{ .provider = "opencode", .id = "gpt-5.3-codex-spark", .name = "GPT-5.3 Codex Spark", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = false, .reasoning = true, .context = 128000, .max_output = 128000, .effort = &.{ "low", "medium", "high", "xhigh" }, .cost_input = 1.75, .cost_output = 14.0, .cost_cache_read = 0.175 },
67- .{ .provider = "opencode", .id = "gpt-5.4", .name = "GPT-5.4", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1050000, .max_output = 128000, .effort = &.{ "none", "low", "medium", "high", "xhigh" }, .cost_input = 2.5, .cost_output = 15.0, .cost_cache_read = 0.25 },
68- .{ .provider = "opencode", .id = "gpt-5.4-mini", .name = "GPT-5.4 Mini", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 400000, .max_output = 128000, .effort = &.{ "none", "low", "medium", "high", "xhigh" }, .cost_input = 0.75, .cost_output = 4.5, .cost_cache_read = 0.075 },
69- .{ .provider = "opencode", .id = "gpt-5.4-nano", .name = "GPT-5.4 Nano", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 400000, .max_output = 128000, .effort = &.{ "none", "low", "medium", "high", "xhigh" }, .cost_input = 0.2, .cost_output = 1.25, .cost_cache_read = 0.02 },
70- .{ .provider = "opencode", .id = "gpt-5.4-pro", .name = "GPT-5.4 Pro", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1050000, .max_output = 128000, .effort = &.{ "medium", "high", "xhigh" }, .cost_input = 30.0, .cost_output = 180.0, .cost_cache_read = 30.0 },
71- .{ .provider = "opencode", .id = "gpt-5.5", .name = "GPT-5.5", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1050000, .max_output = 128000, .effort = &.{ "none", "low", "medium", "high", "xhigh" }, .cost_input = 5.0, .cost_output = 30.0, .cost_cache_read = 0.5 },
72- .{ .provider = "opencode", .id = "gpt-5.5-pro", .name = "GPT-5.5 Pro", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1050000, .max_output = 128000, .effort = &.{ "medium", "high", "xhigh" }, .cost_input = 30.0, .cost_output = 180.0, .cost_cache_read = 30.0 },
73- .{ .provider = "opencode", .id = "gpt-5.6-luna", .name = "GPT-5.6 Luna", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1050000, .max_output = 128000, .effort = &.{ "none", "low", "medium", "high", "xhigh", "max" }, .cost_input = 0.2, .cost_output = 1.2, .cost_cache_read = 0.02 },
74- .{ .provider = "opencode", .id = "gpt-5.6-sol", .name = "GPT-5.6 Sol", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1050000, .max_output = 128000, .effort = &.{ "none", "low", "medium", "high", "xhigh", "max" }, .cost_input = 4.0, .cost_output = 20.0, .cost_cache_read = 0.4 },
75- .{ .provider = "opencode", .id = "gpt-5.6-terra", .name = "GPT-5.6 Terra", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1050000, .max_output = 128000, .effort = &.{ "none", "low", "medium", "high", "xhigh", "max" }, .cost_input = 2.5, .cost_output = 15.0, .cost_cache_read = 0.25 },
76- .{ .provider = "opencode", .id = "gpt-6-astra", .name = "GPT-6 Astra", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1050000, .max_output = 128000, .effort = &.{ "low", "medium", "high", "xhigh", "max" }, .cost_input = 10.0, .cost_output = 50.0, .cost_cache_read = 1.0 },
77- .{ .provider = "opencode", .id = "gpt-6-luna", .name = "GPT-6 Luna", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1050000, .max_output = 128000, .effort = &.{ "none", "low", "medium", "high", "xhigh", "max" }, .cost_input = 0.1, .cost_output = 0.5, .cost_cache_read = 0.01 },
78- .{ .provider = "opencode", .id = "gpt-6-sol", .name = "GPT-6 Sol", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1050000, .max_output = 128000, .effort = &.{ "none", "low", "medium", "high", "xhigh", "max" }, .cost_input = 2.0, .cost_output = 10.0, .cost_cache_read = 0.2 },
79- .{ .provider = "opencode", .id = "gpt-6.1-sol", .name = "GPT-6.1 Sol", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1050000, .max_output = 128000, .effort = &.{ "low", "medium", "high", "xhigh", "max" }, .cost_input = 2.0, .cost_output = 10.0, .cost_cache_read = 0.1 },
80- .{ .provider = "opencode", .id = "grok-4.5", .name = "Grok 4.5", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 500000, .max_output = 500000, .effort = &.{ "low", "medium", "high" }, .cost_input = 2.0, .cost_output = 6.0, .cost_cache_read = 0.3 },
81- .{ .provider = "opencode", .id = "grok-4.6", .name = "Grok 4.6", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 500000, .max_output = 500000, .effort = &.{ "low", "medium", "high", "xhigh" }, .cost_input = 2.0, .cost_output = 6.0, .cost_cache_read = 0.5 },
82- .{ .provider = "opencode", .id = "grok-4.7", .name = "Grok 4.7", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 500000, .max_output = 500000, .effort = &.{ "low", "medium", "high", "xhigh" }, .cost_input = 2.0, .cost_output = 6.0, .cost_cache_read = 0.5 },
83- .{ .provider = "opencode", .id = "grok-build-0.1", .name = "Grok Build 0.1", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 256000, .max_output = 256000, .effort = &.{}, .cost_input = 1.0, .cost_output = 2.0, .cost_cache_read = 0.2 },
84- .{ .provider = "opencode", .id = "kimi-k2.5", .name = "Kimi K2.5", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 262144, .max_output = 65536, .effort = &.{}, .cost_input = 0.6, .cost_output = 3.0, .cost_cache_read = 0.08 },
85- .{ .provider = "opencode", .id = "kimi-k2.6", .name = "Kimi K2.6", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 262144, .max_output = 65536, .effort = &.{}, .cost_input = 0.95, .cost_output = 4.0, .cost_cache_read = 0.16 },
86- .{ .provider = "opencode", .id = "kimi-k2.7-code", .name = "Kimi K2.7 Code", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 262144, .max_output = 262144, .effort = &.{}, .cost_input = 0.95, .cost_output = 4.0, .cost_cache_read = 0.19 },
87- .{ .provider = "opencode", .id = "kimi-k3", .name = "Kimi K3", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1048576, .max_output = 131072, .effort = &.{"max"}, .cost_input = 3.0, .cost_output = 15.0, .cost_cache_read = 0.3 },
88- .{ .provider = "opencode", .id = "ling-3.0-flash-fin-free", .name = "Ling 3.0 Flash Fin Free", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = false, .reasoning = true, .context = 262144, .max_output = 32768, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
89- .{ .provider = "opencode", .id = "ling-3.1-flash-free", .name = "Ling 3.1 Flash Free", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = false, .reasoning = true, .context = 262144, .max_output = 32768, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
90- .{ .provider = "opencode", .id = "longcat-2.5-preview-free", .name = "LongCat 2.5 Preview Free", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 131072, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
91- .{ .provider = "opencode", .id = "mimo-v2.6-flash-free", .name = "MiMo-V2.6-Flash Free", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 200000, .max_output = 32000, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
92- .{ .provider = "opencode", .id = "minimax-m2.5", .name = "MiniMax-M2.5", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = false, .reasoning = true, .context = 204800, .max_output = 131072, .effort = &.{}, .cost_input = 0.3, .cost_output = 1.2, .cost_cache_read = 0.06 },
93- .{ .provider = "opencode", .id = "minimax-m2.7", .name = "MiniMax-M2.7", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = false, .reasoning = true, .context = 204800, .max_output = 131072, .effort = &.{}, .cost_input = 0.3, .cost_output = 1.2, .cost_cache_read = 0.06 },
94- .{ .provider = "opencode", .id = "minimax-m3", .name = "MiniMax-M3", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 512000, .max_output = 128000, .effort = &.{}, .cost_input = 0.3, .cost_output = 1.2, .cost_cache_read = 0.06 },
95- .{ .provider = "opencode", .id = "mistral-large-4", .name = "Mistral Large 4", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 524288, .max_output = 262144, .effort = &.{ "none", "high" }, .cost_input = 0.68, .cost_output = 2.09, .cost_cache_read = 0.07 },
96- .{ .provider = "opencode", .id = "muse-spark-1.2", .name = "Muse Spark 1.2", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1048576, .max_output = 131072, .effort = &.{ "minimal", "low", "medium", "high", "xhigh" }, .cost_input = 1.25, .cost_output = 4.25, .cost_cache_read = 0.15 },
97- .{ .provider = "opencode", .id = "muse-spark-1.2-contributor-free", .name = "Muse Spark 1.2 Free", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1048576, .max_output = 131072, .effort = &.{ "minimal", "low", "medium", "high", "xhigh" }, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
98- .{ .provider = "opencode", .id = "muse-spark-1.3", .name = "Muse Spark 1.3", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1048576, .max_output = 131072, .effort = &.{ "minimal", "low", "medium", "high", "xhigh" }, .cost_input = 1.25, .cost_output = 4.25, .cost_cache_read = 0.15 },
99- .{ .provider = "opencode", .id = "muse-spark-1.3-contributor-free", .name = "Muse Spark 1.3 Free", .api = "openai-responses", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1048576, .max_output = 131072, .effort = &.{ "minimal", "low", "medium", "high", "xhigh" }, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
100- .{ .provider = "opencode", .id = "nemotron-3-ultra-free", .name = "Nemotron 3 Ultra Free", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = false, .reasoning = true, .context = 1000000, .max_output = 128000, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
101- .{ .provider = "opencode", .id = "nemotron-3.5-lightning-free", .name = "Nemotron 3.5 Lightning Free", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = false, .reasoning = true, .context = 262144, .max_output = 262144, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
102- .{ .provider = "opencode", .id = "qwen3.5-plus", .name = "Qwen3.5 Plus", .api = "anthropic-messages", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 262144, .max_output = 65536, .effort = &.{}, .cost_input = 0.2, .cost_output = 1.2, .cost_cache_read = 0.02 },
103- .{ .provider = "opencode", .id = "qwen3.6-plus", .name = "Qwen3.6 Plus", .api = "anthropic-messages", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 262144, .max_output = 65536, .effort = &.{}, .cost_input = 0.5, .cost_output = 3.0, .cost_cache_read = 0.05 },
104- .{ .provider = "opencode", .id = "qwen3.8-flash", .name = "Qwen3.8 Flash", .api = "anthropic-messages", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 131072, .effort = &.{ "low", "medium", "xhigh" }, .cost_input = 0.15, .cost_output = 0.47, .cost_cache_read = 0.016 },
105- .{ .provider = "opencode", .id = "qwen3.8-max", .name = "Qwen3.8 Max", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 262144, .max_output = 131072, .effort = &.{}, .cost_input = 2.0, .cost_output = 6.0, .cost_cache_read = 0.25 },
106- .{ .provider = "opencode", .id = "space-bunny-free", .name = "Space Bunny Free", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1048576, .max_output = 524288, .effort = &.{ "low", "medium", "high", "xhigh", "max" }, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
107- .{ .provider = "opencode", .id = "step-5-preview-free", .name = "Step 5 Preview Free", .api = "openai-completions", .base_url = "https://opencode.ai/zen/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 65536, .effort = &.{ "low", "medium", "high" }, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
108- .{ .provider = "opencode-go", .id = "claude-haiku-5-5", .name = "Claude Haiku 5.5", .api = "anthropic-messages", .base_url = "https://opencode.ai/zen/go/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 128000, .effort = &.{ "low", "medium", "high", "xhigh", "max" }, .cost_input = 0.1, .cost_output = 0.5, .cost_cache_read = 0.01 },
109- .{ .provider = "opencode-go", .id = "deepseek-flash", .name = "deepseek-flash", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = false, .reasoning = false, .context = 0, .max_output = 0, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
110- .{ .provider = "opencode-go", .id = "deepseek-v4-flash", .name = "DeepSeek V4 Flash", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = false, .reasoning = true, .context = 1000000, .max_output = 384000, .effort = &.{ "low", "high", "max" }, .cost_input = 0.15, .cost_output = 0.6, .cost_cache_read = 0.003 },
111- .{ .provider = "opencode-go", .id = "deepseek-v4-flash-vision-exp", .name = "DeepSeek V4 Flash Vision Exp", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 384000, .effort = &.{ "low", "high", "max" }, .cost_input = 0.15, .cost_output = 0.6, .cost_cache_read = 0.003 },
112- .{ .provider = "opencode-go", .id = "deepseek-v4-pro", .name = "DeepSeek V4 Pro (New)", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = false, .reasoning = true, .context = 1000000, .max_output = 384000, .effort = &.{ "high", "max" }, .cost_input = 0.66, .cost_output = 1.98, .cost_cache_read = 0.022 },
113- .{ .provider = "opencode-go", .id = "deepseek-v4.1-flash", .name = "DeepSeek V4.1 Flash", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 384000, .effort = &.{ "low", "high", "max" }, .cost_input = 0.15, .cost_output = 0.6, .cost_cache_read = 0.003 },
114- .{ .provider = "opencode-go", .id = "glm-5", .name = "glm-5", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = false, .reasoning = false, .context = 0, .max_output = 0, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
115- .{ .provider = "opencode-go", .id = "glm-5.1", .name = "glm-5.1", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = false, .reasoning = false, .context = 0, .max_output = 0, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
116- .{ .provider = "opencode-go", .id = "glm-5.2", .name = "GLM-5.2", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = false, .reasoning = true, .context = 1000000, .max_output = 131072, .effort = &.{ "high", "max" }, .cost_input = 1.4, .cost_output = 4.4, .cost_cache_read = 0.26 },
117- .{ .provider = "opencode-go", .id = "glm-5.3", .name = "GLM-5.3", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = false, .reasoning = true, .context = 1000000, .max_output = 131072, .effort = &.{ "low", "high", "max" }, .cost_input = 1.4, .cost_output = 4.4, .cost_cache_read = 0.26 },
118- .{ .provider = "opencode-go", .id = "glm-5.3-flash", .name = "GLM-5.3-Flash", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 131072, .effort = &.{ "low", "high", "max" }, .cost_input = 0.15, .cost_output = 0.5, .cost_cache_read = 0.03 },
119- .{ .provider = "opencode-go", .id = "gpt-5.6-luna", .name = "GPT-5.6 Luna", .api = "openai-responses", .base_url = "https://opencode.ai/zen/go/v1", .images = true, .reasoning = true, .context = 1050000, .max_output = 128000, .effort = &.{ "none", "low", "medium", "high", "xhigh", "max" }, .cost_input = 0.2, .cost_output = 1.2, .cost_cache_read = 0.02 },
120- .{ .provider = "opencode-go", .id = "gpt-6-luna", .name = "GPT-6 Luna", .api = "openai-responses", .base_url = "https://opencode.ai/zen/go/v1", .images = true, .reasoning = true, .context = 1050000, .max_output = 128000, .effort = &.{ "none", "low", "medium", "high", "xhigh", "max" }, .cost_input = 0.1, .cost_output = 0.5, .cost_cache_read = 0.01 },
121- .{ .provider = "opencode-go", .id = "grok-4.5", .name = "Grok 4.5", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = true, .reasoning = true, .context = 500000, .max_output = 500000, .effort = &.{ "low", "medium", "high" }, .cost_input = 2.0, .cost_output = 6.0, .cost_cache_read = 0.3 },
122- .{ .provider = "opencode-go", .id = "grok-4.6", .name = "Grok 4.6", .api = "openai-responses", .base_url = "https://opencode.ai/zen/go/v1", .images = true, .reasoning = true, .context = 500000, .max_output = 500000, .effort = &.{ "low", "medium", "high", "xhigh" }, .cost_input = 2.0, .cost_output = 6.0, .cost_cache_read = 0.5 },
123- .{ .provider = "opencode-go", .id = "grok-4.7", .name = "Grok 4.7", .api = "openai-responses", .base_url = "https://opencode.ai/zen/go/v1", .images = true, .reasoning = true, .context = 500000, .max_output = 500000, .effort = &.{ "low", "medium", "high", "xhigh" }, .cost_input = 2.0, .cost_output = 6.0, .cost_cache_read = 0.5 },
124- .{ .provider = "opencode-go", .id = "hy3", .name = "Hy3", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = false, .reasoning = true, .context = 256000, .max_output = 128000, .effort = &.{ "none", "low", "high" }, .cost_input = 0.14, .cost_output = 0.58, .cost_cache_read = 0.035 },
125- .{ .provider = "opencode-go", .id = "hy3-preview", .name = "hy3-preview", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = false, .reasoning = false, .context = 0, .max_output = 0, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
126- .{ .provider = "opencode-go", .id = "hy4-preview", .name = "Hy4 preview", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = false, .reasoning = true, .context = 1024000, .max_output = 64000, .effort = &.{ "none", "high" }, .cost_input = 0.834, .cost_output = 2.501, .cost_cache_read = 0.042 },
127- .{ .provider = "opencode-go", .id = "kimi-k2.5", .name = "kimi-k2.5", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = false, .reasoning = false, .context = 0, .max_output = 0, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
128- .{ .provider = "opencode-go", .id = "kimi-k2.6", .name = "Kimi K2.6", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = true, .reasoning = true, .context = 262144, .max_output = 65536, .effort = &.{}, .cost_input = 0.95, .cost_output = 4.0, .cost_cache_read = 0.16 },
129- .{ .provider = "opencode-go", .id = "kimi-k2.7-code", .name = "Kimi K2.7 Code", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = true, .reasoning = true, .context = 262144, .max_output = 262144, .effort = &.{}, .cost_input = 0.95, .cost_output = 4.0, .cost_cache_read = 0.19 },
130- .{ .provider = "opencode-go", .id = "kimi-k3", .name = "Kimi K3", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = true, .reasoning = true, .context = 1048576, .max_output = 131072, .effort = &.{"max"}, .cost_input = 3.0, .cost_output = 15.0, .cost_cache_read = 0.3 },
131- .{ .provider = "opencode-go", .id = "longcat-2.0", .name = "LongCat-2.0", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = false, .reasoning = true, .context = 1000000, .max_output = 131072, .effort = &.{}, .cost_input = 0.3, .cost_output = 1.2, .cost_cache_read = 0.006 },
132- .{ .provider = "opencode-go", .id = "longcat-2.5-preview-free", .name = "LongCat 2.5 Preview Free", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 131072, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
133- .{ .provider = "opencode-go", .id = "mimo-v2-omni", .name = "mimo-v2-omni", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = false, .reasoning = false, .context = 0, .max_output = 0, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
134- .{ .provider = "opencode-go", .id = "mimo-v2-pro", .name = "mimo-v2-pro", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = false, .reasoning = false, .context = 0, .max_output = 0, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
135- .{ .provider = "opencode-go", .id = "mimo-v2.5", .name = "MiMo V2.5", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 128000, .effort = &.{}, .cost_input = 0.14, .cost_output = 0.28, .cost_cache_read = 0.0028 },
136- .{ .provider = "opencode-go", .id = "mimo-v2.5-pro", .name = "MiMo V2.5 Pro", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = true, .reasoning = true, .context = 1048576, .max_output = 128000, .effort = &.{}, .cost_input = 0.435, .cost_output = 0.87, .cost_cache_read = 0.003625 },
137- .{ .provider = "opencode-go", .id = "mimo-v2.6-flash", .name = "MiMo-V2.6-Flash", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = true, .reasoning = true, .context = 1048576, .max_output = 131072, .effort = &.{}, .cost_input = 0.14, .cost_output = 0.28, .cost_cache_read = 0.0028 },
138- .{ .provider = "opencode-go", .id = "mimo-v2.6-pro", .name = "MiMo-V2.6-Pro", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = true, .reasoning = true, .context = 1048576, .max_output = 131072, .effort = &.{}, .cost_input = 0.435, .cost_output = 0.87, .cost_cache_read = 0.003625 },
139- .{ .provider = "opencode-go", .id = "minimax-m2.5", .name = "minimax-m2.5", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = false, .reasoning = false, .context = 0, .max_output = 0, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
140- .{ .provider = "opencode-go", .id = "minimax-m2.7", .name = "MiniMax-M2.7", .api = "anthropic-messages", .base_url = "https://opencode.ai/zen/go/v1", .images = false, .reasoning = true, .context = 204800, .max_output = 131072, .effort = &.{}, .cost_input = 0.3, .cost_output = 1.2, .cost_cache_read = 0.06 },
141- .{ .provider = "opencode-go", .id = "minimax-m3", .name = "MiniMax-M3", .api = "anthropic-messages", .base_url = "https://opencode.ai/zen/go/v1", .images = false, .reasoning = true, .context = 1000000, .max_output = 131072, .effort = &.{}, .cost_input = 0.3, .cost_output = 1.2, .cost_cache_read = 0.06 },
142- .{ .provider = "opencode-go", .id = "muse-spark-1.2-contributor", .name = "Muse Spark 1.2 Contributor", .api = "openai-responses", .base_url = "https://opencode.ai/zen/go/v1", .images = true, .reasoning = true, .context = 1048576, .max_output = 131072, .effort = &.{ "minimal", "low", "medium", "high", "xhigh" }, .cost_input = 0.1, .cost_output = 0.2, .cost_cache_read = 0.002 },
143- .{ .provider = "opencode-go", .id = "muse-spark-1.3-contributor", .name = "Muse Spark 1.3 Contributor", .api = "openai-responses", .base_url = "https://opencode.ai/zen/go/v1", .images = true, .reasoning = true, .context = 1048576, .max_output = 131072, .effort = &.{ "minimal", "low", "medium", "high", "xhigh" }, .cost_input = 0.1, .cost_output = 0.2, .cost_cache_read = 0.002 },
144- .{ .provider = "opencode-go", .id = "omen-alpha", .name = "omen-alpha", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = false, .reasoning = false, .context = 0, .max_output = 0, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
145- .{ .provider = "opencode-go", .id = "qwen3.5-plus", .name = "qwen3.5-plus", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = false, .reasoning = false, .context = 0, .max_output = 0, .effort = &.{}, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
146- .{ .provider = "opencode-go", .id = "qwen3.6-plus", .name = "Qwen3.6 Plus", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 65536, .effort = &.{}, .cost_input = 0.5, .cost_output = 3.0, .cost_cache_read = 0.05 },
147- .{ .provider = "opencode-go", .id = "qwen3.7-max", .name = "Qwen3.7 Max", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = false, .reasoning = true, .context = 1000000, .max_output = 65536, .effort = &.{}, .cost_input = 2.5, .cost_output = 7.5, .cost_cache_read = 0.5 },
148- .{ .provider = "opencode-go", .id = "qwen3.7-plus", .name = "Qwen3.7 Plus", .api = "anthropic-messages", .base_url = "https://opencode.ai/zen/go/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 65536, .effort = &.{}, .cost_input = 0.4, .cost_output = 1.6, .cost_cache_read = 0.04 },
149- .{ .provider = "opencode-go", .id = "qwen3.8-flash", .name = "Qwen3.8 Flash", .api = "anthropic-messages", .base_url = "https://opencode.ai/zen/go/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 131072, .effort = &.{ "low", "medium", "xhigh" }, .cost_input = 0.15, .cost_output = 0.47, .cost_cache_read = 0.016 },
150- .{ .provider = "opencode-go", .id = "qwen3.8-max", .name = "Qwen3.8 Max", .api = "anthropic-messages", .base_url = "https://opencode.ai/zen/go/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 131072, .effort = &.{ "low", "medium", "xhigh" }, .cost_input = 2.0, .cost_output = 6.0, .cost_cache_read = 0.25 },
151- .{ .provider = "opencode-go", .id = "space-bunny", .name = "Space Bunny", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = true, .reasoning = true, .context = 1048576, .max_output = 524288, .effort = &.{ "low", "medium", "high", "xhigh", "max" }, .cost_input = 0.15, .cost_output = 0.6, .cost_cache_read = 0.03 },
152- .{ .provider = "opencode-go", .id = "step-5-preview-free", .name = "Step 5 Preview Free", .api = "openai-completions", .base_url = "https://opencode.ai/zen/go/v1", .images = true, .reasoning = true, .context = 1000000, .max_output = 65536, .effort = &.{ "low", "medium", "high" }, .cost_input = 0.0, .cost_output = 0.0, .cost_cache_read = 0.0 },
153-};
154-
155-pub fn lookup(provider: []const u8, id: []const u8) ?*const ModelInfo {
156- for (&entries) |*e| {
157- if (std.mem.eql(u8, e.provider, provider) and std.mem.eql(u8, e.id, id)) return e;
158- }
159- return null;
160-}
src/http.zig+35−0
@@ -40,6 +40,41 @@ const CancelWatch = struct {
4040 }
4141 };
4242
43+pub fn get(
44+ a: std.mem.Allocator,
45+ url: []const u8,
46+ headers: []const Header,
47+ cancel: *const std.atomic.Value(bool),
48+) HttpError![]u8 {
49+ if (cancel.load(.acquire)) return error.Aborted;
50+ const uri = std.Uri.parse(url) catch return error.RequestFailed;
51+ var client: std.http.Client = .{ .allocator = a, .io = platform.io };
52+ defer client.deinit();
53+
54+ var hdrs: std.ArrayList(std.http.Header) = .empty;
55+ defer hdrs.deinit(a);
56+ for (headers) |h| hdrs.append(a, .{ .name = h.name, .value = h.value }) catch return error.OutOfMemory;
57+
58+ var req = client.request(.GET, uri, .{
59+ .redirect_behavior = .unhandled,
60+ .extra_headers = hdrs.items,
61+ .headers = .{ .user_agent = .{ .override = user_agent } },
62+ }) catch return error.RequestFailed;
63+ defer req.deinit();
64+
65+ req.sendBodiless() catch return error.RequestFailed;
66+ var response = req.receiveHead(&.{}) catch return error.RequestFailed;
67+ const status = @intFromEnum(response.head.status);
68+
69+ var transfer: [16 * 1024]u8 = undefined;
70+ var decompress: std.http.Decompress = undefined;
71+ var decompress_buf: [std.compress.flate.max_window_len]u8 = undefined;
72+ const reader = response.readerDecompressing(&transfer, &decompress, &decompress_buf);
73+
74+ if (status < 200 or status >= 300) return error.HttpStatus;
75+ return reader.allocRemaining(a, .limited(1 << 22)) catch return error.ReadFailed;
76+}
77+
4378 pub fn postSse(
4479 a: std.mem.Allocator,
4580 url: []const u8,
src/models.zig+49−18
@@ -1,6 +1,7 @@
11 const std = @import("std");
22 const platform = @import("platform.zig");
3-const catalog = @import("catalog.zig");
3+const modelsdev = @import("models_dev.zig");
4+const http = @import("http.zig");
45 const config = @import("config.zig");
56 const types = @import("types.zig");
67
@@ -92,7 +93,11 @@ pub fn resolve(a: std.mem.Allocator, cfg: *const config.Config, err: *?[]const u
9293
9394 pub fn resolveNamed(a: std.mem.Allocator, cfg: *const config.Config, provider_id: []const u8, model_id: []const u8, err: *?[]const u8) ?types.Model {
9495 if (builtin(provider_id)) |b| {
95- const info = catalog.lookup(provider_id, model_id) orelse {
96+ var db = modelsdev.Db.open(a) catch {
97+ err.* = "model metadata unavailable";
98+ return null;
99+ };
100+ const info = db.info(provider_id, model_id) orelse {
96101 err.* = unknownModel(a, model_id, provider_id);
97102 return null;
98103 };
@@ -164,23 +169,47 @@ pub fn providers(a: std.mem.Allocator, cfg: *const config.Config) []ProviderEntr
164169 return out.toOwnedSlice(a) catch &.{};
165170 }
166171
167-pub fn catalogModels(a: std.mem.Allocator, cfg: *const config.Config, provider_id: []const u8) ![]types.Model {
168- var out: std.ArrayList(types.Model) = .empty;
169- for (&catalog.entries) |*entry| {
170- if (!std.mem.eql(u8, entry.provider, provider_id)) continue;
171- var err: ?[]const u8 = null;
172- if (resolveNamed(a, cfg, provider_id, entry.id, &err)) |m| try out.append(a, m);
173- }
174- if (custom(cfg, provider_id)) |p| {
175- for (p.models) |m| {
176- var err: ?[]const u8 = null;
177- if (resolveNamed(a, cfg, provider_id, m.id, &err)) |resolved| try out.append(a, resolved);
178- }
172+pub const Entry = struct { id: []const u8, name: []const u8 };
173+
174+/// The models a provider offers. Built-ins are asked over the wire
175+/// (authenticated, so the provider decides what is enabled); a model with no
176+/// models.dev metadata is skipped. Custom providers list what they declare.
177+pub fn listing(
178+ a: std.mem.Allocator,
179+ cfg: *const config.Config,
180+ provider_id: []const u8,
181+ cancel: *const std.atomic.Value(bool),
182+) ![]Entry {
183+ if (custom(cfg, provider_id)) |p| return customListing(a, p);
184+ const b = builtin(provider_id) orelse return error.UnknownProvider;
185+ var db = modelsdev.Db.open(a) catch return error.ModelMetadataUnavailable;
186+ const base = db.baseUrl(provider_id) orelse return error.UnknownProvider;
187+ const key = firstEnv(b.env_keys) orelse return error.MissingApiKey;
188+
189+ const url = try std.fmt.allocPrint(a, "{s}/models", .{base});
190+ const authorization = try std.fmt.allocPrint(a, "Bearer {s}", .{key});
191+ const body = try http.get(a, url, &.{.{ .name = "Authorization", .value = authorization }}, cancel);
192+
193+ const List = struct {
194+ data: []const struct { id: []const u8 },
195+ };
196+ const parsed = try std.json.parseFromSliceLeaky(List, a, body, .{ .ignore_unknown_fields = true });
197+
198+ var out: std.ArrayList(Entry) = .empty;
199+ for (parsed.data) |model| {
200+ const info = db.info(provider_id, model.id) orelse continue;
201+ try out.append(a, .{ .id = model.id, .name = info.name });
179202 }
180203 return out.toOwnedSlice(a);
181204 }
182205
183-pub fn supportedLevels(cfg: *const config.Config, provider_id: []const u8, model_id: []const u8) []const []const u8 {
206+fn customListing(a: std.mem.Allocator, p: *const config.CustomProvider) ![]Entry {
207+ var out: std.ArrayList(Entry) = .empty;
208+ for (p.models) |m| try out.append(a, .{ .id = m.id, .name = m.name orelse m.id });
209+ return out.toOwnedSlice(a);
210+}
211+
212+pub fn supportedLevels(a: std.mem.Allocator, cfg: *const config.Config, provider_id: []const u8, model_id: []const u8) []const []const u8 {
184213 if (builtin(provider_id) == null) {
185214 if (custom(cfg, provider_id)) |p| {
186215 for (p.models) |m| {
@@ -192,13 +221,14 @@ pub fn supportedLevels(cfg: *const config.Config, provider_id: []const u8, model
192221 }
193222 return &ladder;
194223 }
195- const info = catalog.lookup(provider_id, model_id) orelse return &ladder;
224+ var db = modelsdev.Db.open(a) catch return &ladder;
225+ const info = db.info(provider_id, model_id) orelse return &ladder;
196226 if (!info.reasoning) return &.{"off"};
197227 if (info.effort.len == 0) return &ladder;
198228 return info.effort;
199229 }
200230
201-pub fn clampNamed(cfg: *const config.Config, provider_id: []const u8, model_id: []const u8, desired: []const u8) []const u8 {
231+pub fn clampNamed(a: std.mem.Allocator, cfg: *const config.Config, provider_id: []const u8, model_id: []const u8, desired: []const u8) []const u8 {
202232 if (builtin(provider_id) == null) {
203233 if (custom(cfg, provider_id)) |p| {
204234 for (p.models) |m| {
@@ -207,7 +237,8 @@ pub fn clampNamed(cfg: *const config.Config, provider_id: []const u8, model_id:
207237 }
208238 return desired;
209239 }
210- const info = catalog.lookup(provider_id, model_id) orelse return desired;
240+ var db = modelsdev.Db.open(a) catch return desired;
241+ const info = db.info(provider_id, model_id) orelse return desired;
211242 return clampEffort(info.reasoning, info.effort, desired);
212243 }
213244
src/tui/tui.zig+78−17
@@ -111,6 +111,15 @@ const Tui = struct {
111111 pending_command: enum { none, provider, model, thinking } = .none,
112112 pending_provider: ?[]const u8 = null,
113113
114+ model_thread: ?std.Thread = null,
115+ model_abort: std.atomic.Value(bool) = std.atomic.Value(bool).init(false),
116+ model_ready: std.atomic.Value(bool) = std.atomic.Value(bool).init(false),
117+ model_ok: std.atomic.Value(bool) = std.atomic.Value(bool).init(false),
118+ model_entries: []const models_mod.Entry = &.{},
119+ model_provider: []const u8 = "",
120+ model_arena: std.heap.ArenaAllocator,
121+ model_m: std.mem.Allocator = undefined,
122+
114123 fn init(a: std.mem.Allocator, opts: *agent.Options, cfg: *const config.Config, tool_names: []const config.ToolName) Tui {
115124 return .{
116125 .opts = opts,
@@ -126,6 +135,7 @@ const Tui = struct {
126135 .sa = undefined,
127136 .qarena = std.heap.ArenaAllocator.init(a),
128137 .q = undefined,
138+ .model_arena = std.heap.ArenaAllocator.init(a),
129139 .reply = undefined,
130140 .activity = undefined,
131141 };
@@ -136,6 +146,7 @@ const Tui = struct {
136146 self.s = self.scratch.allocator();
137147 self.sa = self.sarena.allocator();
138148 self.q = self.qarena.allocator();
149+ self.model_m = self.model_arena.allocator();
139150 self.editor = editor_mod.Editor.init(self.backing);
140151 self.editor.bind();
141152 self.editor.s = self.s;
@@ -419,6 +430,7 @@ const Tui = struct {
419430 } else if (self.command_active) {
420431 self.command_active = false;
421432 self.prompt_open = false;
433+ self.model_abort.store(true, .seq_cst);
422434 self.dirty = true;
423435 } else if (self.editor.contents().len != 0) {
424436 self.editor.clear();
@@ -516,11 +528,11 @@ const Tui = struct {
516528 .provider => self.startProviderSelect(),
517529 .model => {
518530 const m = self.opts.model orelse return self.fail("! no model configured", .{});
519- self.startModelSelect(m.provider);
531+ self.startModelFetch(m.provider);
520532 },
521533 .thinking => {
522534 const m = self.opts.model orelse return self.fail("! no model configured", .{});
523- const levels = models_mod.supportedLevels(self.cfg, m.provider, m.id);
535+ const levels = models_mod.supportedLevels(self.a, self.cfg, m.provider, m.id);
524536 self.beginPrompt("Select a thinking level", levels, levels);
525537 self.pending_command = .thinking;
526538 },
@@ -575,26 +587,54 @@ const Tui = struct {
575587 self.pending_command = .provider;
576588 }
577589
578- fn startModelSelect(self: *Tui, provider_id: []const u8) void {
579- const list = models_mod.catalogModels(self.a, self.cfg, provider_id) catch {
580- self.fail("! out of memory", .{});
581- self.command_active = false;
590+ fn startModelFetch(self: *Tui, provider_id: []const u8) void {
591+ if (self.model_thread) |t| {
592+ self.model_abort.store(true, .seq_cst);
593+ t.join();
594+ self.model_thread = null;
595+ }
596+ _ = self.model_arena.reset(.retain_capacity);
597+ self.model_m = self.model_arena.allocator();
598+ self.model_provider = provider_id;
599+ self.model_entries = &.{};
600+ self.model_abort.store(false, .seq_cst);
601+ self.model_ok.store(false, .seq_cst);
602+ self.model_ready.store(false, .seq_cst);
603+ self.model_thread = std.Thread.spawn(.{}, modelFetchThread, .{self}) catch {
604+ self.fail("! cannot query models", .{});
582605 return;
583606 };
584- var ids: std.ArrayList([]const u8) = .empty;
585- var names: std.ArrayList([]const u8) = .empty;
586- for (list) |m| {
587- ids.append(self.a, m.id) catch {};
588- names.append(self.a, m.name) catch {};
607+ self.command_active = true;
608+ self.prompt_open = false;
609+ self.note(styles.dim(self.s, "querying models..."));
610+ self.dirty = true;
611+ }
612+
613+ fn modelFetchThread(self: *Tui) void {
614+ if (models_mod.listing(self.model_m, self.cfg, self.model_provider, &self.model_abort)) |entries| {
615+ self.model_entries = entries;
616+ self.model_ok.store(true, .seq_cst);
617+ } else |_| {
618+ self.model_ok.store(false, .seq_cst);
589619 }
590- if (ids.items.len == 0) {
591- self.fail("! no models for provider", .{});
620+ self.model_ready.store(true, .release);
621+ }
622+
623+ fn openModelsPrompt(self: *Tui) void {
624+ if (self.model_entries.len == 0) {
592625 self.command_active = false;
626+ self.fail("! no models for provider", .{});
593627 return;
594628 }
595- self.beginPrompt(std.fmt.allocPrint(self.a, "Select a model for {s}", .{provider_id}) catch "Select a model", names.items, ids.items);
629+ var ids: std.ArrayList([]const u8) = .empty;
630+ var names: std.ArrayList([]const u8) = .empty;
631+ for (self.model_entries) |e| {
632+ ids.append(self.a, e.id) catch {};
633+ names.append(self.a, e.name) catch {};
634+ }
635+ self.beginPrompt(std.fmt.allocPrint(self.a, "Select a model for {s}", .{self.model_provider}) catch "Select a model", names.items, ids.items);
596636 self.pending_command = .model;
597- self.pending_provider = provider_id;
637+ self.pending_provider = self.model_provider;
598638 }
599639
600640 fn beginPrompt(self: *Tui, message: []const u8, options: []const []const u8, ids: []const []const u8) void {
@@ -620,7 +660,7 @@ const Tui = struct {
620660 self.command_active = false;
621661 const id = matchOption(answer, self.prompt_options, self.prompt_ids) orelse return;
622662 switch (command) {
623- .provider => self.startModelSelect(id),
663+ .provider => self.startModelFetch(id),
624664 .model => {
625665 const provider_id = self.pending_provider orelse return;
626666 var err: ?[]const u8 = null;
@@ -634,7 +674,7 @@ const Tui = struct {
634674 const m = self.opts.model orelse return;
635675 const updated = self.a.create(types.Model) catch return;
636676 updated.* = m.*;
637- updated.effort = models_mod.clampNamed(self.cfg, m.provider, m.id, id);
677+ updated.effort = models_mod.clampNamed(self.a, self.cfg, m.provider, m.id, id);
638678 self.select(updated);
639679 config.save(self.a, self.cfg, .{ .thinking_effort = id }) catch {};
640680 },
@@ -682,6 +722,11 @@ const Tui = struct {
682722 self.closed = true;
683723 self.abort.store(true, .seq_cst);
684724 self.steering_ready.store(true, .seq_cst);
725+ self.model_abort.store(true, .seq_cst);
726+ if (self.model_thread) |t| {
727+ t.join();
728+ self.model_thread = null;
729+ }
685730 const width = @max(self.term.width(), 1);
686731 self.term.write(self.live.erase(self.a, width));
687732 self.term.write(self.scrollback.buf.items);
@@ -843,6 +888,22 @@ pub fn run(opts: agent.Options, cfg: *const config.Config, tool_names: []const c
843888 }
844889 self.event_mutex.unlock(platform.io);
845890
891+ if (self.model_thread) |t| {
892+ if (self.model_ready.load(.acquire)) {
893+ t.join();
894+ self.model_thread = null;
895+ if (self.command_active) {
896+ if (self.model_ok.load(.seq_cst)) {
897+ self.openModelsPrompt();
898+ } else {
899+ self.command_active = false;
900+ self.fail("! cannot load models", .{});
901+ }
902+ }
903+ self.dirty = true;
904+ }
905+ }
906+
846907 if (self.prompt_open and self.prompt_ready.load(.seq_cst)) self.answerPrompt();
847908
848909 if (self.turn_done.load(.seq_cst) and self.active) {
tools/gen_catalog.py+0−222
@@ -1,222 +0,0 @@
1-#!/usr/bin/env python3
2-"""Generates src/catalog.zig.
3-
4-The gateway decides which models exist and the docs decide which wire serves
5-each one, so every per-model fact comes from a live source. The output is
6-committed, so a normal `zig build` needs no network. Run
7-`python3 tools/gen_catalog.py` to refresh it.
8-"""
9-
10-import json
11-import sys
12-import urllib.request
13-
14-MODELS_DEV = "https://models.dev/api.json"
15-
16-PROVIDERS = [
17- {
18- "id": "opencode",
19- "listing": "https://opencode.ai/zen/v1/models",
20- "docs": "https://opencode.ai/docs/zen.md",
21- },
22- {
23- "id": "opencode-go",
24- "listing": "https://opencode.ai/zen/go/v1/models",
25- "docs": "https://opencode.ai/docs/go.md",
26- },
27-]
28-
29-# The four wires, as the path suffix that ends their endpoint URL.
30-SUFFIX_WIRES = [
31- ("/chat/completions", "openai-completions"),
32- ("/responses", "openai-responses"),
33- ("/messages", "anthropic-messages"),
34-]
35-
36-# The AI SDK package names the docs and models.dev use for each wire.
37-NPM_WIRES = {
38- "@ai-sdk/openai-compatible": "openai-completions",
39- "@ai-sdk/openai": "openai-responses",
40- "@ai-sdk/anthropic": "anthropic-messages",
41- "@ai-sdk/google": "google-generative-ai",
42-}
43-
44-
45-def fetch(url):
46- req = urllib.request.Request(url, headers={"User-Agent": "mini-catalog/1"})
47- with urllib.request.urlopen(req) as r:
48- return r.read()
49-
50-
51-def fetch_json(url):
52- return json.loads(fetch(url))
53-
54-
55-def parse_docs(text):
56- """Model id -> endpoint URL, from every pipe table row in the docs."""
57- out = {}
58- for line in text.splitlines():
59- line = line.strip()
60- if not line.startswith("|"):
61- continue
62- cells = [c.strip() for c in line.strip("|").split("|")]
63- if len(cells) < 3:
64- continue
65- endpoint = cells[2]
66- if not (endpoint.startswith("`") and endpoint.endswith("`")):
67- continue
68- endpoint = endpoint[1:-1]
69- if endpoint.startswith("http"):
70- out[cells[1]] = endpoint
71- return out
72-
73-
74-def wire_of(url, model_id):
75- """The wire and the base URL an endpoint URL names, or (None, None)."""
76- for suffix, wire in SUFFIX_WIRES:
77- if url.endswith(suffix):
78- return wire, url[: -len(suffix)]
79- google = "/models/" + model_id
80- if url.endswith(google):
81- return "google-generative-ai", url[: -len(google)]
82- return None, None
83-
84-
85-def zstr(s):
86- return '"%s"' % s.replace("\\", "\\\\").replace('"', '\\"')
87-
88-
89-def effort_of(model):
90- for opt in model.get("reasoning_options") or []:
91- if opt.get("type") == "effort":
92- return opt.get("values") or []
93- return []
94-
95-
96-def resolve(provider, model_id, docs, models_dev):
97- """The wire and base URL for one model, or (None, None) when neither the
98- docs nor models.dev names a wire and the provider has no usable default."""
99- url = docs.get(model_id)
100- if url is not None:
101- # The docs named an endpoint, so they own the answer: either it is one
102- # of the four wires or the model is unaddressable.
103- wire, base = wire_of(url, model_id)
104- return wire, (base or "").rstrip("/")
105- entry = (models_dev.get("models") or {}).get(model_id) or {}
106- npm = (entry.get("provider") or {}).get("npm") or (
107- provider.get("npm") if "npm" in provider else None
108- )
109- wire = NPM_WIRES.get(npm)
110- base = (provider.get("api") or "").rstrip("/")
111- if wire and base.startswith("https://") and "/models/" not in base:
112- return wire, base
113- return None, None
114-
115-
116-def entry_line(provider_id, model_id, api, base_url, model):
117- limit = model.get("limit") or {}
118- cost = model.get("cost") or {}
119- effort = effort_of(model)
120- if len(effort) == 1:
121- eff = "&.{%s}" % zstr(effort[0])
122- elif effort:
123- eff = "&.{ %s }" % ", ".join(zstr(v) for v in effort)
124- else:
125- eff = "&.{}"
126- return (
127- " .{ .provider = %s, .id = %s, .name = %s, .api = %s, "
128- ".base_url = %s, .images = %s, .reasoning = %s, .context = %d, "
129- ".max_output = %d, .effort = %s, .cost_input = %s, .cost_output = %s, "
130- ".cost_cache_read = %s },"
131- % (
132- zstr(provider_id),
133- zstr(model_id),
134- zstr(model.get("name") or model_id),
135- zstr(api),
136- zstr(base_url),
137- "true" if model.get("attachment") else "false",
138- "true" if model.get("reasoning") else "false",
139- int(limit.get("context") or 0),
140- int(limit.get("output") or 0),
141- eff,
142- repr(float(cost.get("input") or 0)),
143- repr(float(cost.get("output") or 0)),
144- repr(float(cost.get("cache_read") or 0)),
145- )
146- )
147-
148-
149-def main():
150- out = sys.argv[1] if len(sys.argv) > 1 else "src/catalog.zig"
151- models_dev = fetch_json(MODELS_DEV)
152-
153- lines = [
154- "// Generated by tools/gen_catalog.py. Do not edit.",
155- "// Refresh with `python3 tools/gen_catalog.py`.",
156- "",
157- "const std = @import(\"std\");",
158- "",
159- "pub const ModelInfo = struct {",
160- " provider: []const u8,",
161- " id: []const u8,",
162- " name: []const u8,",
163- " api: []const u8,",
164- " base_url: []const u8,",
165- " images: bool,",
166- " reasoning: bool,",
167- " context: u64,",
168- " max_output: u64,",
169- " effort: []const []const u8,",
170- " cost_input: f64,",
171- " cost_output: f64,",
172- " cost_cache_read: f64,",
173- "};",
174- "",
175- "pub const entries = [_]ModelInfo{",
176- ]
177-
178- count = 0
179- for spec in PROVIDERS:
180- provider_id = spec["id"]
181- provider = models_dev.get(provider_id)
182- if provider is None:
183- sys.exit("catalog: provider %r missing from models.dev" % provider_id)
184- docs = parse_docs(fetch(spec["docs"]).decode("utf-8"))
185- listing = sorted(m["id"] for m in fetch_json(spec["listing"])["data"])
186- catalog = provider["models"]
187-
188- skipped = []
189- for model_id in listing:
190- api, base_url = resolve(provider, model_id, docs, catalog)
191- if api is None:
192- where = docs.get(model_id)
193- skipped.append((model_id, where or "no endpoint"))
194- continue
195- lines.append(
196- entry_line(provider_id, model_id, api, base_url, catalog.get(model_id) or {})
197- )
198- count += 1
199-
200- print("%s: %d models" % (provider_id, len(listing) - len(skipped)))
201- for model_id, endpoint in skipped:
202- print(" skipped %s (%s)" % (model_id, endpoint), file=sys.stderr)
203-
204- lines += [
205- "};",
206- "",
207- "pub fn lookup(provider: []const u8, id: []const u8) ?*const ModelInfo {",
208- " for (&entries) |*e| {",
209- " if (std.mem.eql(u8, e.provider, provider) and std.mem.eql(u8, e.id, id)) return e;",
210- " }",
211- " return null;",
212- "}",
213- "",
214- ]
215-
216- with open(out, "w") as f:
217- f.write("\n".join(lines))
218- print("wrote %s (%d models)" % (out, count))
219-
220-
221-if __name__ == "__main__":
222- main()