PRELIMINARY · benchmark figures are representative and may change before the public release.
MODEL CARD · OPEN WEIGHTS

Moondream 3.1 9B A2B

md-3.1-9b-a2b9B-A2B · MoEMOONDREAM LICENSE

Moondream 3.1 is an open-weight vision-language model built for engineers who need pixel-grounded answers, exact box, point, mask, or field they asked for. It has a sparse mixture-of-experts architecture with 9.0B total / 2.0B active per token, reads image + text into a 32K context, ships under Moondream License, runs on Transformers and Photon, and exposes five native skills: query, caption, detect, point, and segment. It also supports “grounded” reasoning (reasoning with special tokens that refer to 2D points in the image).

Parameters
2.0B active · 9.0B total
Modalities
image + text → text / coords / masks
Context
32,768 tok · 12 tiles
Runtimes
Transformers · Photon
Native skills
5 typed contracts
01 · MODEL FACTS

The instrument readout

rev md-3.1-9b-a2b-r20260628
Developer
Moondream · M87 Labs, Inc. (San Francisco, CA)
Release date
2026-07-07
Version / revision
3.1.0 · md-3.1-9b-a2b-r20260628
Architecture
SigLIP2 encoder → MoE decoder LM · 8 experts, top-2 routing, 1 shared expert
Parameters
2.0B active / token · 9.0B total · 24 layers · d_model 2048
Tokenizer
Custom byte-level BPE (md-tok v3) · 49,152 vocab · 64 reserved image tokens
Vision encoder
SigLIP2-so400m/14 · 384–1024 px · adaptive tiling up to 12 crops
Context length
32,768 text tokens · ≤ 12 image tiles (~2,304 vision tokens)
Input formats
PNG / JPEG / WebP (≤ 4096 px long edge) + UTF-8 text prompt
Output formats
UTF-8 text · JSON · normalized [0,1] coords · COCO-RLE masks
Precision
fp8 experts · fp16 attention & routing · single shipped build
Supported hardware
NVIDIA SM75+ (≥ 10 GB) · Apple Silicon (MLX) · x86/ARM CPU (GGUF)
Package versions
transformers ≥ 4.52 · moondream ≥ 0.3.0 (Photon)
Knowledge cutoff
Image + text training data through 2025-12

All revisions are immutable. Pin revision=md-3.1-9b-a2b-r20260628 in production; floating main may move.

02 · NATIVE SKILL CONTRACTS

Five typed contracts

Each skill has a fixed input and output contract, so you are not reverse-engineering a prompt. Coordinates are always normalized [0,1] from the top-left corner; multiply by the image width and height to get pixels back. Defaults below are greedy unless a row says otherwise.

query()Query

Open-ended question answering grounded in the image. The general-purpose entry point.

VQA
Input schema
query(
  image: Image,
  question: str,
  stream: bool = False,
  settings: {temperature, max_tokens}
) -> {answer}
Output schema
{
  "answer": str,        // free-form
  "request_id": str
}
Coordinate system
N/A · text answer only
Score / confidence
No calibrated confidence. Phrase questions to be verifiable.
Limits
One image / call (multi-image experimental). 32K ctx. No tool use.
Defaults
temperature 0.0 · max_tokens 768 · greedy
$ minimal example · python
res = model.query(img, "How many vehicles are on the road?")
print(res["answer"])   # -> "Four."
caption()Caption

Generate a description of the whole image at three densities.

DESCRIBE
Input schema
caption(
  image: Image,
  length: "short"|"normal"|"long" = "normal"
) -> {caption}
Output schema
{
  "caption": str
}
Coordinate system
N/A
Score / confidence
No confidence. "long" trades recall for higher hallucination risk.
Limits
Not grounded; do not parse captions for counts or coordinates.
Defaults
length "normal" · temperature 0.3 · max_tokens 256
$ minimal example · python
model.caption(img, length="short")["caption"]
# -> "An aerial view of a rural road with parked cars."
detect()Detect

Open-vocabulary object detection. Returns axis-aligned boxes for any phrase.

