Skip to content

feat(notebook): add reasoning capabilities cookbook#248

Open
abdelhadi703 wants to merge 2 commits intomistralai:mainfrom
abdelhadi703:feat/reasoning-cookbook
Open

feat(notebook): add reasoning capabilities cookbook#248
abdelhadi703 wants to merge 2 commits intomistralai:mainfrom
abdelhadi703:feat/reasoning-cookbook

Conversation

@abdelhadi703
Copy link
Copy Markdown

Summary

Add a new cookbook notebook demonstrating Mistral's reasoning capabilities using the Magistral models (magistral-small-latest, magistral-medium-latest).

The cookbook currently has no notebook dedicated to reasoning or chain-of-thought prompting. This notebook fills that gap by providing practical, runnable examples.

What's included

  • Thinking traces parsing: How to separate thinking blocks from text blocks in Magistral responses
  • Chain-of-thought prompting: Explicit CoT instructions for complex multi-step problems
  • Mathematical reasoning: Train meeting problems, algebraic equations
  • Logical deduction: Classic truth-teller/liar puzzles
  • Code analysis: Bug detection and correction with step-by-step reasoning
  • Reasoning vs. standard comparison: Side-by-side comparison of magistral-medium-latest vs mistral-large-latest on the same problem
  • prompt_mode parameter: How to control reasoning behavior with custom system prompts
  • Real-world scenario: Project planning with critical path analysis

Technical details

  • Uses mistralai==1.12.4 (pinned version)
  • No hardcoded API keys (os.environ.get("MISTRAL_API_KEY"))
  • Runnable on Google Colab (badge included)
  • Clean outputs (no cell outputs committed)
  • Follows existing cookbook format (modeled after prompting_capabilities.ipynb)

Files changed

  • mistral/reasoning/reasoning_capabilities.ipynb (new)
  • README.md (added entry to Main Notebooks table)

@abdelhadi703
Copy link
Copy Markdown
Author

Hi @mistralai/team,

Bumping this PR for review. It adds a practical notebook demonstrating reasoning capabilities with Mistral models.

Let me know if you'd like any changes. Thanks!

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.

1 participant