Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ When a request is made to a provider, the gateway puts the credential in the hea
| `Foundry` API key in Anthropic format | `x-api-key: <key>` |
| `Gemini` API key | `x-goog-api-key: <key>` |
| `Bedrock` bearer token | `authorization: Bearer <token>` |
| `Ollama` API key, for an Ollama Cloud model | `authorization: Bearer <key>` |
| `Ollama` API key, for an Ollama Cloud model | `authorization: Bearer *** |
| `Mistral` API key | `authorization: Bearer *** |
| A Secret-backed `RemoteMCPServer` header | The header that the server names |

Substrate matches a destination on the exact DNS hostname, without path, port, or scheme. Two credentials that target the same hostname and header are rejected, including a conflict between an agent's model, a memory embedding model, and an MCP server. Give such origins distinct DNS names. A destination given as an IP address cannot carry an injected credential at all.
Expand Down
79 changes: 79 additions & 0 deletions docs-site/content/kagent/1.x/setup/model-providers/mistral.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
---
title: Mistral
description: Configure kagent to use Mistral models by creating a ModelConfig for the Mistral provider.
weight: 20
author: kagent.dev
---

The `Mistral` provider calls the Mistral API directly. Mistral speaks the OpenAI-compatible wire protocol, but kagent exposes it as its own `provider: Mistral` value rather than routing it through the `OpenAI` provider.

> [!NOTE]
> This provider works on the `kagent` and `byo` runtimes, but not on `codex` or `claude`. For more information, see [Agent harness]({{< link path="agents/agent-harness#model-provider-support" >}}).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue #517 asks for a run against a real Mistral key and an on-cluster check of the kagent/byo-only restriction. Did you run either, and on which kagent version?


## Create the ModelConfig

1. Save your [Mistral API key](https://console.mistral.ai/api-keys) as an environment variable.
```bash
export MISTRAL_API_KEY=<your_api_key>
```

2. Create a Kubernetes Secret that stores the API key. Create it in the same namespace as the AgentTemplates that use it, such as `kagent`.
```bash
kubectl create secret generic kagent-mistral -n kagent --from-literal MISTRAL_API_KEY=$MISTRAL_API_KEY
```

3. Create a `ModelConfig` that references the Secret. Every field in the `mistral` block is optional, and an empty block is valid.
```yaml
kubectl apply -f - <<EOF
apiVersion: api.kagent.dev/v1alpha3
kind: ModelConfig
metadata:
name: mistral-model-config
namespace: kagent
spec:
apiKeySecret: kagent-mistral
apiKeySecretKey: MISTRAL_API_KEY
model: mistral-large-latest
provider: Mistral
mistral: {}
EOF
```

| Field | Description |
| ----- | ----------- |
| `apiKeySecret` | The name of the Kubernetes Secret that stores the API key, in the same namespace as this ModelConfig. |
| `apiKeySecretKey` | The key within that Secret that holds the API key. |
| `model` | The model to use. For the available models, see the [Mistral model docs](https://docs.mistral.ai/models). |
| `provider` | The provider to use, `Mistral`. |
| `mistral` | Settings that only the Mistral provider takes. An empty block is valid. A CEL rule rejects a `mistral` block on any other provider. |

## Mistral provider settings

The `mistral` block takes the following optional settings. For every field, including its type, default, and validation rules, see the [API reference]({{< link path="reference/api-ref#mistralconfig" >}}).

| Field | Description |
| ----- | ----------- |
| `baseUrl` | An alternative Mistral API endpoint. Defaults to `https://api.mistral.ai/v1`. |
| `temperature` | How much randomness the model applies when it picks the next token, written as a string. |
| `topP` | The nucleus sampling cutoff, written as a string. |
| `maxTokens` | A cap on the tokens generated in one response. Minimum 1. |
| `timeout` | How long to wait on a request to the provider, in seconds. Minimum 1. |

Mistral embeddings (`mistral-embed`) are out of scope for this page.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is scoping guidance from the issue, not reader content. Remove it.

Suggested change
Mistral embeddings (`mistral-embed`) are out of scope for this page.


## Use the ModelConfig

Reference the ModelConfig by name from an AgentTemplate in the same namespace.

```yaml
spec:
modelConfig:
name: mistral-model-config
```

## Next steps

{{< cards >}}
{{< card link=`{{< link path="get-started/your-first-agent" >}}` title="Your first agent" subtitle="Create an agent that uses this model, and hold a conversation with it." >}}
{{< card link=`{{< link path="setup/model-providers/byo-openai" >}}` title="BYO OpenAI-compatible endpoint" subtitle="Point the OpenAI provider at a different service." >}}
{{< /cards >}}
Loading