gatilin/nanoVLM-222M-webui
0
nanoVLM-222M Web UI
A Hugging Face Spaces deployment of nanoVLM-222M β a lightweight 222M parameter Vision-Language Model built in pure PyTorch.
π Live Demo: Hugging Face Spaces
Model Overview
Features
- πΌοΈ Image Upload β Drag & drop or click to upload images
- π¬ Interactive Chat β Multi-turn conversation with image context
- β‘ Fast Inference β Optimized for CPU and GPU with KV-cache
- ποΈ Generation Controls β Adjust temperature, top-k, top-p, max tokens
- π± Mobile Friendly β Responsive Gradio interface
Local Development
Setup
# Clone the repository
git clone https://huggingface.co/spaces/gatilin/nanoVLM-222M-webui
cd nanoVLM-222M-webui
# Install dependencies
pip install -r requirements.txt
# Launch the app
python app.pyDocker
docker build -t nanovlm-webui .
docker run -p 7860:7860 nanovlm-webuiUsage
Web Interface
- Upload an image (JPG, PNG, WEBP, HEIC supported)
- Type your question about the image
- Click Send or press Enter
- Adjust generation parameters in the sidebar for different outputs
API
import gradio_client
client = gradio_client.Client("gatilin/nanoVLM-222M-webui")
result = client.predict(
image="path/to/image.jpg",
prompt="What is in this image?",
temperature=0.7,
max_new_tokens=200
)
print(result)Architecture
nanoVLM-222M
βββ Vision Encoder (SigLIP-B/16)
β βββ Patch Embeddings β ViT Blocks β Layer Norm
βββ Modality Projector
β βββ Pixel Shuffle β Linear Projection
βββ Language Decoder (SmolLM2-135M)
βββ Token Embeddings + Image Embeddings
βββ RoPE + RMSNorm + GQA Attention
βββ Causal LM Head β Autoregressive GenerationCitation
@misc{wiedmann2025nanovlm,
author = {Luis Wiedmann and Aritra Roy Gosthipaty and AndrΓ©s Marafioti},
title = {nanoVLM},
year = {2025},
publisher = {GitHub},
howpublished = {\url{https://github.com/huggingface/nanoVLM}}
}License
Apache-2.0
