moondream3.1-9B-A2B
Image-to-Text • MoondreamMoondream 3 is a fast, efficient 9B mixture-of-experts vision language model (2B active parameters) that delivers frontier-level visual reasoning for tasks like object detection, pointing, OCR, and structured output.
| Model Info | |
|---|---|
| Vision | Yes |
| Unit Pricing | $0.30 per M input tokens, $1.00 per M output tokens |
Usage
export interface Env { AI: Ai;}
export default { async fetch(request: Request, env: Env): Promise<Response> { const res = await fetch("https://cataas.com/cat"); const blob = await res.arrayBuffer(); const input = { image: [...new Uint8Array(blob)], prompt: "Generate a caption for this image", max_tokens: 512, }; const response = await env.AI.run( "@cf/moondream/moondream3.1-9B-A2B", input ); return new Response(JSON.stringify(response)); },} satisfies ExportedHandler<Env>;Parameters
stringdefault: queryenum: query, caption, point, detectWhich Moondream skill to run.stringInput image as a public HTTPS URL or base64 data URI. Optional for `query`; required for `caption`, `point`, and `detect`.stringdefault: What's in this image?Question for the `query` task.stringdefault: normalenum: short, normal, longCaption length for the `caption` task.stringdefault: personObject phrase to locate for `point` and `detect` tasks (e.g. 'person wearing a red shirt').booleandefault: trueEnable reasoning trace for the `query` task.numberdefault: 0.2minimum: 0maximum: 2Sampling temperature.numberdefault: 0.9minimum: 0maximum: 1Top-p (nucleus) sampling.integerdefault: 8192minimum: 1maximum: 28672Max tokens to generate for `query` and `caption`.integerdefault: 150minimum: 1maximum: 500Max objects to return for `point` and `detect`.booleandefault: trueReturn incremental tokens for `query` and `caption`. `point` and `detect` do not support streaming.stringReason the generation finished.objectstringAnswer text for the `query` task. Null for other tasks.stringCaption text for the `caption` task. Null for other tasks.arrayLocated points for the `point` task. Null for other tasks.arrayDetected bounding boxes for the `detect` task. Null for other tasks.objectReasoning trace for the `query` task when reasoning=true. Null otherwise.