From cc428330a9ea799cc026e14fb75da17139072e2d Mon Sep 17 00:00:00 2001 From: Umesh Yadav <23421535+imumesh18@users.noreply.github.com> Date: Thu, 22 May 2025 23:52:35 +0530 Subject: [PATCH] mistral: Add DevstralSmallLatest model to Mistral and Ollama (#31099) Mistral just released a sota coding model: https://mistral.ai/news/devstral This PR adds support for it in both ollama and mistral Release Notes: - Add DevstralSmallLatest model to Mistral and Ollama --- crates/mistral/src/mistral.rs | 8 +++++++- crates/ollama/src/ollama.rs | 5 ++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/crates/mistral/src/mistral.rs b/crates/mistral/src/mistral.rs index d5eaa76467..e2103dcae8 100644 --- a/crates/mistral/src/mistral.rs +++ b/crates/mistral/src/mistral.rs @@ -58,6 +58,8 @@ pub enum Model { OpenMistralNemo, #[serde(rename = "open-codestral-mamba", alias = "open-codestral-mamba")] OpenCodestralMamba, + #[serde(rename = "devstral-small-latest", alias = "devstral-small-latest")] + DevstralSmallLatest, #[serde(rename = "custom")] Custom { @@ -96,6 +98,7 @@ impl Model { Self::MistralSmallLatest => "mistral-small-latest", Self::OpenMistralNemo => "open-mistral-nemo", Self::OpenCodestralMamba => "open-codestral-mamba", + Self::DevstralSmallLatest => "devstral-small-latest", Self::Custom { name, .. } => name, } } @@ -108,6 +111,7 @@ impl Model { Self::MistralSmallLatest => "mistral-small-latest", Self::OpenMistralNemo => "open-mistral-nemo", Self::OpenCodestralMamba => "open-codestral-mamba", + Self::DevstralSmallLatest => "devstral-small-latest", Self::Custom { name, display_name, .. } => display_name.as_ref().unwrap_or(name), @@ -122,6 +126,7 @@ impl Model { Self::MistralSmallLatest => 32000, Self::OpenMistralNemo => 131000, Self::OpenCodestralMamba => 256000, + Self::DevstralSmallLatest => 262144, Self::Custom { max_tokens, .. } => *max_tokens, } } @@ -142,7 +147,8 @@ impl Model { | Self::MistralMediumLatest | Self::MistralSmallLatest | Self::OpenMistralNemo - | Self::OpenCodestralMamba => true, + | Self::OpenCodestralMamba + | Self::DevstralSmallLatest => true, Self::Custom { supports_tools, .. } => supports_tools.unwrap_or(false), } } diff --git a/crates/ollama/src/ollama.rs b/crates/ollama/src/ollama.rs index 57cc0d1f65..a18c134c4c 100644 --- a/crates/ollama/src/ollama.rs +++ b/crates/ollama/src/ollama.rs @@ -54,9 +54,8 @@ fn get_max_tokens(name: &str) -> usize { "mistral" | "codestral" | "mixstral" | "llava" | "qwen2" | "qwen2.5-coder" | "dolphin-mixtral" => 32768, "llama3.1" | "llama3.2" | "llama3.3" | "phi3" | "phi3.5" | "phi4" | "command-r" - | "qwen3" | "gemma3" | "deepseek-coder-v2" | "deepseek-v3" | "deepseek-r1" | "yi-coder" => { - 128000 - } + | "qwen3" | "gemma3" | "deepseek-coder-v2" | "deepseek-v3" | "deepseek-r1" | "yi-coder" + | "devstral" => 128000, _ => DEFAULT_TOKENS, } .clamp(1, MAXIMUM_TOKENS)