Skip to content

Conversation

@Sameerlite
Copy link
Collaborator

Title

Fix magistral streaming to emit reasoning chunks

Relevant issues

Fixes #16272

Pre-Submission checklist

  • I have Added testing in the tests/litellm/ directory, Adding at least 1 test is a hard requirement - see details

  • I have added a screenshot of my new test passing locally
    pytest output attached in PR description

  • My PR passes all unit tests on make test-unit
    pytest litellm/tests/test_litellm/llms/mistral/test_mistral_chat_transformation.py

  • My PR's scope is as isolated as possible, it only solves 1 specific problem

Type

🐛 Bug Fix

Changes

  • added mistral/magistral-medium-2509 pricing entry in model_prices_and_context_window*.json
  • normalized magistral streaming chunks to populate thinking_blocks + reasoning_content with signatures in litellm/llms/mistral/chat/transformation.py
  • extended tests/test_litellm/llms/mistral/test_mistral_chat_transformation.py to cover streaming reasoning output
image

@vercel
Copy link

vercel bot commented Nov 10, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
litellm Ready Ready Preview Comment Nov 10, 2025 6:05am

Copy link
Contributor

@ishaan-jaff ishaan-jaff left a comment

Choose a reason for hiding this comment

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

add this provider to reasoning_content.md

Copy link
Contributor

@ishaan-jaff ishaan-jaff left a comment

Choose a reason for hiding this comment

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

lgtm

@ishaan-jaff ishaan-jaff merged commit 6cab77f into main Nov 11, 2025
49 of 53 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Magistral reasoning not working with streaming

3 participants