| 1 | --- |
| 2 | title: "How to Configure Mistral with Continue" |
| 3 | slug: ../mistral |
| 4 | description: "Configure Mistral AI models with Continue, including Mistral Large for chat, Codestral for code autocomplete, and Mistral Embed for embeddings with separate API key options" |
| 5 | sidebarTitle: "Mistral" |
| 6 | --- |
| 7 | |
| 8 | <Info> |
| 9 | You can get an API key from the [Mistral |
| 10 | Dashboard](https://console.mistral.ai). Note that the API key for Codestral |
| 11 | (codestral.mistral.ai) is different from for all other models |
| 12 | (api.mistral.ai). If you are using a Codestral API key, you should set the |
| 13 | `apiBase` to `https://codestral.mistral.ai/v1`. Otherwise, we will default to |
| 14 | using `https://api.mistral.ai/v1`. |
| 15 | </Info> |
| 16 | |
| 17 | ## How to Set Up Mistral Chat Models |
| 18 | |
| 19 | We recommend configuring **Mistral Large** as your chat model. |
| 20 | |
| 21 | <Tabs> |
| 22 | <Tab title="YAML"> |
| 23 | ```yaml title="config.yaml" |
| 24 | models: |
| 25 | - name: Mistral Large |
| 26 | provider: mistral |
| 27 | model: mistral-large-latest |
| 28 | apiKey: <YOUR_MISTRAL_API_KEY> |
| 29 | roles: |
| 30 | - chat |
| 31 | ``` |
| 32 | </Tab> |
| 33 | <Tab title="JSON"> |
| 34 | ```json title="config.json" |
| 35 | { |
| 36 | "models": [ |
| 37 | { |
| 38 | "title": "Mistral Large", |
| 39 | "provider": "mistral", |
| 40 | "model": "mistral-large-latest", |
| 41 | "apiKey": "<YOUR_MISTRAL_API_KEY>" |
| 42 | } |
| 43 | ] |
| 44 | } |
| 45 | ``` |
| 46 | </Tab> |
| 47 | </Tabs> |
| 48 | |
| 49 | ## How to Set Up Mistral Autocomplete Models |
| 50 | |
| 51 | We recommend configuring **Codestral** as your autocomplete model. |
| 52 | |
| 53 | <Tabs> |
| 54 | <Tab title="YAML"> |
| 55 | ```yaml title="config.yaml" |
| 56 | models: |
| 57 | - name: Codestral |
| 58 | provider: mistral |
| 59 | model: codestral-latest |
| 60 | # apiBase: https://codestral.mistral.ai/v1 # Do this if you are using a Codestral API key |
| 61 | roles: |
| 62 | - autocomplete |
| 63 | ``` |
| 64 | </Tab> |
| 65 | <Tab title="JSON"> |
| 66 | ```json title="config.json" |
| 67 | { |
| 68 | "tabAutocompleteModel": { |
| 69 | "title": "Codestral", |
| 70 | "provider": "mistral", |
| 71 | "model": "codestral-latest" |
| 72 | // "apiBase": "https://codestral.mistral.ai/v1" // Do this if you are using a Codestral API key |
| 73 | } |
| 74 | } |
| 75 | ``` |
| 76 | </Tab> |
| 77 | </Tabs> |
| 78 | |
| 79 | ## How to Configure Mistral Embeddings Models |
| 80 | |
| 81 | We recommend configuring **Mistral Embed** as your embeddings model. |
| 82 | |
| 83 | <Tabs> |
| 84 | <Tab title="YAML"> |
| 85 | ```yaml title="config.yaml" |
| 86 | models: |
| 87 | - name: Mistral Embed |
| 88 | provider: mistral |
| 89 | model: mistral-embed |
| 90 | apiKey: <YOUR_MISTRAL_API_KEY> |
| 91 | apiBase: https://api.mistral.ai/v1 |
| 92 | roles: |
| 93 | - embed |
| 94 | ``` |
| 95 | </Tab> |
| 96 | <Tab title="JSON"> |
| 97 | ```json title="config.json" |
| 98 | { |
| 99 | "embeddingsProvider": { |
| 100 | "provider": "mistral", |
| 101 | "model": "mistral-embed", |
| 102 | "apiKey": "<YOUR_MISTRAL_API_KEY>", |
| 103 | "apiBase": "https://api.mistral.ai/v1" |
| 104 | } |
| 105 | } |
| 106 | ``` |
| 107 | </Tab> |
| 108 | </Tabs> |
| 109 | |
| 110 | ## How to Configure Mistral Reranking Models |
| 111 | |
| 112 | Mistral currently does not offer any reranking models. |
| 113 | |
| 114 | [Click here](../../model-roles/reranking.mdx) to see a list of reranking model providers. |