<img src="https://github.com/jmorganca/ollama/assets/3325447/d6be0694-eb35-417b-8f08-47d3b6c2a171" width="200"/> Mistral is a 7B parameter model, distributed with the Apache license. It is available …
<img src="https://github.com/jmorganca/ollama/assets/3325447/d6be0694-eb35-417b-8f08-47d3b6c2a171" width="200"/>
Mistral is a 7B parameter model, distributed with the Apache license. It is available in both instruct (instruction following) and text completion.
The Mistral AI team has noted that Mistral 7B:
- Outperforms Llama 2 13B on all benchmarks
- Outperforms Llama 1 34B on many benchmarks
- Approaches CodeLlama 7B performance on code, while remaining good at English tasks
### Versions
| Tag | Date | Notes |
| --------------- | ---------- | ----------------------------------------------------------- |
| `v0.3` `latest` | 05/22/2024 | A new version of Mistral 7B that supports function calling. |
| `v0.2` | 03/23/2024 | A minor release of Mistral 7B |
| `v0.1` | 09/27/2023 | Initial release |
### Function calling
Mistral 0.3 supports function calling with Ollama's **raw mode**.
<sub>Example raw prompt</sub>
```
[AVAILABLE_TOOLS] [{"type": "function", "function": {"name": "get_current_weather", "description": "Get the current weather", "parameters": {"type": "object", "properties": {"location": {"type": "string", "description": "The city and state, e.g. San Francisco, CA"}, "format": {"type": "string", "enum": ["celsius", "fahrenheit"], "description": "The temperature unit to use. Infer this from the users location."}}, "required": ["location", "format"]}}}][/AVAILABLE_TOOLS][INST] What is the weather like today in San Francisco [/INST]
```
<sub>Example response</sub>
```
[TOOL_CALLS] [{"name": "get_current_weather", "arguments": {"location": "San Francisco, CA", "format": "celsius"}}]
```
For more information on raw mode, see the [API documentation](https://github.com/ollama/ollama/blob/main/docs/api.md#request-raw-mode).
### Variations
| | |
| ---------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| `instruct` | Instruct models follow instructions |
| `text` | Text models are the base foundation model without any fine-tuning for conversations, and are best used for simple text completion. |
## Usage
### CLI
Instruct:
```
ollama run mistral
```
### API
Example:
```
curl -X POST http://localhost:11434/api/generate -d '{
"model": "mistral",
"prompt":"Here is a story about llamas eating grass"
}'
```
## References
[HuggingFace](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2)
[Mistral AI News Release](https://mistral.ai/news/announcing-mistral-7b/)