These docs track the main branch and may describe unreleased features. The stable documentation lives at docs.docker.com.

Mistral

Use Mistral AI models with Docker Agent.

Overview

Mistral AI provides powerful language models through an OpenAI-compatible API. Docker Agent includes built-in support for Mistral as an alias provider.

Setup

  1. Get an API key from Mistral Console

  2. Set the environment variable:

    export MISTRAL_API_KEY=your-api-key
    

Usage

Inline Syntax

The simplest way to use Mistral:

agents:
  root:
    model: mistral/mistral-large-latest
    description: Assistant using Mistral
    instruction: You are a helpful assistant.

Named Model

For more control over parameters:

models:
  mistral:
    provider: mistral
    model: mistral-large-latest
    temperature: 0.7
    max_tokens: 8192

agents:
  root:
    model: mistral
    description: Assistant using Mistral
    instruction: You are a helpful assistant.

Available Models

Model Description Context
mistral-large-latest Most capable Mistral model 128K
mistral-medium-latest Balanced performance and cost 128K
mistral-small-latest Fast and cost-effective (default) 128K
codestral-latest Optimized for code generation 32K
open-mistral-nemo Open-weight model 128K
ministral-8b-latest Compact 8B parameter model 128K
ministral-3b-latest Smallest Mistral model 128K

Check the Mistral Models documentation for the latest available models.

Auto-Detection

When you run docker agent run without specifying a config and no project-level docker-agent.yaml, docker-agent.yml, or docker-agent.hcl exists, Docker Agent automatically detects available providers. If MISTRAL_API_KEY is set and higher-priority providers (OpenAI, Anthropic, Google) are not available, Mistral will be used with mistral-small-latest as the default model.

Extended Thinking

Docker Agent's thinking_budget field is not applied to Mistral models: the underlying OpenAI-compatible client only sends reasoning_effort for OpenAI reasoning model names (o-series, gpt-5). Setting thinking_budget on a Mistral model passes config validation but has no effect on the request.

Mistral reasoning models (e.g. magistral) reason on their own without configuration. For non-reasoning models, use the think tool instead.

How It Works

Mistral is implemented as a built-in alias in Docker Agent:

This means Mistral uses the same client as OpenAI, making it fully compatible with all OpenAI features supported by Docker Agent.

Example: Code Assistant

agents:
  coder:
    model: mistral/codestral-latest
    description: Expert code assistant
    instruction: |
      You are an expert programmer using Codestral.
      Write clean, efficient, well-documented code.
      Explain your reasoning when helpful.
    toolsets:
      - type: filesystem
      - type: shell
      - type: think