Instructions to use mistralai/Devstral-Small-2507_gguf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use mistralai/Devstral-Small-2507_gguf with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="mistralai/Devstral-Small-2507_gguf", filename="Devstral-Small-2507-BF16.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use mistralai/Devstral-Small-2507_gguf with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf mistralai/Devstral-Small-2507_gguf:Q4_K_M # Run inference directly in the terminal: llama-cli -hf mistralai/Devstral-Small-2507_gguf:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf mistralai/Devstral-Small-2507_gguf:Q4_K_M # Run inference directly in the terminal: llama-cli -hf mistralai/Devstral-Small-2507_gguf:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf mistralai/Devstral-Small-2507_gguf:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf mistralai/Devstral-Small-2507_gguf:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf mistralai/Devstral-Small-2507_gguf:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf mistralai/Devstral-Small-2507_gguf:Q4_K_M
Use Docker
docker model run hf.co/mistralai/Devstral-Small-2507_gguf:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use mistralai/Devstral-Small-2507_gguf with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mistralai/Devstral-Small-2507_gguf" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mistralai/Devstral-Small-2507_gguf", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/mistralai/Devstral-Small-2507_gguf:Q4_K_M
- Ollama
How to use mistralai/Devstral-Small-2507_gguf with Ollama:
ollama run hf.co/mistralai/Devstral-Small-2507_gguf:Q4_K_M
- Unsloth Studio new
How to use mistralai/Devstral-Small-2507_gguf with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for mistralai/Devstral-Small-2507_gguf to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for mistralai/Devstral-Small-2507_gguf to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for mistralai/Devstral-Small-2507_gguf to start chatting
- Pi new
How to use mistralai/Devstral-Small-2507_gguf with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf mistralai/Devstral-Small-2507_gguf:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "mistralai/Devstral-Small-2507_gguf:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use mistralai/Devstral-Small-2507_gguf with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf mistralai/Devstral-Small-2507_gguf:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default mistralai/Devstral-Small-2507_gguf:Q4_K_M
Run Hermes
hermes
- Docker Model Runner
How to use mistralai/Devstral-Small-2507_gguf with Docker Model Runner:
docker model run hf.co/mistralai/Devstral-Small-2507_gguf:Q4_K_M
- Lemonade
How to use mistralai/Devstral-Small-2507_gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull mistralai/Devstral-Small-2507_gguf:Q4_K_M
Run and chat with the model
lemonade run user.Devstral-Small-2507_gguf-Q4_K_M
List all available models
lemonade list
Zed editor - some tool calls not working
I'm trying Devstral served by llama.cpp with Zed editor's agent feature and it's pretty cool, but some tools fail consistently when the tool is defined using references like this (some parts below left out to keep it short):
"function": {
"name": "now",
"parameters": {
"definitions": {
"Timezone": {
"oneOf": [
{"description": "Use UTC.", "type": "string", "const": "utc"},
{"description": "Use local time.", "type": "string", "const": "local"}
]
}
},
"properties": {
"timezone": {
"allOf": [{"$ref": "#/definitions/Timezone"}]
}
},
"required": ["timezone"],
}
}
The now tool call never succeeds as Devstral always sets the timezone to an empty object, seemingly because the allOf and the $ref aren't resolved properly. Is that an issue in Devstral's chat template or is this an issue in llama.cpp server?
I've investigated a bit more because I've got a confirmation from a Redditor they can use tools in Zed with Devstral.
Turns out that llama.cpp doesn't handle tools properly and neither does LM Studio, for both your Q5_K_M and Unsloth's UD_Q5_K_XL.
However, your Q4_K_M does use tools defined like this with LM Studio (but still not with llama.cpp)! So the issue is with quantization + serving software, but not with the model or its chat template as such.
Hi !
Indeed regarding tool calls our GGUFs would not work out of the box because we didn't put in the GGUFs a chat template that supports tool calls. To give you context, at Mistral we do not support chat templates natively and use mistral-common to properly handle our requests. This means that chat templates that are released are community-based, and often prone to errors in the early stages (days or weeks).
That being said, currently we convert our models to a GGUF with a chat template that covers the minimum features that we're certain work:
- system prompt
- tokenization of multi-turn user and assistant messages
To circumvent this, it is possible to change the jinja template used by llama.cpp to correctly tokenize the input for tool calls but it would require creating it. This is what LM Studio did when converting our model to GGUF, they created their own jinja template to make sure our models call tools following their requirements.
We're aware of this difficulty and we are trying to cook something to ease usage of our models.