GROUNDING
Input schema
detect(
  image: Image,
  object: str,           // natural-language target
  threshold: float = 0.30
) -> {objects}
Output schema
{
  "objects": [
    {x_min, y_min, x_max, y_max,
     label: str, confidence: float}
  ]
}
Coordinate system
Normalized [0,1], origin TOP-LEFT, x→right, y→down. Multiply by W/H for pixels.
Score / confidence
confidence ∈ [0,1], sigmoid-calibrated. NMS @ IoU 0.50. Default cut 0.30.
Limits
≤ 200 boxes / call. Misses objects < 12 px on the long edge; merges adjacent identical instances.
Defaults
threshold 0.30 · max_objects 200 · greedy
$ minimal example · python
for o in model.detect(img, "the red car")["objects"]:
    print(o["confidence"], o["x_min"], o["y_min"])
point()Point

Locate the centroid of each matching instance. Cheaper than boxes and ideal for counting.

GROUNDING
Input schema
point(
  image: Image,
  object: str,
  max_points: int = 64
) -> {points}
Output schema
{
  "points": [ {x: float, y: float} ]
}
Coordinate system
Normalized [0,1] centroid, top-left origin. No size information.
Score / confidence
No per-point confidence; points are returned in salience order.
Limits
Ambiguous for mass nouns ("water"). ≤ 64 points. Centroid may fall outside concave shapes.
Defaults
max_points 64 · greedy
$ minimal example · python
pts = model.point(img, "each car")["points"]
print(len(pts), "instances")
segment()Segment

Instance segmentation: one binary mask per matching object.

GROUNDING
Input schema
segment(
  image: Image,
  object: str
) -> {masks}
Output schema
{
  "masks": [
    {rle: str, area: int,
     x_min, y_min, x_max, y_max, label}
  ]
}
Coordinate system
RLE encoded at encoder resolution (COCO format). bbox normalized [0,1]. Upsample RLE to source W/H.
Score / confidence
No mask confidence; filter by area to drop specks.
Limits
≤ 50 instances. Thin structures (cables, wires) and heavy occlusion under-segment.
Defaults
binary masks · min_area 16 px²
$ minimal example · python
m = model.segment(img, "the road")["masks"][0]
mask = rle_decode(m["rle"])   # HxW uint8
03 · EVALUATION MATRIX

Grouped by what you'll use it for

We grouped the benchmarks by what people actually use Moondream for, not by academic category. Each group spells out the resolution, decoding, and sample count we ran, plus a caveat that says where the number flatters or undersells real behavior. The Moondream 3.1 column is the model in question; the baselines (Qwen3.5 27B, Qwen3.5 9B, SAM 3, LocateAnything, Gemma 4 12B) ran under the same settings unless a note says otherwise.

↑ higher is better unless marked ↓ · detection metrics are F1@0.5 (mIoU where noted) · a blank cell (n/a) means the model cannot do that task · SAM 3 and LocateAnything are detection / segmentation specialists, not general VLMs.

