Update Mistral AI chat models - #6721
Conversation
| @Deprecated(forRemoval = true) // Retirement planned the 31st of July 2026 | ||
| DEVSTRAL("devstral-latest"), | ||
| @Deprecated(forRemoval = true) // Retirement planned the 31st of July 2026 | ||
| MAGISTRAL_SMALL("magistral-small-latest"), | ||
| // Free Models - Research | ||
| @Deprecated(forRemoval = true) // Retirement planned the 31st of July 2026 | ||
| OPEN_MISTRAL_NEMO("open-mistral-nemo"); |
There was a problem hiding this comment.
Removing these enums is breaking binary compatibility. Please, include a sub-section in upgrade-notes.adoc under the section [[upgrading-to-2-0-1]], describing the breakage of backward compatibility and what a user needs to do in order to successfully upgrade to 2.0.1
There was a problem hiding this comment.
Thank you for this comment. I forgot to add an upgrade note in a previous similar PR, although it is very useful for users. Please let me know what you think about the upgrade note I have just added.
I noticed that you assigned the 2.1.x milestone to this PR instead of 2.0.1. Could you tell me which version we are targeting? I will adapt the upgrade note version accordingly if necessary.
There was a problem hiding this comment.
I'm sorry about the confusion. It is not a practice in Spring to break binary compatibility in a patch release (like 2.0.1), thus we have to target 2.1.0
There was a problem hiding this comment.
Thanks for the explanations. I have just created a new Upgrading to 2.1.0 section, please let me know what do you think about it.
3b264ee to
7810379
Compare
| Using these models will now cause: | ||
|
|
||
| - **Compilation failure**: If referenced directly from `MistralAiApi.ChatModel`. | ||
| - **Unexpected behavior**: If used via the `spring.ai.mistralai.chat.model` property, as Mistral AI redirects requests to these deprecated models to alternative models (e.g., `mistral-medium-3.5` instead of `magistral-medium-latest`). |
There was a problem hiding this comment.
I verified this redirection while debugging org.springframework.ai.mistralai.MistralAiChatModelIT.thinkingCall with ChatModel.MAGISTRAL_MEDIUM on main branch and checking org.springframework.ai.mistralai.api.MistralAiApi.ChatCompletion.model corresponding value in the response.
7810379 to
7c130b7
Compare
- Remove devstral-latest retired the 31st of July 2026 - Remove magistral-medium-latest retired the 31st of July 2026 - Remove magistral-small-latest retired the 31st of July 2026 - Remove open-mistral-nemo retired the 31st of July 2026 - Update Mistral AI Chat documentation - Add an upgrade note for 2.0.1 version regarding these deprecations - Polish integration tests Signed-off-by: Nicolas Krier <7557886+nicolaskrier@users.noreply.github.com>
7c130b7 to
82a452f
Compare
| @Target(ElementType.METHOD) | ||
| @Retention(RetentionPolicy.RUNTIME) | ||
| @EnumSource(value = ChatModel.class, names = { "MAGISTRAL_MEDIUM", "MISTRAL_MEDIUM", "MISTRAL_SMALL" }) | ||
| @EnumSource(value = ChatModel.class, names = { "MISTRAL_MEDIUM", "MISTRAL_SMALL" }) |
There was a problem hiding this comment.
@dimitarproynov: The integration tests are currently failing for Mistral Medium on the main branch. Do you plan to create a maintenance branch for 2.0.x soon and to continue 2.1.x on main?
- If so, we should consider merging this PR to main and applying changes from this PR regarding integration tests on 2.0.x branch.
- If not, we should consider splitting this PR into parts:
- one with just the integration test fixes, to merge to main ASAP,
- one for removing Mistral AI chat model enumeration elements, to merge to main later on.
What do you think about it?
Description
Explanations
See Mistral AI Models documentation, especially Legacy Models section.