Selecting the correct model format depends on your hardware capabilities and memory constraints.
BF16 (Brain Float 16) – Use if BF16 acceleration is available
A 16-bit floating-point format designed for faster computation while retaining good precision.
Provides similar dynamic range as FP32 but with lower memory usage.
Recommended if your hardware supports BF16 acceleration (check your device's specs).
Ideal for high-performance inference with reduced memory footprint compared to FP32.
📌 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.
F16 (Float 16) – More widely supported than BF16
A 16-bit floating-point high precision but with less of range of values than BF16.
Works on most devices with FP16 acceleration support (including many GPUs and some CPUs).
Slightly lower numerical precision than BF16 but generally sufficient for inference.
📌 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.
Hybrid Precision Models (e.g., bf16_q8_0, f16_q4_K) – Best of Both Worlds
These formats selectively quantize non-essential layers while keeping key layers in full precision (e.g., attention and output layers).
Named like bf16_q8_0 (meaning full-precision BF16 core layers + quantized Q8_0 other layers).
Strike a balance between memory efficiency and accuracy, improving over fully quantized models without requiring the full memory of BF16/F16.
📌 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).
Quantized Models (Q4_K, Q6_K, Q8, etc.) – For CPU & Low-VRAM Inference
Quantization reduces model size and memory usage while maintaining as much accuracy as possible.
Lower-bit models (Q4_K) → Best for minimal memory usage, may have lower precision.
Higher-bit models (Q6_K, Q8_0) → Better accuracy, requires more memory.
📌 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).
Very Low-Bit Quantization (IQ3_XS, IQ3_S, IQ3_M, Q4_K, Q4_0)
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.
Use case: Best for ultra-low-memory devices where even Q4_K is too large.
Trade-off: Lower accuracy compared to higher-bit quantizations.
IQ3_S: Small block size for maximum memory efficiency.
Use case: Best for low-memory devices where IQ3_XS is too aggressive.
IQ3_M: Medium block size for better accuracy than IQ3_S.
Use case: Suitable for low-memory devices where IQ3_S is too limiting.
Q4_K: 4-bit quantization with block-wise optimization for better accuracy.
Use case: Best for low-memory devices where Q6_K is too large.
Q4_0: Pure 4-bit quantization, optimized for ARM devices.
Use case: Best for ARM-based devices or low-memory environments.
*Ultra-low-bit quantization (1 2-bit) with extreme memory efficiency.
Use case: Best for cases were you have to fit the model into very constrained memory
Trade-off: Very Low Accuracy. May not function as expected. Please test fully before using.
Summary Table: Model Format Selection
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
Image description
SmolVLM-500M
SmolVLM-500M is a tiny multimodal model, member of the SmolVLM family. It accepts arbitrary sequences of image and text inputs to produce text outputs. It's designed for efficiency. SmolVLM can answer questions about images, describe visual content, or transcribe text. Its lightweight architecture makes it suitable for on-device applications while maintaining strong performance on multimodal tasks. It can run inference on one image with 1.23GB of GPU RAM.
Model Summary
Developed by: Hugging Face 🤗
Model type: Multi-modal model (image+text)
Language(s) (NLP): English
License: Apache 2.0
Architecture: Based on Idefics3 (see technical summary)
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.
SmolVLM leverages the lightweight SmolLM2 language model to provide a compact yet powerful multimodal experience. It introduces several changes compared to the larger SmolVLM 2.2B model:
Image compression: We introduce a more radical image compression compared to Idefics3 and SmolVLM-2.2B to enable the model to infer faster and use less RAM.
Visual Token Encoding: SmolVLM-256 uses 64 visual tokens to encode image patches of size 512×512. Larger images are divided into patches, each encoded separately, enhancing efficiency without compromising performance.
New special tokens: We added new special tokens to divide the subimages. This allows for more efficient tokenization of the images.
Smoller vision encoder: We went from a 400M parameter siglip vision encoder to a much smaller 93M encoder.
Larger image patches: We are now passing patches of 512x512 to the vision encoder, instead of 384x384 like the larger SmolVLM. This allows the information to be encoded more efficiently.
More details about the training and architecture are available in our technical report.
How to get started
You can use transformers to load, infer and fine-tune SmolVLM.
python
1import torch
2from PIL import Image
3from transformers import AutoProcessor, AutoModelForVision2Seq
4from transformers.image_utils import load_image
56DEVICE ="cuda"if torch.cuda.is_available()else"cpu"78# Load images9image = load_image("https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg")1011# Initialize processor and model12processor = AutoProcessor.from_pretrained("HuggingFaceTB/SmolVLM-500M-Instruct")13model = AutoModelForVision2Seq.from_pretrained(14"HuggingFaceTB/SmolVLM-500M-Instruct",15 torch_dtype=torch.bfloat16,16 _attn_implementation="flash_attention_2"if DEVICE =="cuda"else"eager",17).to(DEVICE)1819# Create input messages20messages =[21{22"role":"user",23"content":[24{"type":"image"},25{"type":"text","text":"Can you describe this image?"}26]27},28]2930# Prepare inputs31prompt = processor.apply_chat_template(messages, add_generation_prompt=True)32inputs = processor(text=prompt, images=[image], return_tensors="pt")33inputs = inputs.to(DEVICE)3435# Generate outputs36generated_ids = model.generate(**inputs, max_new_tokens=500)37generated_texts = processor.batch_decode(38 generated_ids,39 skip_special_tokens=True,40)4142print(generated_texts[0])43"""
44Assistant: The image depicts a cityscape featuring a prominent landmark, the Statue of Liberty, prominently positioned on Liberty Island. The statue is a green, humanoid figure with a crown atop its head and is situated on a small island surrounded by water. The statue is characterized by its large, detailed structure, with a statue of a woman holding a torch above her head and a tablet in her left hand. The statue is surrounded by a small, rocky island, which is partially visible in the foreground.
45In the background, the cityscape is dominated by numerous high-rise buildings, which are densely packed and vary in height. The buildings are primarily made of glass and steel, reflecting the sunlight and creating a bright, urban skyline. The skyline is filled with various architectural styles, including modern skyscrapers and older, more traditional buildings.
46The water surrounding the island is calm, with a few small boats visible, indicating that the area is likely a popular tourist destination. The water is a deep blue, suggesting that it is a large body of water, possibly a river or a large lake.
47In the foreground, there is a small strip of land with trees and grass, which adds a touch of natural beauty to the urban landscape. The trees are green, indicating that it is likely spring or summer.
48The image captures a moment of tranquility and reflection, as the statue and the cityscape come together to create a harmonious and picturesque scene. The statue's presence in the foreground draws attention to the city's grandeur, while the calm water and natural elements in the background provide a sense of peace and serenity.
49In summary, the image showcases the Statue of Liberty, a symbol of freedom and democracy, set against a backdrop of a bustling cityscape. The statue is a prominent and iconic representation of human achievement, while the cityscape is a testament to human ingenuity and progress. The image captures the beauty and complexity of urban life, with the statue serving as a symbol of hope and freedom, while the cityscape provides a glimpse into the modern world.
50"""
Model optimizations
Precision: For better performance, load and run the model in half-precision (torch.bfloat16) if your hardware supports it.
Vision Encoder Efficiency: Adjust the image resolution by setting size={"longest_edge": N*512} when initializing the processor, where N is your desired value. The default N=4 works well, which results in input images of
size 2048×2048. 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.
Misuse and Out-of-scope Use
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:
Prohibited Uses:
Evaluating or scoring individuals (e.g., in employment, education, credit)
Critical automated decision-making
Generating unreliable factual content
Malicious Activities:
Spam generation
Disinformation campaigns
Harassment or abuse
Unauthorized surveillance
License
SmolVLM is built upon SigLIP as image encoder and SmolLM2 for text decoder part.
We release the SmolVLM checkpoints under the Apache 2.0 license.
Training Details
Training Data
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.
Example Image
Citation information
You can cite us in the following way:
bibtex
1@article{marafioti2025smolvlm,
2 title={SmolVLM: Redefining small and efficient multimodal models},
3 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},
4 journal={arXiv preprint arXiv:2504.05299},
5 year={2025}
6}
🚀 If you find these models useful
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)
What I’m Testing
I’m pushing the limits of small open-source models for AI network monitoring, specifically:
Function calling against live network services
How small can a model go while still handling:
Automated Nmap security scans
Quantum-readiness checks
Network Monitoring tasks
🟡 TestLLM – Current experimental model (llama.cpp on 2 CPU threads on huggingface docker space):
✅ Zero-configuration setup
⏳ 30s load time (slow inference but no API costs) . No token limited as the cost is low.
🔧 Help wanted! If you’re into edge-device AI, let’s collaborate!
Other Assistants
🟢 TurboLLM – Uses gpt-4.1-mini :
**It performs very well but unfortunatly OpenAI charges per token. For this reason tokens usage is limited.
Create custom cmd processors to run .net code on Quantum Network Monitor Agents
Real-time network diagnostics and monitoring
Security Audits
Penetration testing (Nmap/Metasploit)
🔵 HugLLM – Latest Open-source models:
🌐 Runs on Hugging Face Inference API. Performs pretty well using the lastest models hosted on Novita.
💡 Example commands you could test:
"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"
'"Create a cmd processor to .. (what ever you want)" Note you need to install a Quantum Network Monitor Agent to run the .net code from. This is a very flexible and powerful feature. Use with caution!
Final Word
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.