Learn the basics of one of the best open source alternative to ChatGPT.

Mistral AI is a French company in artificial intelligence that offers open-weight large language models. It was founded in 2023 by researchers who previously worked at Google DeepMind and Meta AI, but it has quickly become a significant player in the industry.

What sets Mistral apart is their focus on both open-source and commercial models. While many competitors keep their technology under lock and key, Mistral gives developers and businesses more freedom to customize and deploy their AI solutions. Their approach emphasizes efficiency and practical applications rather than just raw size.

Interestingly, their models often perform just as well as—or even better than—much larger models from other companies. Their innovative architectural design maximizes performance without requiring excessive computational resources. This efficiency-focused approach has helped them rapidly gain traction in a competitive market.

This tutorial introduces Mistral AI, focusing primarily on the free 'Le Chat' service. Similar to ChatGPT and Claude, Le Chat enables users to perform the same tasks and actions they would with those AI chatbots. This guide will provide a basic overview of the Le Chat interface, its tools, and the AI agents utilized for specific tasks.

This tutorial focuses on:

  • Access Le Chat
  • Select the tools for your prompt
  • Use the attachment feature to augment your prompts
  • Create an agent and use it for specific tasks
  • Comparison between Mistral, ChatGPT, and Claude

Let’s dive in!

Access Le Chat

Access Mistral AI le chat. A familiar interface welcomes you to their chatbot. 

The interface is similar to ChatGPT and Claude. A prompt box with settings and features is at the center of the page. The left navigation pane hosts familiar links. You can access a previous chat, open a new one, or search for previous chats. 

The attachment feature allows you to attach a file to the prompt. At the time of writing this tutorial, Mistral only supports PDFs and images. We will come to this feature later in this tutorial. 

Although the Tool feature is new, it hosts familiar settings like web search, image generation, code interpreter, and canvas. The code interpreter feature focuses on codes. It also helps you generate charts and graphs. 

In general, the tools feature allows you to access:

Web Browsing:

  • Web Search: Find the latest info online.
  • News Search: Stay updated with recent news.

Multi-Modal:

  • Image Generation: Create images from text.
  • Image Reading: Extract text from images.
  • Python Code Interpreter: If you're into data analysis or need to run some calculations, this tool lets you execute Python code in a safe environment. It's great for simulations and visualizations, too!

Canvas Generation: Create visual canvases (enable in a new conversation).

Let’s explore each feature in detail. 

Select the tools for your prompt.

The web search feature allows Mistral modal to search the web for answers. For example, if you want to find out specifically about Python libraries that support data analysis, click the tools and deselect all the other options. 

Now, type a prompt that asks about Python libraries for data analysis. Use the following prompt to get started.

Prompt

Which Python libraries are best for data analysis?

Let’s say you want an example of how Pandas can preprocess and transform data tasks. Go to the ‘Tools’ and click the ‘Code Interpreter’ checkbox. 

Use the following prompt:

Prompt:

Give me an example that shows Pandas preprocessing and transforming data tasks. 

Image generation

The image generation feature is similar to that of other chatbot services. Mistral AI allows users to create visuals from text descriptions. This feature helps generate illustrations, memes, or any visual content by simply describing what you want to see. It's a convenient way to turn ideas into images quickly and easily.

Go to the ‘Tools’ feature and turn on ‘Image generation.’

Let’s say you want to imagine a cat ready to pounce on a ball. Use the following prompt to generate an image of it. 

Prompt:

A brown and white juvenile cat prepares to pounce on a ball—a realistic image. The background shows a park.

The image is better than what ChatGPT Dall-E can create, and the clarity is evident. Mistral followed the prompt accurately. It generated the image in 3.6 seconds, which is impressive. 

Canvas feature

Similar to the innovative Claude artifacts, and ChatGPT canvas, Mistral Canvas enhances user productivity by allowing for direct content modification and collaboration. It goes beyond simple chat interactions, enabling users to create and edit documents, presentations, code, and mockups with the assistance of AI. This tool supports creative ideation and iterative work, making it a versatile addition to various professional tasks.

For example, you want to generate a react dashboard with mock data that displays user engagement, performance, feedback, and business metrics. Click ‘New chat.’ In the ‘Tools’ dropdown, select ‘Canvas.’

Use the following prompt as an example:

Prompt:

Create a React dashboard with mock data that displays user engagement metrics, performance metrics, feedback metrics, and business metrics.

Mistral generated a simple rendition of a dashboard.

Note: You can use the attachments feature to provide raw data. Mistral will use it to create a metrics dashboard. 

Use the attachment feature to augment your prompts.

Sharing files in Mistral Le Chat is similar to what you do in ChatGPT and Claude. You can drop in images, PDFs, and other documents right in your conversation without switching apps or breaking your flow. The whole experience feels more like a natural conversation where you can simply hand over what you're talking about.

Let’s say you want a summary of the contents of a PDF file instead of spending time reading it. Click the paperclip icon in the chat box. Attach a PDF file and ask Mistral to summarize the contents and provide an overview. 

Prompt: 

[Attach PDF] Please summarize the tutorial showing how to build a tic-tac-toe game in React and provide an overview of the PDF's contents.

In the PDF, you can ask follow-up questions to learn more about a topic. For example, you can ask Mistral to give you an overview of the process of making an interactive component. 

Prompt:

Please provide an overview of the exact steps for making an interactive component.

However, if you want to automate specific tasks, such as workflow, or make decisions based on predefined rules, you can use the powerful Mistral agents to create automated tasks.  

Create an agent for specific tasks.

In Mistral, "agents" are automated or semi-automated software entities designed to perform specific tasks, such as automating workflows, making decisions based on predefined rules, and interacting with users or systems. 

They enhance efficiency by handling repetitive tasks, enabling decision-making, and adapting to changing conditions. Agents are used in various applications, including customer support, finance, and healthcare, to streamline operations and improve user experiences.

To create an agent, go to the Mistral Ai console. Click the ‘Create an agent’ box in the center of the console page. 

Type the agent's name and a short description on the ensuing page.

Next, select the model for your agent. Mistral models are advanced large language models designed to understand and generate human-like text. Trained on extensive internet data, these models use transformer neural networks to assist with various tasks, from answering questions to writing code. 

Choose the appropriate model for your agent. For example, keep the Mistral Large 2.1 for social media texts or blogs. If the agent you’re configuring is related to coding, choose a specialist model like Codestral 25.01. 

After choosing a model, set the randomness temperature. Randomness temperature is a hyperparameter in language models that controls the randomness of predictions by adjusting the probability distribution of output tokens. Higher temperatures increase randomness, encouraging diversity and creativity in generated text, while lower temperatures make outputs more deterministic and conservative. It balances exploration and exploitation in text generation.

Next, we must provide a system prompt for the agent to focus on a defined behavior or task. The system prompt should explain the agent's tasks when a user enters a related prompt. In our example, we instructed the agent to extract key information for a blog post, generate multiple variations for a Facebook post, and provide a direct link to the blog post for further reading. 

Once the system prompt is finalized, enhance performance by priming the model with high-quality input/output examples.  

For user input, include a link to a blog post. In the ‘Model Output’ section, provide an example of the desired response when the model receives a user prompt. In our demonstration, we used a sample Facebook post summarising the blog content and crafted a compelling introduction to encourage users to click the link.

Select the appropriate deployment model for the agent. If you want the agent to provide answers in Le chat, click the Le chat checkbox. If you're going to deploy the agent in an API, check the box next to ‘API.’

Once everything is finalized, click the ‘Deploy’ or an ‘Update’ button at the top right corner of the agent configuration screen. 

The Agents page lists all the agents you configure. You can click an agent's name to access its configuration page.

In the Le chat window, you can access the agent by typing ‘@’ and selecting the appropriate agent to get the desired output. 

Comparison between Mistral, ChatGPT, and Claude

Mistral has its strengths when compared to ChatGPT and Claude. When evaluating AI models, it’s important to consider factors like performance, cost, openness, and best use cases. Here’s how Mistral (Mixtral 8x7B), ChatGPT (GPT-4-turbo), and Claude (Claude 3 Opus) compare:

1. Model Type & Openness

  • Mistral is an open-weight model, meaning developers can access and modify it with some restrictions.
  • ChatGPT and Claude are proprietary, closed-source models, limiting user control over fine-tuning and deployment.

2. Strengths & Performance

  • Mistral excels in coding, multilingual tasks, and cost-effective deployment. It offers a good balance between speed and accuracy.
  • ChatGPT is a well-rounded model with strong general knowledge, reasoning, and creativity, making it ideal for chat-based applications.
  • Claude is best at handling long-context documents, providing nuanced responses, and deep reasoning tasks.

3. Context Length

  • Mistral offers around 32K tokens (implementation-dependent).
  • ChatGPT supports up to 128K tokens in its latest version.
  • Claude leads with 200K tokens, making it ideal for processing extensive documents.

4. Multimodal Capabilities

  • Mistral does not natively support images, audio, or video but can integrate with other tools.
  • ChatGPT supports image input (Pro version).
  • Claude has limited multimodal features compared to ChatGPT.

5. Pricing & Cost-Effectiveness

  • Mistral is the most budget-friendly option, offering high-end features at a fraction of the cost of its competitors.
  • ChatGPT tends to be more expensive, especially for API usage.
  • Claude is typically premium-priced, especially for long-context applications.

6. Best Use Cases

  • Mistral is great for developers, multilingual projects, and cost-conscious AI applications.
  • ChatGPT is best for general-purpose chat, summarization, and creative writing.
  • Claude is ideal for research, technical writing, and working with long-form content.
  • Mistral is a good choice for those who want more control over AI models while keeping costs low, whereas ChatGPT excels in general chat and reasoning, and Claude is ideal for long-context understanding and nuanced responses.

    However, in terms of pricing, Mistral delivers high-end features at a fraction of the cost of ChatGPT or Claude.

    That’s it, folks! This exhaustive introduction to Mistral AI will help you navigate its features and find the best chatbot model for your workflow. Please remember to explore, experiment, and fine-tune the model to suit your specific needs. 

    Got an idea for a new feature or tutorial? Help us make the academy even better.

    More tutorials like this

    Use AI to review contracts, spot important clauses, understand what they mean, and get helpful recommendations.
    📖
    Legal
    ChatGPT
    👨‍🎓
    Beginner
    Summarize your emails using an AI-powered agent created through a simple automation workflow in n8n
    📖
    Productivity
    n8n
    👨‍🎓
    Advanced