Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 30 additions & 20 deletions crates/opencode/src/opencode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,18 +133,20 @@ pub enum Model {
Glm5,
#[serde(rename = "glm-5.1")]
Glm5_1,
#[serde(rename = "glm-5.2")]
Glm5_2,
#[serde(rename = "grok-build-0.1")]
GrokBuild0_1,
#[serde(rename = "kimi-k2.5")]
KimiK2_5,
#[serde(rename = "kimi-k2.6")]
KimiK2_6,
#[serde(rename = "kimi-k2.7-code")]
KimiK2_7Code,
#[serde(rename = "minimax-m2.7")]
MiniMaxM2_7,
#[serde(rename = "minimax-m3")]
MiniMaxM3,
#[serde(rename = "minimax-m3-free")]

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MiniMaxM3Free,
#[serde(rename = "mimo-v2.5-pro")]
MimoV2_5Pro,
#[serde(rename = "mimo-v2.5")]
Expand Down Expand Up @@ -182,11 +184,11 @@ impl Model {
}

pub fn default_go() -> Self {
Self::KimiK2_5
Self::KimiK2_6

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because Kimi K2.5 and MiniMax M2.5 were the Go defaults, those were repointed off the deprecated models.

}

pub fn default_go_fast() -> Self {
Self::MiniMaxM2_5
Self::MiniMaxM2_7
}

pub fn default_free() -> Self {
Expand All @@ -200,27 +202,27 @@ impl Model {
pub fn available_subscriptions(&self) -> &'static [OpenCodeSubscription] {
match self {
// Models available in both Zen and Go
Self::Glm5

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

| Self::Glm5_1
Self::Glm5_1
| Self::KimiK2_6
| Self::KimiK2_5

@yeskunall yeskunall Jun 19, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

| Self::MiniMaxM2_5

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

| Self::MiniMaxM2_7
| Self::DeepSeekV4Pro

@yeskunall yeskunall Jun 19, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in OpenCode Zen as well: anomalyco/models.dev@57caaf8.

| Self::DeepSeekV4Flash
| Self::Qwen3_6Plus => &[OpenCodeSubscription::Zen, OpenCodeSubscription::Go],

// Go-only models
Self::MimoV2_5Pro
| Self::MimoV2_5
| Self::DeepSeekV4Pro
| Self::Qwen3_7Plus
| Self::Qwen3_7Max
| Self::KimiK2_7Code
| Self::Glm5_2
| Self::MiniMaxM3 => &[OpenCodeSubscription::Go],

// Deprecated on Go (per models.dev); still offered on Zen
Self::Glm5 | Self::KimiK2_5 | Self::MiniMaxM2_5 => &[OpenCodeSubscription::Zen],

// Free models
Self::Nemotron3UltraFree | Self::BigPickle | Self::MiniMaxM3Free => {
&[OpenCodeSubscription::Free]
}
Self::Nemotron3UltraFree | Self::BigPickle => &[OpenCodeSubscription::Free],

// Custom models get their subscription from settings, not from here
Self::Custom { .. } => &[],
Expand Down Expand Up @@ -269,9 +271,11 @@ impl Model {
Self::MiniMaxM2_5 => "minimax-m2.5",
Self::Glm5 => "glm-5",
Self::Glm5_1 => "glm-5.1",
Self::Glm5_2 => "glm-5.2",
Self::GrokBuild0_1 => "grok-build-0.1",
Self::KimiK2_5 => "kimi-k2.5",
Self::KimiK2_6 => "kimi-k2.6",
Self::KimiK2_7Code => "kimi-k2.7-code",
Self::MiniMaxM2_7 => "minimax-m2.7",
Self::MiniMaxM3 => "minimax-m3",
Self::MimoV2_5Pro => "mimo-v2.5-pro",
Expand All @@ -282,7 +286,6 @@ impl Model {
Self::Qwen3_7Max => "qwen3.7-max",
Self::BigPickle => "big-pickle",
Self::Nemotron3UltraFree => "nemotron-3-ultra-free",
Self::MiniMaxM3Free => "minimax-m3-free",

Self::Custom { name, .. } => name,
}
Expand Down Expand Up @@ -327,9 +330,11 @@ impl Model {
Self::MiniMaxM2_5 => "MiniMax M2.5",
Self::Glm5 => "GLM 5",
Self::Glm5_1 => "GLM 5.1",
Self::Glm5_2 => "GLM 5.2",
Self::GrokBuild0_1 => "Grok Build 0.1",
Self::KimiK2_5 => "Kimi K2.5",
Self::KimiK2_6 => "Kimi K2.6",
Self::KimiK2_7Code => "Kimi K2.7 Code",
Self::MiniMaxM2_7 => "MiniMax M2.7",
Self::MiniMaxM3 => "MiniMax M3",
Self::MimoV2_5Pro => "MiMo V2.5 Pro",
Expand All @@ -340,7 +345,6 @@ impl Model {
Self::Qwen3_7Max => "Qwen3.7 Max",
Self::BigPickle => "Big Pickle",
Self::Nemotron3UltraFree => "Nemotron 3 Ultra Free",
Self::MiniMaxM3Free => "MiniMax M3 Free",

Self::Custom {
name, display_name, ..
Expand Down Expand Up @@ -392,13 +396,15 @@ impl Model {

Self::Qwen3_7Max | Self::Qwen3_7Plus => ApiProtocol::Anthropic,

Self::MiniMaxM3 | Self::MiniMaxM3Free => ApiProtocol::Anthropic,
Self::MiniMaxM3 => ApiProtocol::Anthropic,

Self::Glm5
| Self::Glm5_1
| Self::Glm5_2
| Self::GrokBuild0_1
| Self::KimiK2_5
| Self::KimiK2_6
| Self::KimiK2_7Code
| Self::MimoV2_5Pro
| Self::MimoV2_5
| Self::Qwen3_5Plus
Expand All @@ -418,10 +424,12 @@ impl Model {
| Self::DeepSeekV4Flash
| Self::KimiK2_5
| Self::KimiK2_6
| Self::KimiK2_7Code
| Self::MimoV2_5
| Self::MimoV2_5Pro
| Self::Glm5
| Self::Glm5_1
| Self::Glm5_2
| Self::MiniMaxM2_5
| Self::MiniMaxM2_7
| Self::Nemotron3UltraFree
Expand Down Expand Up @@ -466,7 +474,6 @@ impl Model {
// OpenAI-compatible models
Self::MiniMaxM2_7 => 204_800,
Self::MiniMaxM3 => 512_000,
Self::MiniMaxM3Free => 200_000,
Self::MiniMaxM2_5 => 204_800,
Self::Glm5 | Self::Glm5_1 => {
if subscription == OpenCodeSubscription::Go {
Expand All @@ -475,7 +482,8 @@ impl Model {
204_800
}
}
Self::KimiK2_6 | Self::KimiK2_5 => 262_144,
Self::Glm5_2 => 1_000_000,
Self::KimiK2_6 | Self::KimiK2_5 | Self::KimiK2_7Code => 262_144,
Self::GrokBuild0_1 => 256_000,
Self::MimoV2_5Pro => 1_048_576,
Self::MimoV2_5 => 1_000_000,
Expand Down Expand Up @@ -532,7 +540,6 @@ impl Model {
// OpenAI-compatible models
Self::MiniMaxM2_7 => Some(131_072),
Self::MiniMaxM3 => Some(131_072),
Self::MiniMaxM3Free => Some(32_000),
Self::MiniMaxM2_5 => {
if subscription == OpenCodeSubscription::Go {
Some(65_536)
Expand All @@ -547,8 +554,10 @@ impl Model {
Some(131_072)
}
}
Self::Glm5_2 => Some(131_072),
Self::BigPickle => Some(32_000),
Self::KimiK2_6 | Self::KimiK2_5 => Some(65_536),
Self::KimiK2_7Code => Some(262_144),
Self::GrokBuild0_1 => Some(256_000),
Self::Qwen3_7Max | Self::Qwen3_7Plus | Self::Qwen3_6Plus | Self::Qwen3_5Plus => {
Some(65_536)
Expand Down Expand Up @@ -606,19 +615,20 @@ impl Model {

// OpenAI-compatible models with image support
Self::KimiK2_6
| Self::KimiK2_7Code
| Self::KimiK2_5
| Self::GrokBuild0_1
| Self::MimoV2_5
| Self::Qwen3_5Plus
| Self::Qwen3_6Plus
| Self::Qwen3_7Plus
| Self::MiniMaxM3
| Self::MiniMaxM3Free => true,
| Self::MiniMaxM3 => true,

// OpenAI-compatible models without image support
Self::MiniMaxM2_5
| Self::Glm5
| Self::Glm5_1
| Self::Glm5_2
| Self::MiniMaxM2_7
| Self::MimoV2_5Pro
| Self::DeepSeekV4Pro
Expand Down
Loading