Downloads · 30 days
2M
5% of all-time downloads
vikhyatk/moondream2
moondream2 is a image-text-to-text model from vikhyatk. 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 repository contains the latest version of Moondream 2, our previous generation model. The latest version of Moondream is Moondream 3 (Preview).
Downloads · 30 days
2M
5% of all-time downloads
All-time downloads
38.3M
Public
Parameters
1.9B
130 GB on disk
Likes
1.4K
Public
Click a slice to open those files.
.safetensors3.9 GB · 100%
From the Hugging Face model README
⚠️ This repository contains the latest version of Moondream 2, our previous generation model. The latest version of Moondream is Moondream 3 (Preview).
Moondream is a small vision language model designed to run efficiently everywhere.
This repository contains the latest (2025-06-21) release of Moondream 2, as well as historical releases. The model is updated frequently, so we recommend specifying a revision as shown below if you're using it in a production application.
from transformers import AutoModelForCausalLM, AutoTokenizer
from PIL import Image
model = AutoModelForCausalLM.from_pretrained(
"vikhyatk/moondream2",
revision="2025-06-21",
trust_remote_code=True,
device_map={"": "cuda"} # ...or 'mps', on Apple Silicon
)
# Captioning
print("Short caption:")
print(model.caption(image, length="short")["caption"])
print("\nNormal caption:")
for t in model.caption(image, length="normal", stream=True)["caption"]:
# Streaming generation example, supported for caption() and detect()
print(t, end="", flush=True)
print(model.caption(image, length="normal"))
# Visual Querying
print("\nVisual query: 'How many people are in the image?'")
print(model.query(image, "How many people are in the image?")["answer"])
# Object Detection
print("\nObject detection: 'face'")
objects = model.detect(image, "face")["objects"]
print(f"Found {len(objects)} face(s)")
# Pointing
print("\nPointing: 'person'")
points = model.point(image, "person")["points"]
print(f"Found {len(points)} person(s)")
2025-06-21 (full release notes)
reasoning=True in the query skill to trade off speed vs. accuracy.2025-04-15 (full release notes)
2025-03-27 (full release notes)
compile() now supported in HF Transformers implementation