Instructions to use unsloth/Magistral-Small-2506-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use unsloth/Magistral-Small-2506-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="unsloth/Magistral-Small-2506-GGUF", filename="Magistral-Small-2506-BF16.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use unsloth/Magistral-Small-2506-GGUF with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf unsloth/Magistral-Small-2506-GGUF:UD-Q4_K_XL # Run inference directly in the terminal: llama cli -hf unsloth/Magistral-Small-2506-GGUF:UD-Q4_K_XL
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf unsloth/Magistral-Small-2506-GGUF:UD-Q4_K_XL # Run inference directly in the terminal: llama cli -hf unsloth/Magistral-Small-2506-GGUF:UD-Q4_K_XL
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 unsloth/Magistral-Small-2506-GGUF:UD-Q4_K_XL # Run inference directly in the terminal: ./llama-cli -hf unsloth/Magistral-Small-2506-GGUF:UD-Q4_K_XL
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 unsloth/Magistral-Small-2506-GGUF:UD-Q4_K_XL # Run inference directly in the terminal: ./build/bin/llama-cli -hf unsloth/Magistral-Small-2506-GGUF:UD-Q4_K_XL
Use Docker
docker model run hf.co/unsloth/Magistral-Small-2506-GGUF:UD-Q4_K_XL
- LM Studio
- Jan
- Ollama
How to use unsloth/Magistral-Small-2506-GGUF with Ollama:
ollama run hf.co/unsloth/Magistral-Small-2506-GGUF:UD-Q4_K_XL
- Unsloth Studio
How to use unsloth/Magistral-Small-2506-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 unsloth/Magistral-Small-2506-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 unsloth/Magistral-Small-2506-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for unsloth/Magistral-Small-2506-GGUF to start chatting
- Atomic Chat new
- Docker Model Runner
How to use unsloth/Magistral-Small-2506-GGUF with Docker Model Runner:
docker model run hf.co/unsloth/Magistral-Small-2506-GGUF:UD-Q4_K_XL
- Lemonade
How to use unsloth/Magistral-Small-2506-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull unsloth/Magistral-Small-2506-GGUF:UD-Q4_K_XL
Run and chat with the model
lemonade run user.Magistral-Small-2506-GGUF-UD-Q4_K_XL
List all available models
lemonade list
Struggling with this in ollama
I have pulled the model as shown here:
https://docs.unsloth.ai/basics/magistral-how-to-run-and-fine-tune
and it seems to run ok, when i load it up in openwebui it either continues to think and never stops, or it doesnt think at all. I have tried modifying many params, forcing temp, forcing min_p and other params, trying the system prompt and even tried pulling the raw gguf, and applying the model file to it adding in the ollama template. Now its like a completions model and doesnt think?
Here is my model file:
from Magistral-Small-2506-UD-Q6_K_XL.gguf
SET PARAMETER temperature 0.7
SET PARAMETER top_p 0.95
TEMPLATE {{- range $i, $_ := .Messages }}
{{- $last := eq (len (slice $.Messages $i)) 1}}
{{- if eq .Role "system" }}[SYSTEM_PROMPT]{{ .Content }}[/SYSTEM_PROMPT]
{{- else if eq .Role "user" }}[INST]{{ .Content }}[/INST]
{{- else if eq .Role "assistant" }}
{{- if and $.IsThinkSet (and $last .Thinking) -}}
<think>
{{ .Thinking }}
</think>
{{- end }}
{{- if .Content }}{{ .Content }}
{{- end }}
{{- if not (eq (len (slice $.Messages $i)) 1) }}</s>
{{- end }}
{{- end }}
{{- end }}
SYSTEM """A user will ask you to solve a task. You should first draft your thinking process (inner monologue) until you have derived the final answer. Afterwards, write a self-contained summary of your thoughts (i.e. your summary should be succinct but contain all the critical steps you needed to reach the conclusion). You should use Markdown and Latex to format your response. Write both your thoughts and summary in the same language as the task posed by the user.
Your thinking process must follow the template below:
<think>
Your thoughts or/and draft, like working through an exercise on scratch paper. Be as casual and as long as you want until you are confident to generate a correct answer.
</think>
Here, provide a concise summary that reflects your reasoning and presents a clear final answer to the user.
Problem:"""
in ollama I get:
Testing the ollama version works as expected, but was looking for q6 quant.
Any ideas why this would happen?
Have you tried the Q8 quant and see if the same issue occurs?
