Downloads ยท 30 days
606
9% of all-time downloads
Mungert/SmolVLM-Instruct-GGUF
SmolVLM-Instruct-GGUF is a image-text-to-text model from Mungert. Use it for the image-text-to-text task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as apache-2.0.
This model was generated using llama.cpp at commit 5787b5da.
Downloads ยท 30 days
606
9% of all-time downloads
All-time downloads
6.8K
Public
Repo size
39.4 GB
Likes
2
Public
Click a slice to open those files.
.gguf35.3 GB ยท 90%
From the Hugging Face model README
This model was generated using llama.cpp at commit 5787b5da.
Testing a new quantization method using rules to bump important layers above what the standard imatrix would use.
I have found that the standard IMatrix does not perform very well at low bit quantiztion and for MOE models. So I am using llama.cpp --tensor-type to bump up selected layers. See Layer bumping with llama.cpp
This does create larger model files but increases precision for a given model size.
Selecting the correct model format depends on your hardware capabilities and memory constraints.
๐ Use BF16 if:
โ Your hardware has native BF16 support (e.g., newer GPUs, TPUs).
โ You want higher precision while saving memory.
โ You plan to requantize the model into another format.
๐ Avoid BF16 if:
โ Your hardware does not support BF16 (it may fall back to FP32 and run slower).
โ You need compatibility with older devices that lack BF16 optimization.
๐ Use F16 if:
โ Your hardware supports FP16 but not BF16.
โ You need a balance between speed, memory usage, and accuracy.
โ You are running on a GPU or another device optimized for FP16 computations.
๐ Avoid F16 if:
โ Your device lacks native FP16 support (it may run slower than expected).
โ You have memory limitations.
bf16_q8_0, f16_q4_K) โ Best of Both WorldsThese formats selectively quantize non-essential layers while keeping key layers in full precision (e.g., attention and output layers).
bf16_q8_0 (meaning full-precision BF16 core layers + quantized Q8_0 other layers).๐ Use Hybrid Models if:
โ You need better accuracy than quant-only models but canโt afford full BF16/F16 everywhere.
โ Your device supports mixed-precision inference.
โ You want to optimize trade-offs for production-grade models on constrained hardware.
๐ Avoid Hybrid Models if:
โ Your target device doesnโt support mixed or full-precision acceleration.
โ You are operating under ultra-strict memory limits (in which case use fully quantized formats).
Quantization reduces model size and memory usage while maintaining as much accuracy as possible.
๐ Use Quantized Models if:
โ You are running inference on a CPU and need an optimized model.
โ Your device has low VRAM and cannot load full-precision models.
โ You want to reduce memory footprint while keeping reasonable accuracy.
๐ Avoid Quantized Models if:
โ You need maximum accuracy (full-precision models are better for this).
โ Your hardware has enough VRAM for higher-precision formats (BF16/F16).
These models are optimized for very high memory efficiency, making them ideal for low-power devices or large-scale deployments where memory is a critical constraint.
IQ3_XS: Ultra-low-bit quantization (3-bit) with very high memory efficiency.
IQ3_S: Small block size for maximum memory efficiency.
IQ3_M: Medium block size for better accuracy than IQ3_S.
Q4_K: 4-bit quantization with block-wise optimization for better accuracy.
Q4_0: Pure 4-bit quantization, optimized for ARM devices.
| Model Format | Precision | Memory Usage | Device Requirements | Best Use Case |
|---|---|---|---|---|
| BF16 | Very High | High | BF16-supported GPU/CPU | High-speed inference with reduced memory |
| F16 | High | High | FP16-supported GPU/CPU | Inference when BF16 isnโt available |
| Q4_K | Medium-Low | Low | CPU or Low-VRAM devices | Memory-constrained inference |
| Q6_K | Medium | Moderate | CPU with more memory | Better accuracy with quantization |
| Q8_0 | High | Moderate | GPU/CPU with moderate VRAM | Highest accuracy among quantized models |
| IQ3_XS | Low | Very Low | Ultra-low-memory devices | Max memory efficiency, low accuracy |
| IQ3_S | Low | Very Low | Low-memory devices | Slightly more usable than IQ3_XS |
| IQ3_M | Low-Medium | Low | Low-memory devices | Better accuracy than IQ3_S |
| Q4_0 | Low | Low | ARM-based/embedded devices | Llama.cpp automatically optimizes for ARM inference |
| Ultra Low-Bit (IQ1/2_*) | Very Low | Extremely Low | Tiny edge/embedded devices | Fit models in extremely tight memory; low accuracy |
Hybrid (e.g., bf16_q8_0) | MediumโHigh | Medium | Mixed-precision capable hardware | Balanced performance and memory, near-FP accuracy in critical layers |
SmolVLM is a compact open multimodal model that accepts arbitrary sequences of image and text inputs to produce text outputs. Designed for efficiency, SmolVLM can answer questions about images, describe visual content, create stories grounded on multiple images, or function as a pure language model without visual inputs. Its lightweight architecture makes it suitable for on-device applications while maintaining strong performance on multimodal tasks.
SmolVLM can be used for inference on multimodal (image + text) tasks where the input comprises text queries along with one or more images. Text and images can be interleaved arbitrarily, enabling tasks like image captioning, visual question answering, and storytelling based on visual content. The model does not support image generation.
To fine-tune SmolVLM on a specific task, you can follow the fine-tuning tutorial.
<!-- todo: add link to fine-tuning tutorial -->SmolVLM leverages the lightweight SmolLM2 language model to provide a compact yet powerful multimodal experience. It introduces several changes compared to previous Idefics models:
More details about the training and architecture are available in our technical report.
You can use transformers to load, infer and fine-tune SmolVLM.
import torch
from PIL import Image
from transformers import AutoProcessor, AutoModelForVision2Seq
from transformers.image_utils import load_image
DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
# Load images
image1 = load_image("https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg")
image2 = load_image("https://huggingface.co/spaces/merve/chameleon-7b/resolve/main/bee.jpg")
# Initialize processor and model
processor = AutoProcessor.from_pretrained("HuggingFaceTB/SmolVLM-Instruct")
model = AutoModelForVision2Seq.from_pretrained(
"HuggingFaceTB/SmolVLM-Instruct",
torch_dtype=torch.bfloat16,
_attn_implementation="flash_attention_2" if DEVICE == "cuda" else "eager",
).to(DEVICE)
# Create input messages
messages = [
{
"role": "user",
"content": [
{"type": "image"},
{"type": "image"},
{"type": "text", "text": "Can you describe the two images?"}
]
},
]
# Prepare inputs
prompt = processor.apply_chat_template(messages, add_generation_prompt=True)
inputs = processor(text=prompt, images=[image1, image2], return_tensors="pt")
inputs = inputs.to(DEVICE)
# Generate outputs
generated_ids = model.generate(**inputs, max_new_tokens=500)
generated_texts = processor.batch_decode(
generated_ids,
skip_special_tokens=True,
)
print(generated_texts[0])
"""
Assistant: The first image shows a green statue of the Statue of Liberty standing on a stone pedestal in front of a body of water.
The statue is holding a torch in its right hand and a tablet in its left hand. The water is calm and there are no boats or other objects visible.
The sky is clear and there are no clouds. The second image shows a bee on a pink flower.
The bee is black and yellow and is collecting pollen from the flower. The flower is surrounded by green leaves.
"""
Precision: For better performance, load and run the model in half-precision (torch.float16 or torch.bfloat16) if your hardware supports it.
from transformers import AutoModelForVision2Seq
import torch
model = AutoModelForVision2Seq.from_pretrained(
"HuggingFaceTB/SmolVLM-Instruct",
torch_dtype=torch.bfloat16
).to("cuda")
You can also load SmolVLM with 4/8-bit quantization using bitsandbytes, torchao or Quanto. Refer to this page for other options.
from transformers import AutoModelForVision2Seq, BitsAndBytesConfig
import torch
quantization_config = BitsAndBytesConfig(load_in_8bit=True)
model = AutoModelForVision2Seq.from_pretrained(
"HuggingFaceTB/SmolVLM-Instruct",
quantization_config=quantization_config,
)
Vision Encoder Efficiency: Adjust the image resolution by setting size={"longest_edge": N*384} when initializing the processor, where N is your desired value. The default N=4 works well, which results in input images of
size 1536ร1536. For documents, N=5 might be beneficial. Decreasing N can save GPU memory and is appropriate for lower-resolution images. This is also useful if you want to fine-tune on videos.
SmolVLM is not intended for high-stakes scenarios or critical decision-making processes that affect an individual's well-being or livelihood. The model may produce content that appears factual but may not be accurate. Misuse includes, but is not limited to:
SmolVLM is built upon the shape-optimized SigLIP as image encoder and SmolLM2 for text decoder part.
We release the SmolVLM checkpoints under the Apache 2.0 license.
The training data comes from The Cauldron and Docmatix datasets, with emphasis on document understanding (25%) and image captioning (18%), while maintaining balanced coverage across other crucial capabilities like visual reasoning, chart comprehension, and general instruction following. <img src="https://huggingface.co/HuggingFaceTB/SmolVLM-Instruct/resolve/main/mixture_the_cauldron.png" alt="Example Image" style="width:90%;" />
| Model | MMMU (val) | MathVista (testmini) | MMStar (val) | DocVQA (test) | TextVQA (val) | Min GPU RAM required (GB) |
|---|---|---|---|---|---|---|
| SmolVLM | 38.8 | 44.6 | 42.1 | 81.6 | 72.7 | 5.02 |
| Qwen-VL 2B | 41.1 | 47.8 | 47.5 | 90.1 | 79.7 | 13.70 |
| InternVL2 2B | 34.3 | 46.3 | 49.8 | 86.9 | 73.4 | 10.52 |
| PaliGemma 3B 448px | 34.9 | 28.7 | 48.3 | 32.2 | 56.0 | 6.72 |
| moondream2 | 32.4 | 24.3 | 40.3 | 70.5 | 65.2 | 3.87 |
| MiniCPM-V-2 | 38.2 | 39.8 | 39.1 | 71.9 | 74.1 | 7.88 |
| MM1.5 1B | 35.8 | 37.2 | 0.0 | 81.0 | 72.5 | NaN |
You can cite us in the following way:
@article{marafioti2025smolvlm,
title={SmolVLM: Redefining small and efficient multimodal models},
author={Andrรฉs Marafioti and Orr Zohar and Miquel Farrรฉ and Merve Noyan and Elie Bakouch and Pedro Cuenca and Cyril Zakka and Loubna Ben Allal and Anton Lozhkov and Nouamane Tazi and Vaibhav Srivastav and Joshua Lochner and Hugo Larcher and Mathieu Morlon and Lewis Tunstall and Leandro von Werra and Thomas Wolf},
journal={arXiv preprint arXiv:2504.05299},
year={2025}
}
Help me test my AI-Powered Quantum Network Monitor Assistant with quantum-ready security checks:
The full Open Source Code for the Quantum Network Monitor Service available at my github repos ( repos with NetworkMonitor in the name) : Source Code Quantum Network Monitor. You will also find the code I use to quantize the models if you want to do it yourself GGUFModelBuilder
๐ฌ How to test:
Choose an AI assistant type:
TurboLLM (GPT-4.1-mini)HugLLM (Hugginface Open-source models)TestLLM (Experimental CPU-only)Iโm pushing the limits of small open-source models for AI network monitoring, specifically:
๐ก TestLLM โ Current experimental model (llama.cpp on 2 CPU threads on huggingface docker space):
๐ข TurboLLM โ Uses gpt-4.1-mini :
๐ต HugLLM โ Latest Open-source models:
"Give me info on my websites SSL certificate""Check if my server is using quantum safe encyption for communication""Run a comprehensive security audit on my server"I fund the servers used to create these model files, run the Quantum Network Monitor service, and pay for inference from Novita and OpenAIโall out of my own pocket. All the code behind the model creation and the Quantum Network Monitor project is open source. Feel free to use whatever you find helpful.
If you appreciate the work, please consider buying me a coffee โ. Your support helps cover service costs and allows me to raise token limits for everyone.
I'm also open to job opportunities or sponsorship.
Thank you! ๐