Skip to content

Commit dc2b4ea

Browse files
Merge pull request #2 from auto-browse/feature_azure_openai
Feature: Add support for azure, vertex, ollama, anthropic
2 parents f380270 + cc5cfd9 commit dc2b4ea

8 files changed

+573
-61
lines changed

README.md

Lines changed: 45 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -61,40 +61,66 @@ If you're using Auto Browse alongside an existing Playwright setup, you must upg
6161
Auto Browse requires environment variables for the LLM (Language Model) configuration. Create a `.env` file in your project root:
6262

6363
```env
64-
# For OpenAI (default)
64+
# OpenAI (default)
6565
OPENAI_API_KEY=your_openai_api_key_here
66-
LLM_PROVIDER=openai # Optional, this is default
66+
LLM_PROVIDER=openai # Optional, defaults to openai
6767
AUTOBROWSE_LLM_MODEL=gpt-4o-mini # Optional, defaults to gpt-4o-mini
6868
69-
# Or for Google AI
69+
# Google AI
7070
GOOGLE_API_KEY=your_google_key_here
7171
LLM_PROVIDER=google
72-
AUTOBROWSE_LLM_MODEL=gemini-2.0-flash-lite # Or other supported model
72+
AUTOBROWSE_LLM_MODEL=gemini-2.0-flash-lite
73+
74+
# Azure OpenAI
75+
AZURE_OPENAI_API_KEY=your_azure_key_here
76+
AZURE_OPENAI_ENDPOINT=https://your-endpoint.openai.azure.com/
77+
AZURE_OPENAI_API_VERSION=2024-12-01-preview
78+
AZURE_OPENAI_API_DEPLOYMENT_NAME=your-deployment-name
79+
LLM_PROVIDER=azure
80+
81+
# Anthropic
82+
ANTHROPIC_API_KEY=your_anthropic_key_here
83+
LLM_PROVIDER=anthropic
84+
AUTOBROWSE_LLM_MODEL=claude-3
85+
86+
# Google Vertex AI
87+
GOOGLE_APPLICATION_CREDENTIALS=path/to/credentials.json
88+
LLM_PROVIDER=vertex
89+
90+
# Ollama
91+
BASE_URL=http://localhost:11434 # Optional, defaults to this value
92+
LLM_PROVIDER=ollama
93+
AUTOBROWSE_LLM_MODEL=llama3.1
7394
```
7495

7596
You can find an example configuration in `example.env`.
7697

7798
### Environment Variables
7899

79-
| Variable | Description | Default |
80-
| ---------------------- | ----------------------------------- | ------------- |
81-
| `LLM_PROVIDER` | LLM provider to use (openai/google) | `openai` |
82-
| `OPENAI_API_KEY` | Your OpenAI API key | - |
83-
| `GOOGLE_API_KEY` | Your Google AI API key | - |
84-
| `AUTOBROWSE_LLM_MODEL` | The LLM model to use | `gpt-4o-mini` |
100+
| Variable | Description | Default | Required For |
101+
| ---------------------------------- | -------------------------------------- | ------------------------ | ------------ |
102+
| `LLM_PROVIDER` | LLM provider to use | `openai` | No |
103+
| `AUTOBROWSE_LLM_MODEL` | The LLM model to use | `gpt-4o-mini` | No |
104+
| `OPENAI_API_KEY` | OpenAI API key | - | OpenAI |
105+
| `GOOGLE_API_KEY` | Google AI API key | - | Google AI |
106+
| `AZURE_OPENAI_API_KEY` | Azure OpenAI API key | - | Azure |
107+
| `AZURE_OPENAI_ENDPOINT` | Azure OpenAI endpoint URL | - | Azure |
108+
| `AZURE_OPENAI_API_VERSION` | Azure OpenAI API version | `2024-12-01-preview` | Azure |
109+
| `AZURE_OPENAI_API_DEPLOYMENT_NAME` | Azure OpenAI deployment name | - | Azure |
110+
| `ANTHROPIC_API_KEY` | Anthropic API key | - | Anthropic |
111+
| `GOOGLE_APPLICATION_CREDENTIALS` | Path to Google Vertex credentials file | - | Vertex AI |
112+
| `BASE_URL` | Ollama API endpoint | `http://localhost:11434` | No |
85113

86114
## Supported LLM Providers
87115

88-
Currently supported:
116+
Auto Browse supports multiple LLM providers:
89117

90-
- OpenAI (gpt-4o-mini and compatible models)
91-
- Google AI (Gemini models)
92-
93-
Coming soon:
94-
95-
- Anthropic Claude
96-
- Local LLMs
97-
- Meta Llama
118+
- OpenAI (default) - GPT-4 and compatible models
119+
- Google AI - Gemini models
120+
- Azure OpenAI - GPT models on Azure
121+
- Anthropic - Claude models
122+
- Google Vertex AI - PaLM and Gemini models
123+
- Ollama - Run models locally
98124

99125
## Usage
100126

docs/environment-setup.mdx

Lines changed: 66 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Auto-Browse supports multiple Language Model (LLM) providers to power its AI cap
2222

2323
```env
2424
OPENAI_API_KEY=your_openai_api_key_here
25-
LLM_PROVIDER=openai # Optional, this is default
25+
LLM_PROVIDER=openai # Optional, defaults to openai
2626
AUTOBROWSE_LLM_MODEL=gpt-4o-mini # Optional, defaults to gpt-4o-mini
2727
```
2828

@@ -31,43 +31,93 @@ AUTOBROWSE_LLM_MODEL=gpt-4o-mini # Optional, defaults to gpt-4o-mini
3131
OpenAI models supported:
3232

3333
- `gpt-4o-mini` (default)
34-
- Compatible GPT models
34+
- Compatible GPT-4 models
3535

36-
### Google AI
36+
### Google AI (Gemini)
3737

38-
Configure your environment:
38+
1. Get your Google AI API key:
39+
40+
- Go to [Google AI Studio](https://makersuite.google.com)
41+
- Create an account or sign in
42+
- Generate an API key
43+
44+
2. Configure your environment:
3945

4046
```env
4147
GOOGLE_API_KEY=your_google_key_here
4248
LLM_PROVIDER=google
43-
AUTOBROWSE_LLM_MODEL=gemini-2.0-flash-lite # Or other supported model
49+
AUTOBROWSE_LLM_MODEL=gemini-2.0-flash-lite
4450
```
4551

46-
## Upcoming Provider Support
52+
#### Model Options
53+
54+
- `gemini-2.0-flash-lite`
55+
- Other Gemini models
56+
57+
### Azure OpenAI
4758

48-
The following LLM providers will be supported in future releases:
59+
1. Set up Azure OpenAI:
60+
61+
- Create an Azure account
62+
- Set up Azure OpenAI service
63+
- Deploy a model
64+
- Get your API details
65+
66+
2. Configure your environment:
67+
68+
```env
69+
AZURE_OPENAI_API_KEY=your_azure_key_here
70+
AZURE_OPENAI_ENDPOINT=https://your-endpoint.openai.azure.com/
71+
AZURE_OPENAI_API_VERSION=2024-12-01-preview
72+
AZURE_OPENAI_API_DEPLOYMENT_NAME=your-deployment-name
73+
LLM_PROVIDER=azure
74+
```
4975

5076
### Anthropic Claude
5177

78+
1. Get your Anthropic API key:
79+
80+
- Go to [Anthropic's Console](https://console.anthropic.com)
81+
- Create an account
82+
- Generate an API key
83+
84+
2. Configure your environment:
85+
5286
```env
5387
ANTHROPIC_API_KEY=your_anthropic_key_here
5488
LLM_PROVIDER=anthropic
55-
AUTOBROWSE_LLM_MODEL=claude-3 # Example model
89+
AUTOBROWSE_LLM_MODEL=claude-3
5690
```
5791

58-
### Local LLMs
92+
### Google Vertex AI
5993

60-
Support for running models locally using providers like:
94+
1. Set up Google Cloud:
6195

62-
- Ollama
63-
- LMStudio
64-
- LocalAI
96+
- Create a Google Cloud project
97+
- Enable Vertex AI API
98+
- Create service account credentials
6599

66-
Configuration will be available in future releases.
100+
2. Configure your environment:
101+
102+
```env
103+
GOOGLE_APPLICATION_CREDENTIALS=path/to/credentials.json
104+
LLM_PROVIDER=vertex
105+
```
67106

68-
### Meta Llama
107+
### Ollama (Local Deployment)
69108

70-
Integration with Meta's Llama models will be supported through various hosting options.
109+
1. Install Ollama:
110+
111+
- Follow installation instructions at [Ollama.ai](https://ollama.ai)
112+
- Start the Ollama service
113+
114+
2. Configure your environment:
115+
116+
```env
117+
LLM_PROVIDER=ollama
118+
AUTOBROWSE_LLM_MODEL=llama2
119+
BASE_URL=http://localhost:11434 # Optional, this is the default
120+
```
71121

72122
## Advanced Configuration
73123

docs/installation.mdx

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -71,28 +71,56 @@ Auto-Browse requires configuration through environment variables for the Languag
7171

7272
### Setting up Environment Variables
7373

74-
1. Create a `.env` file in your project root:
74+
1. Create a `.env` file in your project root. Below are configuration examples for each supported provider:
7575

7676
```env
77-
# For OpenAI (default)
77+
# OpenAI (default)
7878
OPENAI_API_KEY=your_openai_api_key_here
79-
LLM_PROVIDER=openai # Optional, this is default
79+
LLM_PROVIDER=openai # Optional, defaults to openai
8080
AUTOBROWSE_LLM_MODEL=gpt-4o-mini # Optional, defaults to gpt-4o-mini
8181
82-
# Or for Google AI
82+
# Google AI
8383
GOOGLE_API_KEY=your_google_key_here
8484
LLM_PROVIDER=google
85-
AUTOBROWSE_LLM_MODEL=gemini-2.0-flash-lite # Or other supported model
85+
AUTOBROWSE_LLM_MODEL=gemini-2.0-flash-lite
86+
87+
# Azure OpenAI
88+
AZURE_OPENAI_API_KEY=your_azure_key_here
89+
AZURE_OPENAI_ENDPOINT=https://your-endpoint.openai.azure.com/
90+
AZURE_OPENAI_API_VERSION=2024-12-01-preview
91+
AZURE_OPENAI_API_DEPLOYMENT_NAME=your-deployment-name
92+
LLM_PROVIDER=azure
93+
94+
# Anthropic
95+
ANTHROPIC_API_KEY=your_anthropic_key_here
96+
LLM_PROVIDER=anthropic
97+
AUTOBROWSE_LLM_MODEL=claude-3
98+
99+
# Google Vertex AI
100+
GOOGLE_APPLICATION_CREDENTIALS=path/to/credentials.json
101+
LLM_PROVIDER=vertex
102+
103+
# Ollama
104+
BASE_URL=http://localhost:11434 # Optional, defaults to this value
105+
LLM_PROVIDER=ollama
106+
AUTOBROWSE_LLM_MODEL=llama2
86107
```
87108

88109
### Environment Variables Reference
89110

90-
| Variable | Description | Default | Required |
91-
| ---------------------- | ----------------------------------- | ------------- | ---------- |
92-
| `LLM_PROVIDER` | LLM provider to use (openai/google) | `openai` | No |
93-
| `OPENAI_API_KEY` | Your OpenAI API key | - | For OpenAI |
94-
| `GOOGLE_API_KEY` | Your Google AI API key | - | For Google |
95-
| `AUTOBROWSE_LLM_MODEL` | The LLM model to use | `gpt-4o-mini` | No |
111+
| Variable | Description | Default | Required For |
112+
| ---------------------------------- | -------------------------------------- | ------------------------ | ------------ |
113+
| `LLM_PROVIDER` | LLM provider to use | `openai` | No |
114+
| `AUTOBROWSE_LLM_MODEL` | The LLM model to use | `gpt-4o-mini` | No |
115+
| `OPENAI_API_KEY` | OpenAI API key | - | OpenAI |
116+
| `GOOGLE_API_KEY` | Google AI API key | - | Google AI |
117+
| `AZURE_OPENAI_API_KEY` | Azure OpenAI API key | - | Azure |
118+
| `AZURE_OPENAI_ENDPOINT` | Azure OpenAI endpoint URL | - | Azure |
119+
| `AZURE_OPENAI_API_VERSION` | Azure OpenAI API version | `2024-12-01-preview` | Azure |
120+
| `AZURE_OPENAI_API_DEPLOYMENT_NAME` | Azure OpenAI deployment name | - | Azure |
121+
| `ANTHROPIC_API_KEY` | Anthropic API key | - | Anthropic |
122+
| `GOOGLE_APPLICATION_CREDENTIALS` | Path to Google Vertex credentials file | - | Vertex AI |
123+
| `BASE_URL` | Ollama API endpoint | `http://localhost:11434` | No |
96124

97125
## TypeScript Configuration
98126

docs/introduction.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,16 @@ Instead of writing different code for different actions, Auto-Browse's universal
4141

4242
## Supported LLM Providers
4343

44-
Currently supported:
44+
Auto Browse integrates with multiple LLM providers:
4545

46-
- OpenAI (gpt-4o-mini and compatible models)
46+
- OpenAI (default) - GPT-4 and compatible models
47+
- Google AI - Gemini models
48+
- Azure OpenAI - GPT models on Azure
49+
- Anthropic - Claude models
50+
- Google Vertex AI - PaLM and Gemini models
51+
- Ollama - Run models locally
4752

48-
Coming soon:
49-
50-
- Anthropic Claude
51-
- Google Gemini
52-
- Local LLMs
53-
- Meta Llama
53+
Each provider offers unique capabilities and model options. See our [Environment Setup](/environment-setup) guide for detailed configuration instructions.
5454

5555
## Example Repository
5656

example.env

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,26 @@
1+
# LLM provider to use. Options are "openai", "google" (google genai), "vertex", "anthropic", "ollama" or "azure".
12
LLM_PROVIDER=google
2-
OPENAI_API_KEY=OPENAI_API_KEY
3+
4+
# Model to use for the LLM provider.
35
AUTOBROWSE_LLM_MODEL=gemini-2.0-flash-lite
4-
GOOGLE_API_KEY=GOOGLE_API_KEY
6+
7+
# To use "openai" as the LLM provider, set following environment variables and keys.
8+
OPENAI_API_KEY=OPENAI_API_KEY
9+
10+
# To use "google" GenAI as the LLM provider, set following environment variables and keys.
11+
GOOGLE_API_KEY=GOOGLE_API_KEY
12+
13+
# To use "vertex" Google Vertex as the LLM provider, set following environment variables and keys.
14+
GOOGLE_APPLICATION_CREDENTIALS=credentials.json
15+
16+
# To use "anthropic" as the LLM provider, set following environment variables and keys.
17+
ANTHROPIC_API_KEY=ANTHROPIC_API_KEY
18+
19+
# To use "azure" as the LLM provider, set following environment variables and keys.
20+
AZURE_OPENAI_API_KEY=AZURE_OPENAI_API_KEY
21+
AZURE_OPENAI_ENDPOINT=https://yourendpoint.openai.azure.com/
22+
AZURE_OPENAI_API_VERSION=2024-12-01-preview
23+
AZURE_OPENAI_API_DEPLOYMENT_NAME=gpt-4o-mini
24+
25+
# To use "ollama" as the LLM provider, set following environment variables.
26+
BASE_URL=http://localhost:11434

0 commit comments

Comments
 (0)