Model Variants

April 28, 2026 · View on GitHub

OpenCode's variant system lets you configure the thinking budget dynamically without defining separate models for each thinking level.


How Variants Work

When you define a model with variants, OpenCode shows variant options in the model picker. Selecting a variant passes the providerOptions to the plugin, which extracts the thinking configuration.

opencode run "Hello" --model=google/antigravity-claude-opus-4-6-thinking --variant=max

Variant Configuration

Define variants in your model configuration:

{
  "antigravity-claude-opus-4-6-thinking": {
    "name": "Claude Opus 4.6 Thinking",
    "limit": { "context": 200000, "output": 64000 },
    "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
    "variants": {
      "low": { "thinkingConfig": { "thinkingBudget": 8192 } },
      "max": { "thinkingConfig": { "thinkingBudget": 32768 } }
    }
  }
}

Supported Variant Formats

The plugin accepts different variant formats depending on the model family:

Model FamilyVariant FormatExample
ClaudethinkingConfig.thinkingBudget{ "thinkingConfig": { "thinkingBudget": 8192 } }
Gemini 3thinkingLevel{ "thinkingLevel": "high" }
Gemini 2.5thinkingConfig.thinkingBudget{ "thinkingConfig": { "thinkingBudget": 8192 } }

Gemini 3 Thinking Levels

Gemini 3 models use string-based thinking levels. Available levels differ by model:

LevelFlashProDescription
minimalMinimal thinking, lowest latency
lowLight thinking
mediumBalanced thinking
highMaximum thinking (default)

Note: The API rejects invalid levels (e.g., "minimal" on Pro). Configure variants accordingly.

Gemini 3 Pro Example

{
  "antigravity-gemini-3-pro": {
    "name": "Gemini 3 Pro (Antigravity)",
    "limit": { "context": 1048576, "output": 65535 },
    "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
    "variants": {
      "low": { "thinkingLevel": "low" },
      "high": { "thinkingLevel": "high" }
    }
  }
}

Gemini 3 Flash Example

{
  "antigravity-gemini-3-flash": {
    "name": "Gemini 3 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" }
    }
  }
}

Claude Thinking Budget

Claude models use token-based thinking budgets (in tokens):

VariantBudgetDescription
low8192Light thinking
max32768Maximum thinking

Claude Example

{
  "antigravity-claude-opus-4-6-thinking": {
    "name": "Claude Opus 4.6 Thinking (Antigravity)",
    "limit": { "context": 200000, "output": 64000 },
    "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
    "variants": {
      "low": { "thinkingConfig": { "thinkingBudget": 8192 } },
      "max": { "thinkingConfig": { "thinkingBudget": 32768 } }
    }
  }
}

You can define custom budgets:

{
  "variants": {
    "minimal": { "thinkingConfig": { "thinkingBudget": 4096 } },
    "low": { "thinkingConfig": { "thinkingBudget": 8192 } },
    "medium": { "thinkingConfig": { "thinkingBudget": 16384 } },
    "high": { "thinkingConfig": { "thinkingBudget": 24576 } },
    "max": { "thinkingConfig": { "thinkingBudget": 32768 } }
  }
}

Legacy Budget Format (Deprecated)

For Gemini 3 models, the old thinkingBudget format is still supported but deprecated:

Budget RangeMaps to Level
≤ 8192low
≤ 16384medium
> 16384high

Recommended: Use thinkingLevel directly for Gemini 3 models.


Tier-Suffixed Names

Tier-suffixed model names are still accepted:

  • antigravity-claude-opus-4-6-thinking-low
  • antigravity-claude-opus-4-6-thinking-medium
  • antigravity-claude-opus-4-6-thinking-high
  • antigravity-gemini-3-pro-low
  • antigravity-gemini-3-pro-high
  • gemini-3-pro-low
  • gemini-3-flash-medium

However, we recommend using simplified model names with variants for:

  • Cleaner model picker — 7 models instead of 12+
  • Simpler config — No need to configure both antigravity- and -preview versions
  • Automatic quota routing — Plugin handles model name transformation
  • Flexible budgets — Define any budget, not just preset tiers
  • Future-proof — Works with OpenCode's native variant system

Benefits of Variants

Before (tier-suffixed)After (variants)
12+ separate models4 models with variants
Fixed thinking budgetsCustomizable budgets
Cluttered model pickerClean model picker
Hard to add new tiersEasy to add new variants