Magnitude requires an LLM than is both:

  1. Very good at instruction following and planning
  2. Is visually grounded, meaning it understands precise coordinates in an image to interact with the browser accurately.

Very few LLMs meet this criteria, which is why we recommend Claude Sonnet 4, which has strong reasoning abilities and is grounded. To use Sonnet, simply set ANTHROPIC_API_KEY in your environment.

You can also choose a specific Claude model by configuring an Anthropic or Bedrock client in Magnitude config.
Most LLMs are NOT grounded, for example models from OpenAI, Gemini, or Llama.

Other compatible models

If you are looking for a cheaper / open source alternative with comparable performance we recommend Qwen 2.5 VL 72B.

Here’s an example of how you could configure Magnitude to use Qwen via OpenRouter:

magnitude.config.ts
import { type MagnitudeConfig } from 'magnitude-test';

export default {
    url: "http://localhost:5173",
    llm: {
        provider: 'openai-generic',
        options: {
            baseUrl: 'https://openrouter.ai/api/v1',
            model: 'qwen/qwen2.5-vl-72b-instruct',
            apiKey: process.env.OPENROUTER_API_KEY
        }
    }
} satisfies MagnitudeConfig;

For instructions on configuring LLMs with various providers, see LLM Providers.