Moondream 2

MOONDREAM2

Moondream 2 is a small vision model: it answers questions about a picture, writes short, normal or long captions and finds the objects you name, returning boxes or points. Questions are in English.

Vision & Analysisvision-languagecaptioningvisual-question-answeringobject-detectionpointingenglishmoondreamapache-2.0Fine-tunable
Moondream 2: Vision & Analysis model on Kainguru

About Moondream 2

Capabilities

  • Ask about a picture — a question in English, answered in a word, a sentence or a paragraph
  • Captions — short, normal or long descriptions of the whole picture
  • Find objects — name an object and get boxes or points, as fractions of the picture's width and height
  • Fine-tuning — teach it your own questions and captions with your pictures

Good to know

  • Pictures are JPEG, PNG or WebP, at most 20 MB and 40 megapixels each, at least 16 pixels a side and at most 20 times wider than tall; larger pictures are scaled down to about 2 megapixels first, and the model looks at a picture as one overview and up to 12 crops of 378 pixels.
  • One picture a request, and a task: query (the default) answers the question in prompt, caption writes a short, normal or long caption (prompt is not used), detect and point find the object named in prompt (at most 50 of them) and return boxes or points as fractions of the picture's width and height.
  • The question or the object is at most 1,000 characters and 512 tokens, in English; the answer is at most 1,024 tokens, and the model's window of 2,048 tokens, 730 of them the picture, is the other limit. The picture's 730 tokens are billed as input tokens; each object found counts 3 output tokens (a point 2).
  • Fine-tuning data is a JSONL manifest plus the pictures it names, or one ZIP holding both: 4 to 5,000 lines, each {"file": ..., "prompt": ..., "response": ...} for a question or {"file": ..., "task": "caption", "length": "normal", "response": ...} for a caption, prompt and response at most 32,768 characters each.
  • Uploaded one by one, the dataset is at most 1000 files and 4 GB in all, the manifests at most 64 MB, and each "file" is the URL or name the picture's upload returned (such as 0192f3c4-7e1a-7c2b-9d5e-1f2a3b4c5d6e.png), never the name it had on your computer.
  • As a ZIP, it is at most 4 GB and 10,000 entries without a password and holds exactly one .jsonl (or .ndjson) manifest; picture paths are relative to that manifest, and files it does not name, .json files included, are ignored.
  • Every training picture is checked as for a run. An example's picture, prompt and answer are at most 2,048 tokens, 730 of them the picture: an answer is cut to what is left, and at most 1,024 answer tokens are learned. If a prompt alone leaves no room, the whole fine-tune is refused, naming that line.
  • A fine-tuned model answers questions and writes captions; detect and point are for the base model.
  • Training stops after 9 hours or 5,000 steps of 8 examples, whichever comes first, and keeps what it learned.

Moondream 2 inputs and output

NameTypeRequiredDefaultDetails
imagefileYes—One picture: JPEG, PNG or WebP, at most 20 MB and 40 megapixels.
Max 2048 characters · image/jpeg, png, webp
top_pnumberNo0.3Sample only from the most likely tokens whose probabilities add up to this.
0–1
prompttextNo—For query, your question, in English; for detect and point, the object to find, such as car or red mug. Not used by caption.
Max 1000 characters
tasktextNoqueryquery answers the question in prompt, caption describes the picture, detect and point find the object named in prompt and return boxes or points.
Allowed: query, caption, detect, point
temperaturenumberNo0.5Randomness of the answer; 0 always picks the most likely next token.
0–2
lengthtextNonormalFor caption: short, normal or long. Ignored by the other tasks.
Allowed: short, normal, long
seedintegerNo—The same seed and inputs give the same answer.
0–4294967295
max_new_tokensintegerNo256The most tokens the answer or caption may have; the model's 2,048-token window, 730 of which are the picture, is the other limit.
1–1024
max_objectsintegerNo50For detect and point: the most objects to return.
1–50

Output. JSON: text is the answer or caption; for detect and point it is the JSON of the boxes (x_min, y_min, x_max, y_max) or points (x, y), as fractions of the picture's size. Token counts.

Run Moondream 2 with the API

Send your API key in the X-API-Key header. The run is asynchronous: submit it, then poll it until it finishes. Create an API key.

cURL
curl -X POST "https://api.kainguru.com/api/v1/executions?mlFlowId=MOONDREAM2" \
  -H "X-API-Key: kg_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "input": {
    "image": "https://example.com/input.png",
    "length": "normal",
    "max_new_tokens": 256,
    "max_objects": 50,
    "task": "query",
    "temperature": 0.5,
    "top_p": 0.3
  },
  "outputFormat": "json"
}'

# Poll until the execution reaches a terminal state
curl "https://api.kainguru.com/api/v1/executions/{executionId}" \
  -H "X-API-Key: kg_your_api_key"
Python
from kainguru import KainguruClient

with KainguruClient(api_key="kg_your_api_key", base_url="https://api.kainguru.com/api") as client:
    submitted = client.executions.execute(
        "MOONDREAM2",
        {
          "image": "https://example.com/input.png",
          "length": "normal",
          "max_new_tokens": 256,
          "max_objects": 50,
          "task": "query",
          "temperature": 0.5,
          "top_p": 0.3
        },
        output_format="json",
    )
    result = client.executions.await_completion(submitted.id)
    print(result.execution.output)

Fine-tune Moondream 2

You can fine-tune Moondream 2 on your own data and run the tuned model through the same API. Dataset: A JSONL manifest plus its pictures, or one ZIP with both: one {"file", "prompt", "response"} per line (or a caption), 4 to 5,000 lines, 4 GB in all. More rules: Good to know, in the README.

The steps are in the docs.

Moondream 2 pricing

Price per 1M tokens: 1748 credits ($17.48). The price is shown again before every run; all prices are on the pricing page.

Licence and source

Qwen3-VL 8B Instruct: Vision & Analysis model on Kainguru
Vision & Analysis

Qwen3-VL 8B Instruct

Qwen3-VL 8B Instruct answers questions about up to four pictures: it describes photos, reads printed and handwritten…

Fine-tunable
Florence-2 Large: Vision & Analysis model on Kainguru
Vision & Analysis

Florence-2 Large

One small vision model that captions images, reads text, boxes objects and finds things named by a phrase.

Fine-tunable
Docling Layout Heron: Vision & Analysis model on Kainguru
Vision & Analysis

Docling Layout Heron

Finds the layout of a document page, such as text blocks, titles, section headers, tables, pictures, captions…

Fine-tunable
Granite Vision 3.3 2B: Vision & Analysis model on Kainguru
Vision & Analysis

Granite Vision 3.3 2B

IBM Granite Vision 3.3 2B reads documents in pictures: it answers questions about tables, charts, infographics, forms…

Fine-tunable
Grounding DINO Base: Vision & Analysis model on Kainguru
Vision & Analysis

Grounding DINO Base

Finds the things you name in a picture, such as "red car, person with a helmet", and returns a box around each one.

Fine-tunable
OWLv2 Base: Vision & Analysis model on Kainguru
Vision & Analysis

OWLv2 Base

Finds the things you name in a picture, even rare or unusual ones, and returns a box around each one.

Fine-tunable