Quickstart
This guide will help you set up Moondream in minutes using our free Cloud tier or running locally. For more advanced options, see our advanced documentation.
Setup
You need to choose one of these two options: cloud or local. Both are free options.
Option A: Run Moondream in the Cloud (Recommended)
The cloud option is quicker to get going since there's no download:
- Create an API key at the Moondream Cloud Console (free tier available, no credit card required)
- Copy and save your API key (you'll need it for the code examples below)
Option B: Run Moondream Locally
The local option runs on almost any hardware, but runs faster on beefier systems:
- Download Moondream Server from here
- Run it as an app (double-click it), or with a command line (using the binary name you downloaded):
bash
./moondream-server-osx-v1-0-0
- Wait for the server to initialize. It may take a few minutes while it downloads drivers and the model.
Code
Our Moondream Examples repo has examples for you to get going. We recommend you clone and use them. They work with our Python and Node clients, as well as Bash using cURL.
The code examples below show setup for both options. Use the code that matches your chosen setup option (cloud or local):
import moondream as mdfrom PIL import Image # Option A: Moondream Cloudmodel = md.vl(api_key="<your-api-key>") # Option B: Local Server# model = md.vl(endpoint="http://localhost:2020") # Load an imageimage = Image.open("../images/frieren.jpg") # Example: Generate a captioncaption_response = model.caption(image, length="short")print(caption_response["caption"])
Each Moondream capability has its own method or function. In this example we used caption
, but Moondream also supports query
, point
, and detect
. Learn more about these capabilities in our capabilities documentation.
Next Steps
- Explore Python SDK Documentation
- Check out Node.js SDK Documentation
- Try our interactive playground to test Moondream without coding
- Learn about advanced features in our API documentation