Skip to main content

vtcode_config/constants/models/
google.rs

1/// Default model - using stable version for production reliability
2pub const DEFAULT_MODEL: &str = "gemini-3.7-flash";
3
4pub const SUPPORTED_MODELS: &[&str] = &[
5    "gemini-4-hydrogen", // Gemini 4 Hydrogen - fast and efficient for everyday coding and agentic workflows (unified 1M window, 64k sync output, low/medium/high/xhigh)
6    "gemini-4-carbon", // Gemini 4 Carbon - strongest reasoning model for sustained agentic coding, multimodal knowledge work, scientific reasoning, cybersecurity defense (unified 1M window, 64k sync output, low/medium/high)
7    "gemini-4-argon", // Gemini 4 Argon - flagship for hardest problems (unified 1M window, 64k sync output, low/medium/high)
8    "gemini-3.6-flash", // Gemini 3.6 Flash - flash model with improved capabilities
9    "gemini-3.7-flash", // Gemini 3.7 Flash - flash model with 1M context and tunable thinking
10    "gemini-3.8-flash", // Gemini 3.8 Flash - most intelligent Flash for long-horizon SWE/agents (1M, 64k output, low/medium/high)
11    "gemini-3-flash-preview", // Fast version of Gemini 3 Pro with 3-level thinking
12    "gemini-3-pro-image-preview", // Image generation model with 4K resolution
13];
14
15/// Models that support thinking/reasoning capability with configurable thinking_level
16/// Based on: <https://ai.google.dev/gemini-api/docs/gemini-3>
17/// Gemini 3 Pro: supports low, high
18/// Gemini 3 Flash Preview: supports minimal, low, medium, high
19/// Gemini 3.7/3.8 Flash: supports low, medium (default), high — `minimal` not supported on 3.8 and will error
20pub const REASONING_MODELS: &[&str] = &[
21    "gemini-4-hydrogen",
22    "gemini-4-carbon",
23    "gemini-4-argon",
24    "gemini-3.6-flash",
25    "gemini-3.7-flash",
26    "gemini-3.8-flash",
27    "gemini-3-flash-preview",
28];
29
30/// Models that support Gemini 3 extended thinking levels (minimal, medium)
31/// Only `gemini-3-flash-preview` supports `minimal`; stable 3.7/3.8 Flash support low/medium/high with medium as default
32pub const EXTENDED_THINKING_MODELS: &[&str] = &["gemini-3-flash-preview"];
33
34/// Models that support the `xhigh` thinking level (Gemini 4 Hydrogen and later).
35/// Hydrogen defaults to `high` and adds `xhigh` for hard multi-step problems.
36pub const XHIGH_THINKING_MODELS: &[&str] = &["gemini-4-hydrogen"];
37
38/// Models supporting image generation
39pub const IMAGE_GENERATION_MODELS: &[&str] = &["gemini-3-pro-image-preview"];
40
41/// Models that support context caching
42/// Context caching reduces costs for repeated API calls with similar contexts
43/// Reference: <https://ai.google.dev/gemini-api/docs/caching>
44/// Gemini 4 Hydrogen, Argon, and Carbon support implicit caching only —
45/// explicit `cachedContents` is not supported and requests referencing it fail;
46/// prefer Implicit mode.
47pub const CACHING_MODELS: &[&str] = &[
48    "gemini-4-hydrogen",
49    "gemini-4-carbon",
50    "gemini-4-argon",
51    "gemini-3.6-flash",
52    "gemini-3.7-flash",
53    "gemini-3.8-flash",
54    "gemini-3-flash-preview",
55];
56
57/// Models that reject explicit `cachedContents` entirely and support implicit
58/// caching only. The provider must skip its explicit-cache lifecycle for these
59/// models even when `[prompt_cache] mode = "explicit"` is configured —
60/// creation requests fail and references in generateContent bodies error.
61/// Reference: <https://ai.google.dev/gemini-api/docs/models/gemini-4-argon>,
62/// <https://ai.google.dev/gemini-api/docs/models/gemini-4-carbon>,
63/// <https://ai.google.dev/gemini-api/docs/models/gemini-4-hydrogen>
64pub const IMPLICIT_CACHING_ONLY_MODELS: &[&str] = &["gemini-4-hydrogen", "gemini-4-carbon", "gemini-4-argon"];
65
66/// Models that support code execution (Python)
67/// Code execution allows models to write and execute Python code
68/// Reference: <https://ai.google.dev/gemini-api/docs/code-execution>
69pub const CODE_EXECUTION_MODELS: &[&str] = &[
70    "gemini-4-hydrogen",
71    "gemini-4-carbon",
72    "gemini-4-argon",
73    "gemini-3.6-flash",
74    "gemini-3.7-flash",
75    "gemini-3.8-flash",
76    "gemini-3-flash-preview",
77];
78
79// Convenience constants for commonly used models
80pub const GEMINI_4_HYDROGEN: &str = "gemini-4-hydrogen";
81pub const GEMINI_4_CARBON: &str = "gemini-4-carbon";
82pub const GEMINI_4_ARGON: &str = "gemini-4-argon";
83pub const GEMINI_3_6_FLASH: &str = "gemini-3.6-flash";
84pub const GEMINI_3_7_FLASH: &str = "gemini-3.7-flash";
85pub const GEMINI_3_8_FLASH: &str = "gemini-3.8-flash";
86pub const GEMINI_3_FLASH_PREVIEW: &str = "gemini-3-flash-preview";
87pub const GEMINI_3_PRO_IMAGE_PREVIEW: &str = "gemini-3-pro-image-preview";