Home

Awesome

Mistral Cookbook

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:

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

Content Guidelines:

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
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

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
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
Microsoft Autogen - Function calling a pgsql db Tool call, agent, RAGMs Autogen
Mesop Integration - Chat with PDFUI chat, demo, RAGMesop
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