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