Skip to main content
Change your AI provider, viewport, or other settings after initial setup.
Both npm create libretto@latest and npx libretto setup handle initial configuration for you. The commands on this page are for changing settings after the fact.

Changing your AI provider

1

Run the configure command

Pick the provider you want to switch to:
npx libretto ai configure <openai|anthropic|gemini|vertex>
You can also pin a specific model version:
npx libretto ai configure openai/gpt-4o
2

Set your environment variable

Add the environment variable for your provider (see table below) to your shell or a .env file at the project root.
3

Install the provider's AI SDK

Install the matching SDK package for your provider (see table below):
npm install @ai-sdk/openai

AI Provider Reference

ProviderDefault modelEnvironment variableSDK package
openaiopenai/gpt-5.4OPENAI_API_KEY@ai-sdk/openai
anthropicanthropic/claude-sonnet-4-6ANTHROPIC_API_KEY@ai-sdk/anthropic
geminigoogle/gemini-3-flash-previewGEMINI_API_KEY@ai-sdk/google
vertexvertex/gemini-2.5-flashGOOGLE_CLOUD_PROJECT@ai-sdk/google-vertex
To view the current configuration, run npx libretto ai configure with no arguments. To clear it, pass --clear.

Config file reference

The config file is at .libretto/config.json. You can edit it directly or use the CLI commands above.
{
  "version": 1,
  "snapshotModel": "openai/gpt-5.4",
  "provider": "local",
  "viewport": { "width": 1280, "height": 800 },
  "sessionMode": "write-access"
}
version
number
required
Config schema version.
snapshotModel
string
Optional. A provider/model-id string (e.g. openai/gpt-5.4). The AI model used by npx libretto snapshot to analyze page state. Set via npx libretto ai configure.
provider
string
Optional. The browser provider to use. Must be "local", "kernel", or "browserbase". Defaults to "local". Can be overridden per-command with --provider or the LIBRETTO_PROVIDER environment variable. Resolution order: --provider flag → LIBRETTO_PROVIDER env var → this config field → "local".
viewport
object
Optional, manually set. Default browser window size (width and height in pixels) used by open and run when you don’t pass --viewport. Defaults to 1366x768 if not set.
sessionMode
string
Optional, manually set. Default access mode for new sessions created by open, connect, and run. Must be "read-only" or "write-access". Defaults to "write-access" when omitted. Pass --read-only or --write-access to open, connect, or run to override when creating a session.
windowPosition
object
Optional, manually set. Sets the initial position of the headed browser window on screen. Has no effect in headless mode.