Open-vocabulary detectiondetect() · F1@0.5 / mIoU
BenchmarkMoondream 3.1Qwen3.5 27BQwen3.5 9BSAM 3LocateAnythingGemma 4 12B
COCO (val)81.4676.7575.5877.0670.165.93
ODinW-13 (mini-val)93.9492.3791.9482.1684.3388.1
LVIS (val)67.473.871.1170.0162.357.93
CAVEATF1@0.5 / mIoU on open-vocabulary detection. SAM 3 and LocateAnything are detection / segmentation specialists; figures are like-for-like on the detection task only. Moondream leads COCO and ODinW-13; Qwen3.5 edges LVIS.
Dense detectiondetect() · crowded scenes · F1@0.5
BenchmarkMoondream 3.1Qwen3.5 27BQwen3.5 9BSAM 3LocateAnythingGemma 4 12B
Dense20074.6161.5948.23637415.96
SKU-110k (test)52.7726.3944.2733.9223.474.76
CrowdHuman74.577.7864.482.9171.2865.32
CAVEATDense, crowded scenes stress NMS and small-object recall. Moondream leads retail-shelf density (SKU-110k) and Dense200 by wide margins; SAM 3 leads person-dense CrowdHuman.
Referring detectiondetect() · phrase-grounded · F1@0.5
BenchmarkMoondream 3.1Qwen3.5 27BQwen3.5 9BSAM 3LocateAnythingGemma 4 12B
RefCOCO-M (val)87.188.7185.7383.746.2174.04
HumanRef (val)70.3988.4784.927.9482.5673.62
CAVEATRefCOCO-M is reported as F1@0.5; the mIoU figure is still pending. HumanRef stresses person-specific referring expressions, where pure detectors like SAM 3 fall off sharply.
Aerial detectiondetect() · oriented / small objects · F1@0.5
BenchmarkMoondream 3.1Qwen3.5 27BQwen3.5 9BSAM 3LocateAnythingGemma 4 12B
DOTA-v259.6355.4650.3626.0929.9438.36
CAVEATTop-down aerial imagery packs in many tiny, densely spaced, often rotated objects, which is about the hardest regime for a general VLM. Moondream leads the field here.
Countingpoint() · % correct
BenchmarkMoondream 3.1Qwen3.5 27BQwen3.5 9BSAM 3LocateAnythingGemma 4 12B
CountBench90.3596.194.6668.5883.7893.8
TallyQA (via query)74.8676.9772.22n/a65.7476.41
pixmo-count (val)88.6888.3988.6676.7787.5583.09
CAVEATCounting runs through point(), except TallyQA, which is answered with query(). A blank cell (n/a) means the task is not supported by that model. Accuracy still drops on very high counts.
Instruction followingquery() · % / score
BenchmarkMoondream 3.1Qwen3.5 27BQwen3.5 9BSAM 3LocateAnythingGemma 4 12B
IFBench (CoT)38.67n/a19.67n/an/a30.67
IFEval77.6382.0754.15n/an/a69.13
CAVEATSAM 3 and LocateAnything are detection-only, so they cannot run instruction-following (n/a). IFBench is reported with chain-of-thought decoding, which trades some instruction adherence for freer reasoning; that tension is not a Moondream-specific regression.
Mathquery() · % correct
BenchmarkMoondream 3.1Qwen3.5 27BQwen3.5 9BSAM 3LocateAnythingGemma 4 12B
GSM8K63n/a89.46n/an/a89.01
CAVEATText-heavy grade-school math is not a primary Moondream target; larger general LMs lead. Shown for transparency, not as a headline capability.
Visual understandingquery() · % / ANLS
BenchmarkMoondream 3.1Qwen3.5 27BQwen3.5 9BSAM 3LocateAnythingGemma 4 12B
ChartQA86.01n/a70.72n/an/a62.24
DocVQA88.6n/a92.94n/an/a81.94
CAVEATChart and document QA at native tiling. Moondream leads ChartQA by a wide margin; Qwen3.5 edges DocVQA. SAM 3 and LocateAnything do not do VQA (n/a).
OCRread_text() · score
BenchmarkMoondream 3.1Qwen3.5 27BQwen3.5 9BSAM 3LocateAnythingGemma 4 12B
OlmOCR32.37n/a33.1n/an/a13.51
CAVEATOlmOCR-bench is full-page document OCR. Moondream and Qwen3.5 land within a point of each other; SAM 3 and LocateAnything do not perform OCR (n/a).
04 · TRAINING & POST-TRAINING

What went in, and what didn't

We share enough to reason about coverage, bias, and freshness, but stop short of a recipe you could use to rebuild the model or pull training data back out. Exact mixture weights, licensed corpora, and internal filtering thresholds stay private.

Data sources

Publicly available web images with alt-text and captions, licensed image datasets, open academic detection/segmentation/VQA corpora (COCO, LVIS, Objects365, OpenImages, RefCOCO family, DocVQA, ChartQA and similar), and Moondream-generated synthetic grounding data. No customer or API-inference data is used for training.

Freshness / cutoff

Image + text data through May 2026. The model has no live knowledge of events, prices, or UI layouts that changed after that date and should not be relied on for current-affairs grounding.

Synthetic data

A substantial share of grounding supervision (boxes, points, masks, structured fields) is model-generated and then verified, both programmatically and by sampled human review. Synthetic data is the primary driver of the dense-detection and structured-output gains; it can also propagate systematic labeling conventions, which the limitations section names.

Human-labeled data

Human annotation is concentrated in evaluation sets, preference data for post-training, safety red-teaming, and quality audits of synthetic labels, not bulk box-drawing. Annotators worked under documented guidelines with fair-pay sourcing.

Post-training (SFT + RL)

Supervised fine-tuning on the five skill contracts, followed by reinforcement learning on verifiable tasks with a focus on detection F1 / IoU rewards, counting exactness, JSON-schema validity, and instruction-following adherence. RL targets task correctness and format compliance, not engagement or persuasion.

Harmful-content & PII filtering

Training images filtered for CSAM (hash-matching + classifiers), explicit and graphic-violence content, and detectable personal data (faces in sensitive contexts, ID documents, license plates where isolable). Filtering is imperfect; residual unsafe or identifying content may remain.

Deduplication

Near-duplicate images are removed with perceptual hashing and embedding-cluster dedup, and train/eval decontamination strips anything overlapping the public benchmarks above. Some leakage on web-scraped benchmark images is unavoidable, so treat single-point margins with caution.

Intentionally excluded

No biometric face-identity datasets, no medical imaging diagnostic corpora, no datasets built to recognize named private individuals, and no scraped behind-login or paywalled content. The model is deliberately not trained to identify specific people.

05 · LIMITATIONS & OUT-OF-SCOPE

Where it breaks, concretely

Worth reading before you ship. These are the failure modes we hit most often in evaluation and day-to-day use, written plainly so you can build guardrails around them.

Perception limits
  • Small text below ~10px at the tile resolution is frequently misread or skipped; up-res and crop the region first.
  • Tiny objects under ~12px on the long edge are missed by detect(); use point() on a cropped region.
  • Crowded scenes (> 50 instances) lose recall and merge adjacent identical objects; counts above ~50 are unreliable.
  • Thin structures (cables, wires, railings) under-segment.
Grounding & hallucination
  • Ambiguous pointing. For mass nouns ("water", "crowd") or vague phrases, point() returns whichever salient instance it likes.
  • OCR hallucination. On blurry, stylized, or partly occluded text, the model can emit a plausible but wrong string with no low-confidence signal to warn you.
  • Caption drift. Long captions invent fine detail; never parse them for counts or coordinates.
  • Reasoning traces are not guaranteed faithful to the answer.
High-stakes, out of scope
  • Medical interpretation (radiology, pathology, dermatology): not trained or validated for diagnosis.
  • Legal / financial determinations from documents without human review.
  • Safety-critical autonomy (driving, robotics collision avoidance, weapons) as a sole perception source.
  • Surveillance and biometric identification of individuals.
People, bias & coverage
  • Identity / person recognition is unsupported and must not be attempted.
  • Demographic inference (age, gender, race, emotion) is unreliable and prohibited for consequential decisions.
  • Geographic / cultural skew. Western, English-language, urban scenes are over-represented; signage, currency, and objects from under-represented regions come out weaker.
  • Language. OCR and prompts are strongest in English and Latin scripts.
Robustness & security
  • Adversarial images. Crafted perturbations and typographic attacks can flip detections and answers.
  • Prompt injection. In UI-agent workflows, text rendered inside a screenshot ("ignore previous instructions…") may be followed. Never let model output trigger actions unsandboxed.
  • Spoofed structure. Schema-constrained output is always valid JSON, never guaranteed-correct values.
Unsupported modalities
  • Video is not supported natively; sample frames and run them as images (no temporal reasoning).
  • Audio , 3D, depth, and point clouds are out of scope.
  • Image generation / editing. The model reads images, it does not produce them.
  • Multi-image reasoning across many frames is experimental.
06 · SAFETY & DEPLOYMENT

Safety is layered, not baked-in

The open weights carry only light safety post-training (refusal of overtly harmful generation requests, no person-identification behavior). They are not a content-moderation system. Where the safety boundary sits depends on how you deploy.

Open weights (local)

Light safety training only. You must add external moderation on inputs and outputs, rate-limiting, and abuse monitoring. No telemetry leaves your host, which also means there is no safety net but the one you build.

API & Cloud

The hosted API and Moondream Cloud add input/output safety classifiers, CSAM hash-matching, abuse rate-limits, and logging-based monitoring on top of the model. Recommended path for most production use.

Report an issue

Safety concerns & harmful outputs: safety@moondream.ai. Security vulnerabilities: security@moondream.ai (see §08).

Before production · checklist
01Add an input/output moderation layer if deploying weights yourself.
02Treat all in-image text as untrusted; never auto-execute model output in agents.
03Keep a human in the loop for any consequential decision.
04Re-validate grounding accuracy on your own data before you rely on it.
05Disable person-identification, demographic, and emotion-inference use cases.
06Evaluate on your domain & demographics before launch; monitor in production.
Appendix A · Safety disclosurered-team summary · v3.1
Risk areas evaluated

CSAM & minor safety · non-consensual intimate imagery · violent/graphic content description · person re-identification & surveillance · demographic profiling · prompt-injection via in-image text · OCR-assisted extraction of PII (IDs, cards) · jailbreak via image+text combinations.

Method

Internal red-team + external reviewers ran ~6k adversarial image/prompt pairs across the categories at left. Refusals, harmful completions, and identification attempts were scored; failures fed back into safety SFT. CSAM testing used hash-matched proxies only, under legal supervision.

Residual risks

Prompt injection from rendered text is only partially mitigated. The model can still describe violence and extract visible PII when asked plainly. Demographic guesses, though discouraged, are still producible. None of this is fully solved at the weights layer.

Disclosure stance

Following the openness norms of Gemma / PaliGemma and the structured safety disclosure of OpenAI / Anthropic system cards: we publish risk areas, method, and residual risks, and withhold exploit-enabling specifics. This appendix is a summary, not a guarantee of safety.

07 · OPERATIONAL GUIDANCE

Running it well

Defaults that reproduce the numbers above, plus the knobs that matter in production. Benchmark figures and settings are in the evaluation matrix (§03).

Recommended sampling
Skilltempmax_tokdecode
query0.0768greedy
caption0.3256sample
detect0.0200 boxgreedy
point0.064 ptgreedy
segment0.0n/agreedy
Grounding skills are deterministic (greedy); if you sample, the boxes jitter. Only caption really benefits from a temperature above zero.
Resolution & cropping

Default tiling adapts 384–1024px, up to 12 crops. Use 768px for VQA/caption, 1024px for detect/point/segment, 1536px for documents. For small targets, crop-then-call beats raising global resolution. Aspect ratio is preserved; extreme panoramas should be split.

Batching & caching

Throughput peaks around batch 8–16 on a single 24GB GPU at 768px. When you run several skills against one image, cache the vision-encoder output: it is the dominant cost and is reused across query, detect, and point on the same frame.

Precision & footprint

Moondream 3.1 ships as a single fp8 build: the mixture-of-experts weights are fp8, with the attention and routing layers kept in fp16 for stability. It fits in about 10 GB of VRAM with headroom for activations and KV cache. There are no separate int8, int4, or GGUF weight variants to pick between.

$ Photon · local inferenceRecommended
# pip install moondream
import moondream as md
from PIL import Image

# local=True runs Moondream on Photon — same API as Cloud
model = md.vl(api_key="YOUR_API_KEY", local=True)

image = Image.open("scene.jpg")
out = model.detect(image, "the red car")
print(out["objects"])   # [{x_min, y_min, x_max, y_max, ...}]
$ Transformers · pinned revision
from transformers import AutoModelForCausalLM
import torch

model = AutoModelForCausalLM.from_pretrained(
    "moondream/moondream-3.1-9b-a2b",
    revision="md-3.1-9b-a2b-r20260628",   # pin it
    trust_remote_code=True,
    torch_dtype=torch.bfloat16,
    device_map="cuda",
)
out = model.detect(image, "the red car")
print(out["objects"])   # [{x_min, y_min, ...}]
08 · GOVERNANCE

License, lineage & contact

Citation · BibTeX
@misc{moondream2026_31,
  title  = {Moondream 3.1: An open vision-
            language model for grounded
            visual reasoning},
  author = {Moondream and M87 Labs},
  year   = {2026},
  note   = {Model revision
            md-3.1-9b-a2b-r20260628},
  url    = {https://moondream.ai}
}
License
Released under the Moondream License. Review the full terms for what is permitted; you remain responsible for lawful, safe deployment.
Model lineage
moondream-2 (1.9B) → moondream-3.0 (9B MoE) → moondream-3.1 (9B-A2B)
encoder: SigLIP2-so400m/14 · tokenizer: md-tok v3
Contact & reporting
general  hello@moondream.ai
safety   safety@moondream.ai
security security@moondream.ai · 90-day disclosure
Known issues
  • Prompt injection from in-image text partially mitigated.
  • CrowdHuman / person-dense recall trails SAM 3.
  • GSM8K-style text math below peer LMs.
Changelog
  • 3.1 · better grounding, dense-detection gains.
  • 3.0 Preview · MoE decoder, 9B total, 2B Dense, added segment() skill
  • 2.x · dense model lineage, added point() skill
Deprecation policy
  • Revisions are immutable & remain downloadable indefinitely.
  • Hosted-API minor versions supported ≥ 12 months after a successor ships.
  • Breaking contract changes only on a major version, with migration notes.

Security vulnerabilities: disclose privately to security@moondream.ai (PGP on the site). Please allow a 90-day coordinated-disclosure window before public release.