Instructions to use vikhyatk/moondream2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use vikhyatk/moondream2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="vikhyatk/moondream2", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("vikhyatk/moondream2", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use vikhyatk/moondream2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "vikhyatk/moondream2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "vikhyatk/moondream2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/vikhyatk/moondream2
- SGLang
How to use vikhyatk/moondream2 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 "vikhyatk/moondream2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "vikhyatk/moondream2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "vikhyatk/moondream2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "vikhyatk/moondream2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use vikhyatk/moondream2 with Docker Model Runner:
docker model run hf.co/vikhyatk/moondream2
Release version 2025-06-21
Browse files- README.md +6 -2
- versions.txt +1 -0
README.md
CHANGED
|
@@ -7,7 +7,7 @@ Moondream is a small vision language model designed to run efficiently everywher
|
|
| 7 |
|
| 8 |
[Website](https://moondream.ai/) / [Demo](https://moondream.ai/playground) / [GitHub](https://github.com/vikhyat/moondream)
|
| 9 |
|
| 10 |
-
This repository contains the latest (**2025-
|
| 11 |
|
| 12 |
|
| 13 |
### Usage
|
|
@@ -18,7 +18,7 @@ from PIL import Image
|
|
| 18 |
|
| 19 |
model = AutoModelForCausalLM.from_pretrained(
|
| 20 |
"vikhyatk/moondream2",
|
| 21 |
-
revision="2025-
|
| 22 |
trust_remote_code=True,
|
| 23 |
# Uncomment to run on GPU.
|
| 24 |
# device_map={"": "cuda"}
|
|
@@ -51,6 +51,10 @@ print(f"Found {len(points)} person(s)")
|
|
| 51 |
|
| 52 |
### Changelog
|
| 53 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
**2025-04-15** ([full release notes](https://moondream.ai/blog/moondream-2025-04-14-release))
|
| 55 |
|
| 56 |
1. Improved chart understanding (ChartQA up from 74.8 to 77.5, 82.2 with PoT)
|
|
|
|
| 7 |
|
| 8 |
[Website](https://moondream.ai/) / [Demo](https://moondream.ai/playground) / [GitHub](https://github.com/vikhyat/moondream)
|
| 9 |
|
| 10 |
+
This repository contains the latest (**2025-06-21**) release of Moondream, as well as [historical releases](https://huggingface.co/vikhyatk/moondream2/blob/main/versions.txt). The model is updated frequently, so we recommend specifying a revision as shown below if you're using it in a production application.
|
| 11 |
|
| 12 |
|
| 13 |
### Usage
|
|
|
|
| 18 |
|
| 19 |
model = AutoModelForCausalLM.from_pretrained(
|
| 20 |
"vikhyatk/moondream2",
|
| 21 |
+
revision="2025-06-21",
|
| 22 |
trust_remote_code=True,
|
| 23 |
# Uncomment to run on GPU.
|
| 24 |
# device_map={"": "cuda"}
|
|
|
|
| 51 |
|
| 52 |
### Changelog
|
| 53 |
|
| 54 |
+
**2025-06-21**
|
| 55 |
+
|
| 56 |
+
(release notes coming soon)
|
| 57 |
+
|
| 58 |
**2025-04-15** ([full release notes](https://moondream.ai/blog/moondream-2025-04-14-release))
|
| 59 |
|
| 60 |
1. Improved chart understanding (ChartQA up from 74.8 to 77.5, 82.2 with PoT)
|
versions.txt
CHANGED
|
@@ -9,3 +9,4 @@
|
|
| 9 |
2025-01-09
|
| 10 |
2025-03-27
|
| 11 |
2025-04-14
|
|
|
|
|
|
| 9 |
2025-01-09
|
| 10 |
2025-03-27
|
| 11 |
2025-04-14
|
| 12 |
+
2025-06-21
|