ollama - 💡(How to fix) Fix Add Mistral Small 4 to Ollama Models [2 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
ollama/ollama#15142Fetched 2026-04-08 01:53:06
View on GitHub
Comments
2
Participants
3
Timeline
10
Reactions
1
Author
Timeline (top)
subscribed ×4commented ×2labeled ×2mentioned ×1
RAW_BUFFERClick to expand / collapse

Mistral did recently release Mistral Small 4 (see: https://mistral.ai/news/mistral-small-4) as the successor to the very successful Mistral Small line (where, previously, the last installment was Mistral Small 3.2, which is almost a year old now).

The model is, again, fully open source and weights are already available on Huggingface: https://huggingface.co/collections/mistralai/mistral-small-4

extent analysis

Fix Plan

To integrate Mistral Small 4 into your project, follow these steps:

  • Install the Hugging Face Transformers library: pip install transformers
  • Import the library and load the Mistral Small 4 model:
from transformers import AutoModelForCausalLM, AutoTokenizer

model_name = "mistralai/mistral-small-4"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)
  • Use the model for inference:
input_text = "Hello, world!"
inputs = tokenizer(input_text, return_tensors="pt")
output = model.generate(**inputs)
print(tokenizer.decode(output[0], skip_special_tokens=True))

Verification

Verify that the model is working correctly by checking the output of the inference example.

Extra Tips

  • Make sure to check the Hugging Face model hub for updates to the Mistral Small 4 model.
  • Consider using the torch library to optimize the model for your specific use case.
  • For more information on using the Hugging Face Transformers library, see the official documentation.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING