shiichan

Workers AI now runs the vision AI Moondream 3.1!

Hi, it's Shiichan! Today I've got a vision AI story from Cloudflare that I think you'll love.

Cloudflare Changelog developers.cloudflare.com

What was announced?

Cloudflare's Changelog says Cloudflare has partnered with Moondream to bring their latest model, @cf/moondream/moondream3.1-9B-A2B, to Workers AI. Moondream 3.1 is a fast vision language model built on a mixture-of-experts (MoE) architecture, with 9B total parameters and 2B active parameters.

It keeps frontier-level visual reasoning while staying fast and cost-efficient, and it comes with a 32K token context window for handling complex queries and structured outputs.

Why it matters

Vision workloads like live camera feeds, robotics, content moderation, and interactive agents often need answers in milliseconds, not seconds. Because Moondream 3.1's active footprint is only 2B parameters, it pairs well with Workers AI's serverless, globally distributed inference: requests run close to your users, and streaming responses start returning tokens almost immediately.

What changes

Developers can now call this model directly through the Workers AI binding (env.AI.run()) or the REST API (/ai/run). It also supports AI Gateway, so you can plug it straight into your existing observability, caching, and rate-limiting setup.

const response = await env.AI.run("@cf/moondream/moondream3.1-9B-A2B", {
  image: imageBytes,
  prompt: "What is happening in this image?"
});

Dive Deep

Moondream 3.1 has four main capabilities.

  • Query — ask open-ended questions about an image, with an optional reasoning parameter for step-by-step answers
  • Caption — generate short, normal, or long descriptions of an image
  • Point — return coordinates for objects matching a target phrase
  • Detect — return bounding boxes for objects matching a target phrase

Cloudflare also shared latency numbers. For a simple, single-subject image, the client-observed median end-to-end time (including network round trip) is reported as roughly:

  • Query: ~770 ms
  • Caption: ~480 ms
  • Point: ~145 ms
  • Detect: ~160 ms

First tokens reportedly stream back in about 20-30 ms, though actual latency depends on the image and how much detail you ask for.

You can find the full spec in the Moondream 3.1 model docs, and pricing details on the Workers AI pricing page.

Wrap-up

  • Cloudflare partnered with Moondream to add Moondream 3.1 (@cf/moondream/moondream3.1-9B-A2B) to Workers AI
  • It's an MoE model with 9B total / 2B active parameters and a 32K token context window
  • It supports Query, Caption, Point, and Detect, with first tokens reportedly returning in about 20-30 ms
  • You can call it through the Workers AI binding, REST API, or AI Gateway

This update is great for anyone building latency-sensitive vision apps, or just wanting to try lightweight image understanding at the edge!