Supported LLMs
Stagehand supports most of the hosted LLM providers. The full list of supported models is below:Providers
Model Name Format
Stagehand takes the model name in the format ofprovider/model.
For example, to use Gemini 2.0 Flash, you would pass in google/gemini-2.0-flash.
Using a Provider
You can pass in one of these LLMs to thellm property in the Stagehand constructor.
Custom LLMs
Custom LLMs are currently only supported in TypeScript.
llmProvider function to the Stagehand constructor.
The only requirement for an LLM to be used with Stagehand is that it supports structured outputs.
OpenAI-compatible APIs
Most LLMs are OpenAI-compatible, and thus can be used with Stagehand as long as they support structured outputs. This includes models like Google Gemini, Ollama, and most Llama models including Groq, Cerebras, and more. To get started, you can use the OpenAI external client as a template to create a client for your model.Vercel AI SDK
The Vercel AI SDK is a popular library for interacting with LLMs. You can use any of the providers supported by the Vercel AI SDK to create a client for your model, as long as they support structured outputs. Vercel AI SDK supports providers for OpenAI, Anthropic, and Google, along with support for Amazon Bedrock and Azure OpenAI. To get started, you’ll need to install theai package and the provider you want to use. For example, to use Amazon Bedrock, you’ll need to install the @ai-sdk/amazon-bedrock package.
You’ll also need to use the Vercel AI SDK external client as a template to create a client for your model.
- npm
- pnpm
- yarn
LangChain
LangChain is a popular library for building LLM applications. You can use any of the providers supported by LangChain to create a client for your model, as long as they support structured outputs. To get started, you’ll need to install thelangchain package and the provider you want to use. For example, to use OpenAI, you’ll need to install the @langchain/openai package. You’ll also need to install the zod-to-json-schema package to convert your Zod schema to a JSON schema.
You’ll also want to add the LangChain external client to your Stagehand project.
- npm
- pnpm
- yarn

