Instructions to use Kiffaz11/ministral3-3b-reasoning-torchao-int4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Kiffaz11/ministral3-3b-reasoning-torchao-int4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Kiffaz11/ministral3-3b-reasoning-torchao-int4") 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("Kiffaz11/ministral3-3b-reasoning-torchao-int4") model = AutoModelForMultimodalLM.from_pretrained("Kiffaz11/ministral3-3b-reasoning-torchao-int4", 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 Kiffaz11/ministral3-3b-reasoning-torchao-int4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Kiffaz11/ministral3-3b-reasoning-torchao-int4" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Kiffaz11/ministral3-3b-reasoning-torchao-int4", "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/Kiffaz11/ministral3-3b-reasoning-torchao-int4
- SGLang
How to use Kiffaz11/ministral3-3b-reasoning-torchao-int4 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 "Kiffaz11/ministral3-3b-reasoning-torchao-int4" \ --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": "Kiffaz11/ministral3-3b-reasoning-torchao-int4", "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 "Kiffaz11/ministral3-3b-reasoning-torchao-int4" \ --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": "Kiffaz11/ministral3-3b-reasoning-torchao-int4", "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 Kiffaz11/ministral3-3b-reasoning-torchao-int4 with Docker Model Runner:
docker model run hf.co/Kiffaz11/ministral3-3b-reasoning-torchao-int4
Configuration Parsing Warning:In config.json: "quantization_config.modules_to_not_convert" must be an array
Ministral 3 3B Reasoning TorchAO INT4
This repository contains a TorchAO INT4 weight-only quantized checkpoint of:
mistralai/Ministral-3-3B-Reasoning-2512
Quantization summary
- Quantization backend: TorchAO
- Quantization type: INT4 weight-only
- Packing/layout used during working export:
Int4TilePackedTo4dTensor - Targeted modules: language model attention and MLP Linear layers
- Kept dense: embeddings, lm_head, vision tower, multimodal projector
- Final checkpoint size: ~2.656 GiB
- Original BF16 checkpoint size measured locally: ~14.339 GiB
- Checkpoint size reduction: ~81.48%
Smoke test result
Test problem:
Natalia sold clips to 48 of her friends in April, and then she sold half as many clips in May. How many clips did Natalia sell altogether in April and May?
Expected answer: 72
Results:
| Model | Parsed answer | Correct |
|---|---|---|
| Original BF16 | 72 | yes |
| TorchAO INT4 | 72 | yes |
Local benchmark summary
| Metric | Original BF16 | TorchAO INT4 |
|---|---|---|
| Checkpoint size GiB | 14.3391 | 2.6557 |
| Load time seconds | 6.9686 | 9.8574 |
| Generation latency seconds | 1.0092 | 1.0404 |
| Generated tok/s | 64.4074 | 53.8238 |
| Total tok/s including prompt | 165.4775 | 151.8600 |
| Peak VRAM allocated GiB | 15.9948 | 11.4769 |
| Peak VRAM reserved GiB | 16.0820 | 14.9023 |
| CPU RSS after load GiB | 8.0434 | 8.0436 |
Notes
This checkpoint is intended as a TorchAO quantized research artifact. The first validation target was successful reload, reduced checkpoint size, lower VRAM allocation, and correctness on a smoke arithmetic task.
The quantized model may not be faster than BF16 on every GPU/backend. For this checkpoint, the main gain is storage and allocated VRAM reduction.
- Downloads last month
- 5
Model tree for Kiffaz11/ministral3-3b-reasoning-torchao-int4
Base model
mistralai/Ministral-3-3B-Base-2512