Supported Models
Guide to using different chat models with Browser Use
Overview
Here’s how to configure the models.
Migration from Langchain
We have recently switched from Langchain to our own implementation of the models. To migrate the previous code, just replace from langchain_openai import ChatOpenAI
with from browser_use.llm import ChatOpenAI
etc. The methods should be compatible(ish).
We also made and example here to help you stay with Langchain in case your workflow requires it.
Model Recommendations
We recommend using GPT-4.1 for the best performance (best accuracy ~$0.01 per step). The best price to performance can be achieved using gemini-2.0-flash-exp
(currently also the most popular model, costs ~$0.001 per step).
Supported Models
Our library natively supports the following models:
- OpenAI
- Anthropic
- AWS Bedrock (multiple providers)
- Azure OpenAI
- Gemini
- Groq
We also support all other models that can be called via OpenAI compatible API (deepseek, novita, x, qwen). Please open a PR if you want to add a model.
We have natively switched to structured output when possible,
OpenAI
OpenAI’s GPT-4.1 models are recommended for best performance.
Required environment variables:
Anthropic
And add the variable:
Azure OpenAI
Required environment variables:
Gemini
[!IMPORTANT]
GEMINI_API_KEY
was the old environment var name, it should be calledGOOGLE_API_KEY
as of 2025-05.
Required environment variables:
AWS Bedrock
AWS Bedrock provides access to multiple model providers through a single API. We support both a general AWS Bedrock client and provider-specific convenience classes.
General AWS Bedrock (supports all providers)
Anthropic Claude via AWS Bedrock (convenience class)
AWS Authentication
Required environment variables:
You can also use AWS profiles or IAM roles instead of environment variables. The implementation supports:
- Environment variables (
AWS_ACCESS_KEY_ID
,AWS_SECRET_ACCESS_KEY
,AWS_DEFAULT_REGION
) - AWS profiles and credential files
- IAM roles (when running on EC2)
- Session tokens for temporary credentials
- AWS SSO authentication (
aws_sso_auth=True
)
Groq
Required environment variables: