For the complete documentation index, see llms.txt. Markdown versions of all docs pages are available by appending .md to any docs URL.
Mistral
Configure kagent to use Mistral models by creating a ModelConfig for the Mistral provider.
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.
Create the ModelConfig
Save your Mistral API key as an environment variable.
export MISTRAL_API_KEY=<your_api_key>Create a Kubernetes Secret that stores the API key. Create it in the same namespace as the AgentTemplates that use it, such as
kagent.kubectl create secret generic kagent-mistral -n kagent --from-literal MISTRAL_API_KEY=$MISTRAL_API_KEYCreate a
ModelConfigthat references the Secret. Every field in themistralblock is optional, and an empty block is valid.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: {} EOFField Description apiKeySecretThe name of the Kubernetes Secret that stores the API key, in the same namespace as this ModelConfig. apiKeySecretKeyThe key within that Secret that holds the API key. modelThe model to use. For the available models, see the Mistral model docs. providerThe provider to use, Mistral.mistralSettings that only the Mistral provider takes. An empty block is valid. A CEL rule rejects a mistralblock 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.
| 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. |
Use the ModelConfig
Reference the ModelConfig by name from an AgentTemplate in the same namespace.
spec:
modelConfig:
name: mistral-model-config