Instructions to use nassimjp/Ministral-3-8B-Reasoning-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nassimjp/Ministral-3-8B-Reasoning-4bit with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="nassimjp/Ministral-3-8B-Reasoning-4bit") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("nassimjp/Ministral-3-8B-Reasoning-4bit") model = AutoModelForMultimodalLM.from_pretrained("nassimjp/Ministral-3-8B-Reasoning-4bit", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use nassimjp/Ministral-3-8B-Reasoning-4bit with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "nassimjp/Ministral-3-8B-Reasoning-4bit" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nassimjp/Ministral-3-8B-Reasoning-4bit", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/nassimjp/Ministral-3-8B-Reasoning-4bit
- SGLang
How to use nassimjp/Ministral-3-8B-Reasoning-4bit with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "nassimjp/Ministral-3-8B-Reasoning-4bit" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nassimjp/Ministral-3-8B-Reasoning-4bit", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "nassimjp/Ministral-3-8B-Reasoning-4bit" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nassimjp/Ministral-3-8B-Reasoning-4bit", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use nassimjp/Ministral-3-8B-Reasoning-4bit with Docker Model Runner:
docker model run hf.co/nassimjp/Ministral-3-8B-Reasoning-4bit
Model Card for Ministral-3-8B-Reasoning-4bit
Ministral-3-8B-Reasoning-4bit is a 4-bit quantized version of the Mistral-3-8B-Reasoning model, optimized using bitsandbytes for efficient inference while retaining its core reasoning capabilities, multi-language processing, and performance on standard hardware.
Model Details
- Model Architecture: Mistral-3-8B-Reasoning
- Precision: 4-bit (NF4 / bitsandbytes)
- Format: Safetensors (sharded into 2 parts)
- Library: Transformers / Hugging Face
- Original Model Owner: nassimjp
Quantization & Efficiency
This model has been quantized down to 4-bit precision, significantly reducing VRAM requirements (running efficiently under ~6 GB VRAM), making it ideal for consumer GPUs and resource-constrained deployment environments without sacrificing its fundamental reasoning and structural integrity.
Usage Example
You can load and use this model easily with the Hugging Face transformers and bitsandbytes libraries:
import torch
from transformers import AutoTokenizer, Mistral3ForConditionalGeneration
MODEL_ID = "nassimjp/Ministral-3-8B-Reasoning-4bit"
print("Loading tokenizer and 4-bit model...")
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID, trust_remote_code=True)
model = Mistral3ForConditionalGeneration.from_pretrained(
MODEL_ID,
device_map="auto",
trust_remote_code=True
)
# Example prompt
messages = [
{
"role": "user",
"content": "Hello! Can you briefly explain what reasoning models are?"
}
]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=300,
do_sample=True,
temperature=0.7,
top_p=0.9,
)
response = tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True)
print(response)
Files Provided
model-00001-of-00002.safetensors(3.98 GB)model-00002-of-00002.safetensors(2.22 GB)config.json&generation_config.jsontokenizer.json&chat_template.jinja
Acknowledgments
Optimized and published by nassimjp.
- Downloads last month
- 13