Mistral Cookbook

April 8, 2026 ยท View on GitHub

The Mistral Cookbook features examples contributed by Mistralers and our community, as well as our partners. If you have cool examples showcasing Mistral models, feel free to share them by submitting a PR to this repo.

Submission Guidelines:

  • File Format: Please submit your example in the .md or .ipynb format.
  • Runnable on Colab: If you're sharing a notebook example, try to make sure it's runnable on Google Colab.
  • Authorship: Kindly include your name, your Github handle, and affiliation at the beginning of the file.
  • Descriptions: Please include your notebook along with its category and descriptions in the table below.
  • Tone: Kindly maintain a neutral tone and minimize any excessive marketing materials.
  • Reproducibility: To ensure others can reproduce your work, kindly tag package versions in your code.
  • Image size: If you have images, please make sure each image's size is below 500KB.
  • Copyright: Always respect copyright and intellectual property laws.

Disclaimer: Examples contributed by the community and partners do not represent Mistral's views and opinions.

Content Guidelines:

  • Originality: Is your content original and offering a fresh perspective?
  • Clear: Is your content well-structured and clearly written?
  • Value: Is your content valuable to the community? Does the community need it?

Main Notebooks

NotebookCategoryDescription
quickstart.ipynbchat, embeddingsBasic quickstart with chat and embeddings with Mistral AI API
prompting_capabilities.ipynbpromptingWrite prompts for classification, summarization, personalization, and evaluation
basic_RAG.ipynbRAGRAG from scratch with Mistral AI API
embeddings.ipynbembeddingsUse Mistral embeddings API for classification and clustering
function_calling.ipynbfunction callingUse Mistral API for function calling
text_to_SQL.ipynbfunction callingUse Mistral API for function calling on a multi tables text to SQL usecase
evaluation.ipynbevaluationEvaluate models with Mistral API
mistral_finetune_api.ipynbfine-tuningFinetune a model with Mistral fine-tuning API
mistral-search-engine.ipynbRAG, function callingSearch engine built with Mistral API, function calling and RAG
rag_via_function_calling.ipynbRAG, function callingUse function calling as a router for a RAG based on multiple data sources
prefix_use_cases.ipynbprefix, promptingCool examples with Mistral's prefix feature
synthetic_data_gen_and_finetune.ipynbdata generation, fine-tuningSimple data generation and fine-tuning guide
data_generation_refining_news.ipynbdata generationSimple data generation to refine news articles
image_description_extraction_pixtral.ipynbimage processing, promptingExtract structured image descriptions using Mistral's Pixtral model and JSON response formatting
multimodality meets function calling.ipynbimage processing, function callingExtract table from image using Mistral's Pixtral model and use for function calling
mistral-reference-rag.ipynbRAG, function calling, referencesReference RAG with Mistral API
moderation-explored.ipynbmoderationQuick exploration on safeguarding and Mistral's moderation API
system-level-guardrails.ipynbmoderationHow to implement System Level Guardrails with Mistral API
document_understanding.ipynbOCR, function callingDocument Understanding and Tool Usage with OCR
batch_ocr.ipynbOCR, batchUsing OCR to extract text data from datasets.
structured_ocr.ipynbOCR, structured outputsExtracting structured outputs from documents.
RAG_evaluation.ipynbevaluation, structured outputs, LLM As a JudgeEvaluate RAG with LLM as a Judge and structured outputs
product_classification.ipynbfine-tuning, classifierFine-tuning a classifier for food classification.
intent_classification.ipynbfine-tuning, classifierFine-tuning a classifier for intent classification.
moderation_classifier.ipynbfine-tuning, classifierFine-tuning a classifier for moderation.
pixtral_finetune_on_satellite_data.ipynbfine-tuning, image processing, batchFine-tuning a Pixtral-12B for satellite images classification.
sts_demo.pychat, ttsSTT -> LLM -> TTS Demo.
llm_judge_campaign_workflow.ipynbobservability, evaluationRun campaigns with LLM judges to classify agent behaviors at scale
manage_datasets.ipynbobservability, datasetsCreate and manage datasets for evaluation or fine-tuning

Third Party Tools

ToolsCategoryParty
adaptive_rag_mistral.ipynbRAGLangchain
Adaptive_RAG.ipynbRAGLLamaIndex
Agents_Tools.ipynbagentLLamaIndex
arize_phoenix_tracing.ipynbtracing dataArize Phoenix
arize_phoenix_evaluate_rag.ipynbevaluationArize Phoenix
azure_ai_search_rag.ipynbRAG, embeddingsAzure
CAMEL Graph RAG with Mistral Modelsmulti-agent, tool, data genCAMEL-AI.org
CAMEL Role-Playing Scrapermulti-agent, tool, data genCAMEL-AI.org
Chainlit - Mistral reasoning.ipynbUI chat, tool callingChainlit
chroma_mistral_embed_fn.ipynbembeddings, vector DBChroma
corrective_rag_mistral.ipynbRAGLangchain
distilabel_synthetic_dpo_dataset.ipynbsynthetic dataArgilla
E2B Code Interpreter SDK with Codestraltool, agentE2B
function_calling_local.ipynbtool callOllama
Gradio Integration - Chat with PDFUI chat, demo, RAGGradio
haystack_chat_with_docs.ipynbRAG, embeddingsHaystack
Indexify Integration - PDF Entity Extractionentity extraction, PDFIndexify
Indexify Integration - PDF Summarizationsummarization, PDFIndexify
langgraph_code_assistant_mistral.ipynbcodeLangchain
langgraph_crag_mistral.ipynbRAGLangchain
langtrace_mistral.ipynbOTEL ObservabilityLangtrace
llamaindex_agentic_rag.ipynbRAG, agentLLamaIndex
llamaindex_arxiv_agentic_rag.ipynbRAG, agent, Arxiv summarizationLLamaIndex
llamaindex_mistralai_finetuning.ipynbfine-tuningLLamaIndex
llamaindex_mistral_multi_modal.ipynbMultiModalLLM-PixtralLLamaIndex
Maxim AI - Observability Observability, EvaluationMaxim AI
Microsoft Autogen - Function calling a pgsql db Tool call, agent, RAGMs Autogen
Mesop Integration - Chat with PDFUI chat, demo, RAGMesop
Monitoring Mistral AI using OpenTelemetryAI ObservabilityOpenLIT
neon_text_to_sql.ipynbcodeNeon
ollama_mistral_llamaindex.ipynbRAGLLamaIndex
Ollama Meetup DemodemoOllama
Open-source LLM engineeringLLM ObservabilityLangfuse
Panel Integration - Chat with PDFUI chat, demo, RAGPanel
phospho integrationEvaluation, Analyticsphospho
pinecone_rag.ipynbRAGPinecone
RAG.ipynbRAGLLamaIndex
RouterQueryEngine.ipynbagentLLamaIndex
self_rag_mistral.ipynbRAGLangchain
Solara Integration - Chat with PDFsUI chat, demo, RAGSolara
Streamlit Integration - Chat with PDFUI chat, demo, RAGStreamlit
Neo4j ragRAGNeo4j
SubQuestionQueryEngine.ipynbagentLLamaIndex
LLM Judge: Detecting hallucinations in language modelsfine-tuning, evaluationWeights & Biases
x mistral: CLI & TUI APP Module in X-CMDCLI, TUI APP, Chatx-cmd
Incremental Prompt Engineering and Model ComparisonPrompt Engineering, EvaluationPixeltable
Build a bank support agent with Pydantic AI and Mistral AIAgentPydantic
Mistral and MLflow TracingTracing, ObservabilityMLflow
Mistral OCR with GradioOCRGradio
prompt_optimization.ipynb)PromptingOptimizing prompts without any supervision