Skip to main content
You can specify which LLM to use in magnitude.config.ts. If no LLM is configured and ANTHROPIC_API_KEY is available, Magnitude will use Claude Sonnet 4 automatically.
While a variety of LLM providers are supported, many of them do NOT have any visually grounded model. See LLM Configuration for details.
Magnitude uses BAML’s providers under the hood, so their docs may be a useful secondary reference for credential configuration.
To configure your LLM, pass one of the client interfaces described below to your magnitude.config.ts, like:

Providers

Google AI Studio

Google Vertex AI

The easiest way to authenticate with Vertex AI is to authenticate using the gcloud CLI.
  1. Create a project in Google Cloud.
  2. Enable Vertex AI in that project by going to Vertex AI Dashboard an selecting “Enable all Recommended APIs”
  3. Install the gcloud CLI (instructions)
  4. Run gcloud auth application-default login --project <your-project-id>
Once you’ve done these steps, you can set up a project to use Vertex with the available credentials like this:
If running in GCP, it will query the metadata server to use the attached service account.

Anthropic

OpenAI

OpenAI-compatible (OpenRouter, Ollama, etc.)

AWS Bedrock

Authenticate with bedrock using environment variables:

Azure OpenAI

Configuring Moondream

Moondream cloud is the easiest way to get set up, and offers 5,000 free requests per day. Get an API key here. Moondream is open source and can also be self-hosted instead of using their cloud option. See here for instructions. If self-hosting, configure the baseUrl to point to your server: