The Mistral Cookbook features examples contributed by Mistralers and our community, as well as our partners. If you have cool examples showcasing Mistral models, you can submit a PR to this repo for review.
For the full Mistral documentation, visit docs.mistral.ai. You can also browse the cookbooks section in the docs.
| Notebook | Category | Description |
|---|---|---|
| quickstart.ipynb | chat, embeddings | Basic quickstart with chat and embeddings with Mistral AI API |
| prompting_capabilities.ipynb | prompting | Write prompts for classification, summarization, personalization, and evaluation |
| basic_RAG.ipynb | RAG | RAG from scratch with Mistral AI API |
| embeddings.ipynb | embeddings | Use Mistral embeddings API for classification and clustering |
| function_calling.ipynb | function calling | Use Mistral API for function calling |
| evaluation.ipynb | evaluation | Evaluate models with Mistral API |
| mistral-search-engine.ipynb | RAG, function calling | Search engine built with Mistral API, function calling and RAG |
| rag_via_function_calling.ipynb | RAG, function calling | Use function calling as a router for a RAG based on multiple data sources |
| prefix_use_cases.ipynb | prefix, prompting | Cool examples with Mistral's prefix feature |
| data_generation_refining_news.ipynb | data generation | Simple data generation to refine news articles |
| image_description_prompting_pixtral.ipynb | image processing, prompting | Extract structured image descriptions using Mistral's Pixtral model and JSON response formatting |
| multimodality meets function calling.ipynb | image processing, function calling | Extract table from image using Mistral's Pixtral model and use for function calling |
| mistral-reference-rag.ipynb | RAG, function calling, references | Reference RAG with Mistral API |
| moderation-explored.ipynb | moderation | Quick exploration on safeguarding and Mistral's moderation API |
| system-level-guardrails.ipynb | moderation | How to implement System Level Guardrails with Mistral API |
| shieldstral_policy_moderation.ipynb | moderation | Policy-based content moderation with Shieldstral, Mistral's open-weights safety classifier |
| document_understanding.ipynb | OCR, function calling | Document Understanding and Tool Usage with OCR |
| batch_ocr.ipynb | OCR, batch | Using OCR to extract text data from datasets. |
| structured_ocr.ipynb | OCR, structured outputs | Extracting structured outputs from documents. |
| RAG_evaluation.ipynb | evaluation, structured outputs, LLM As a Judge | Evaluate RAG with LLM as a Judge and structured outputs |
| sts_demo.py | chat, tts | STT -> LLM -> TTS Demo. |
| llm_judge_campaign_workflow.ipynb | observability, evaluation | Run campaigns with LLM judges to classify agent behaviors at scale |
| manage_datasets.ipynb | observability, datasets | Create and manage datasets for evaluation or fine-tuning |
| 01-build-a-database-advisor-agent.ipynb | connectors, agents | Build an agent that compares databases using their source code via the DeepWiki connector |
| 02-build-a-quickstart-generator.ipynb | connectors, agents, web search | Build a quickstart generator that improves with each tool added — web search, connectors, and both combined |
| 01-glm-game-generator.md | agents, code generation | Generate a playable HTML5 game from a text description using GLM, with automated review and fix loop |
| 01-glm-code-modernizer.md | agents, code generation | Modernize legacy Python codebases using GLM for automated refactoring |
| 01-realtime-fact-checker.md | agents, audio, RAG, embeddings | Build a real-time audio fact-checking agent |
Disclaimer: Examples contributed by the community and partners do not represent Mistral's views and opinions.
This repository includes a lightweight Quarto preview site for reviewing Markdown and notebook cookbooks locally.
Install Quarto, generate the local preview files, then run the preview:
python3 scripts/generate_quarto_index.py
quarto preview --profile preview
Run the generator again after editing the cookbook tables in this README or Markdown cookbook files.
The preview renders committed notebook content without executing notebook code. Generated preview output is written to site/, and generated Markdown preview files are written as ignored sibling .qmd files next to their source Markdown files.
| Notebook | Category | Description |
|---|---|---|
| quickstart.ipynb | chat, embeddings | Basic quickstart with chat and embeddings with Mistral AI API |
| prompting_capabilities.ipynb | prompting | Write prompts for classification, summarization, personalization, and evaluation |
| basic_RAG.ipynb | RAG | RAG from scratch with Mistral AI API |
| embeddings.ipynb | embeddings | Use Mistral embeddings API for classification and clustering |
| function_calling.ipynb | function calling | Use Mistral API for function calling |
| evaluation.ipynb | evaluation | Evaluate models with Mistral API |
| mistral-search-engine.ipynb | RAG, function calling | Search engine built with Mistral API, function calling and RAG |
| rag_via_function_calling.ipynb | RAG, function calling | Use function calling as a router for a RAG based on multiple data sources |
| prefix_use_cases.ipynb | prefix, prompting | Cool examples with Mistral's prefix feature |
| synthetic_data_gen_and_finetune.ipynb | data generation, fine-tuning | Simple data generation and fine-tuning guide |
| data_generation_refining_news.ipynb | data generation | Simple data generation to refine news articles |
| image_description_prompting_pixtral.ipynb | image processing, prompting | Extract structured image descriptions using Mistral's Pixtral model and JSON response formatting |
| multimodality meets function calling.ipynb | image processing, function calling | Extract table from image using Mistral's Pixtral model and use for function calling |
| mistral-reference-rag.ipynb | RAG, function calling, references | Reference RAG with Mistral API |
| moderation-explored.ipynb | moderation | Quick exploration on safeguarding and Mistral's moderation API |
| system-level-guardrails.ipynb | moderation | How to implement System Level Guardrails with Mistral API |
| shieldstral_policy_moderation.ipynb | moderation | Policy-based content moderation with Shieldstral, Mistral's open-weights safety classifier |
| document_understanding.ipynb | OCR, function calling | Document Understanding and Tool Usage with OCR |
| batch_ocr.ipynb | OCR, batch | Using OCR to extract text data from datasets. |
| structured_ocr.ipynb | OCR, structured outputs | Extracting structured outputs from documents. |
| RAG_evaluation.ipynb | evaluation, structured outputs, LLM As a Judge | Evaluate RAG with LLM as a Judge and structured outputs |
| llm_judge_campaign_workflow.ipynb | observability, evaluation | Run campaigns with LLM judges to classify agent behaviors at scale |
| manage_datasets.ipynb | observability, datasets | Create and manage datasets for evaluation or fine-tuning |
| Custom MCP Server | MCP, connectors | Build a custom MCP server (tic-tac-toe) and connect it to Vibe |
| Object Detection | Vision | Object detection with mistral models. |
2,124 followers · starred Apr 2024
450 followers · starred May 2024
53 followers · starred Apr 2024
553 followers · starred Jul 2024
The Mistral Cookbook features examples contributed by Mistralers and our community, as well as our partners. If you have cool examples showcasing Mistral models, you can submit a PR to this repo for review.
For the full Mistral documentation, visit docs.mistral.ai. You can also browse the cookbooks section in the docs.
| Notebook | Category | Description |
|---|---|---|
| quickstart.ipynb | chat, embeddings | Basic quickstart with chat and embeddings with Mistral AI API |
| prompting_capabilities.ipynb | prompting | Write prompts for classification, summarization, personalization, and evaluation |
| basic_RAG.ipynb | RAG | RAG from scratch with Mistral AI API |
| embeddings.ipynb | embeddings | Use Mistral embeddings API for classification and clustering |
| function_calling.ipynb | function calling | Use Mistral API for function calling |
| evaluation.ipynb | evaluation | Evaluate models with Mistral API |
| mistral-search-engine.ipynb | RAG, function calling | Search engine built with Mistral API, function calling and RAG |
| rag_via_function_calling.ipynb | RAG, function calling | Use function calling as a router for a RAG based on multiple data sources |
| prefix_use_cases.ipynb | prefix, prompting | Cool examples with Mistral's prefix feature |
| data_generation_refining_news.ipynb | data generation | Simple data generation to refine news articles |
| image_description_prompting_pixtral.ipynb | image processing, prompting | Extract structured image descriptions using Mistral's Pixtral model and JSON response formatting |
| multimodality meets function calling.ipynb | image processing, function calling | Extract table from image using Mistral's Pixtral model and use for function calling |
| mistral-reference-rag.ipynb | RAG, function calling, references | Reference RAG with Mistral API |
| moderation-explored.ipynb | moderation | Quick exploration on safeguarding and Mistral's moderation API |
| system-level-guardrails.ipynb | moderation | How to implement System Level Guardrails with Mistral API |
| shieldstral_policy_moderation.ipynb | moderation | Policy-based content moderation with Shieldstral, Mistral's open-weights safety classifier |
| document_understanding.ipynb | OCR, function calling | Document Understanding and Tool Usage with OCR |
| batch_ocr.ipynb | OCR, batch | Using OCR to extract text data from datasets. |
| structured_ocr.ipynb | OCR, structured outputs | Extracting structured outputs from documents. |
| RAG_evaluation.ipynb | evaluation, structured outputs, LLM As a Judge | Evaluate RAG with LLM as a Judge and structured outputs |
| sts_demo.py | chat, tts | STT -> LLM -> TTS Demo. |
| llm_judge_campaign_workflow.ipynb | observability, evaluation | Run campaigns with LLM judges to classify agent behaviors at scale |
| manage_datasets.ipynb | observability, datasets | Create and manage datasets for evaluation or fine-tuning |
| 01-build-a-database-advisor-agent.ipynb | connectors, agents | Build an agent that compares databases using their source code via the DeepWiki connector |
| 02-build-a-quickstart-generator.ipynb | connectors, agents, web search | Build a quickstart generator that improves with each tool added — web search, connectors, and both combined |
| 01-glm-game-generator.md | agents, code generation | Generate a playable HTML5 game from a text description using GLM, with automated review and fix loop |
| 01-glm-code-modernizer.md | agents, code generation | Modernize legacy Python codebases using GLM for automated refactoring |
| 01-realtime-fact-checker.md | agents, audio, RAG, embeddings | Build a real-time audio fact-checking agent |
Disclaimer: Examples contributed by the community and partners do not represent Mistral's views and opinions.
This repository includes a lightweight Quarto preview site for reviewing Markdown and notebook cookbooks locally.
Install Quarto, generate the local preview files, then run the preview:
python3 scripts/generate_quarto_index.py
quarto preview --profile preview
Run the generator again after editing the cookbook tables in this README or Markdown cookbook files.
The preview renders committed notebook content without executing notebook code. Generated preview output is written to site/, and generated Markdown preview files are written as ignored sibling .qmd files next to their source Markdown files.
| Notebook | Category | Description |
|---|---|---|
| quickstart.ipynb | chat, embeddings | Basic quickstart with chat and embeddings with Mistral AI API |
| prompting_capabilities.ipynb | prompting | Write prompts for classification, summarization, personalization, and evaluation |
| basic_RAG.ipynb | RAG | RAG from scratch with Mistral AI API |
| embeddings.ipynb | embeddings | Use Mistral embeddings API for classification and clustering |
| function_calling.ipynb | function calling | Use Mistral API for function calling |
| evaluation.ipynb | evaluation | Evaluate models with Mistral API |
| mistral-search-engine.ipynb | RAG, function calling | Search engine built with Mistral API, function calling and RAG |
| rag_via_function_calling.ipynb | RAG, function calling | Use function calling as a router for a RAG based on multiple data sources |
| prefix_use_cases.ipynb | prefix, prompting | Cool examples with Mistral's prefix feature |
| synthetic_data_gen_and_finetune.ipynb | data generation, fine-tuning | Simple data generation and fine-tuning guide |
| data_generation_refining_news.ipynb | data generation | Simple data generation to refine news articles |
| image_description_prompting_pixtral.ipynb | image processing, prompting | Extract structured image descriptions using Mistral's Pixtral model and JSON response formatting |
| multimodality meets function calling.ipynb | image processing, function calling | Extract table from image using Mistral's Pixtral model and use for function calling |
| mistral-reference-rag.ipynb | RAG, function calling, references | Reference RAG with Mistral API |
| moderation-explored.ipynb | moderation | Quick exploration on safeguarding and Mistral's moderation API |
| system-level-guardrails.ipynb | moderation | How to implement System Level Guardrails with Mistral API |
| shieldstral_policy_moderation.ipynb | moderation | Policy-based content moderation with Shieldstral, Mistral's open-weights safety classifier |
| document_understanding.ipynb | OCR, function calling | Document Understanding and Tool Usage with OCR |
| batch_ocr.ipynb | OCR, batch | Using OCR to extract text data from datasets. |
| structured_ocr.ipynb | OCR, structured outputs | Extracting structured outputs from documents. |
| RAG_evaluation.ipynb | evaluation, structured outputs, LLM As a Judge | Evaluate RAG with LLM as a Judge and structured outputs |
| llm_judge_campaign_workflow.ipynb | observability, evaluation | Run campaigns with LLM judges to classify agent behaviors at scale |
| manage_datasets.ipynb | observability, datasets | Create and manage datasets for evaluation or fine-tuning |
| Custom MCP Server | MCP, connectors | Build a custom MCP server (tic-tac-toe) and connect it to Vibe |
| Object Detection | Vision | Object detection with mistral models. |
2,124 followers · starred Apr 2024
450 followers · starred May 2024
53 followers · starred Apr 2024
553 followers · starred Jul 2024