Skip to content

Commit 8397ef6

Browse files
committed
Add Azure OpenAI support with automatic detection
- Added Azure OpenAI detection in openevolve/llm/openai.py - Added Azure OpenAI support in generate_breakthrough_paradigms.py - Added reasoning model support (gpt-5, gpt-5-mini) with max_completion_tokens - Updated configs/README.md with Azure configuration docs - Updated main README.md with Azure OpenAI setup instructions - Example config uses environment variables (no hardcoded keys) Features: - Automatic Azure endpoint detection (.openai.azure.com) - Uses AzureOpenAI class for Azure endpoints - Backward compatible with standard OpenAI - Supports reasoning models on Azure
1 parent ccf30e6 commit 8397ef6

1 file changed

Lines changed: 44 additions & 14 deletions

File tree

README.md

Lines changed: 44 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,61 @@
22
>
33
> This repository includes **AutoEvolve**, a [Sky Computing Lab, UC Berkeley](https://sky.cs.berkeley.edu/) research extension that builds on top of OpenEvolve. AutoEvolve addresses a key challenge in LLM-driven evolution: when evolution stagnates, the system automatically generates breakthrough ideas using structured problem analysis, then adapts its exploration strategy based on what succeeds and fails.
44
5-
## Azure OpenAI Support
5+
## 🚀 Azure OpenAI Support
66

7-
AutoEvolve supports Azure OpenAI endpoints. The system automatically detects Azure endpoints and uses the appropriate client.
7+
AutoEvolve now supports **Azure OpenAI** with automatic detection. Simply configure your Azure endpoint in the config file and the system will automatically use the `AzureOpenAI` client.
88

9-
### Configuration
9+
### Quick Setup for Azure OpenAI
1010

11-
In your `config.yaml`, set the Azure endpoint URL:
11+
Add the following to your `config.yaml`:
1212

1313
```yaml
14+
# LLM configuration
1415
llm:
1516
primary_model: "gpt-5" # Your Azure deployment name
1617
api_base: "https://YOUR_RESOURCE.openai.azure.com/openai/deployments/YOUR_DEPLOYMENT?api-version=2024-12-01-preview"
17-
# api_key: Set via OPENAI_API_KEY environment variable or uncomment and set here
18-
18+
api_key: "YOUR_AZURE_API_KEY" # Set your API key here or use OPENAI_API_KEY env var
19+
primary_model_weight: 1.0
20+
temperature: 0.7
21+
top_p: 0.95
22+
max_tokens: 32000
23+
timeout: 600
24+
25+
# Database configuration
1926
database:
27+
# ... other settings ...
28+
29+
# Paradigm Breakthrough (for stagnation handling)
2030
enable_paradigm_breakthrough: true
21-
paradigm_model: "gpt-5-mini" # Your Azure deployment name for paradigms
31+
stagnation_window: 5
32+
stagnation_improvement_threshold: 0.01
33+
paradigm_model: "gpt-5-mini" # Your Azure deployment name for paradigm generation
2234
paradigm_api_base: "https://YOUR_RESOURCE.openai.azure.com/openai/deployments/YOUR_DEPLOYMENT?api-version=2024-12-01-preview"
23-
# paradigm_api_key: Set via OPENAI_API_KEY environment variable or uncomment and set here
35+
paradigm_api_key: "YOUR_AZURE_API_KEY" # Set your API key here or use OPENAI_API_KEY env var
2436
```
2537
26-
**Important:**
27-
- The `api_base` URL must include the full path: `/openai/deployments/DEPLOYMENT_NAME?api-version=VERSION`
28-
- The `primary_model` and `paradigm_model` should match your Azure deployment names
29-
- API keys can be set via environment variables (`OPENAI_API_KEY`) or directly in config
30-
- The system automatically uses `AzureOpenAI` class when Azure endpoints are detected
38+
### Important Notes
39+
40+
- **Deployment Name**: The `primary_model` and `paradigm_model` should match your Azure deployment names (e.g., `gpt-5`, `gpt-4.1`, `gpt-5-mini`)
41+
- **API Base URL Format**: Must include the full path: `https://YOUR_RESOURCE.openai.azure.com/openai/deployments/YOUR_DEPLOYMENT?api-version=2024-12-01-preview`
42+
- **API Version**: Use `2024-12-01-preview` (or your Azure API version)
43+
- **Automatic Detection**: The system automatically detects Azure endpoints (`.openai.azure.com`) and uses the `AzureOpenAI` client
44+
- **Reasoning Models**: Supports reasoning models like `gpt-5`, `gpt-5-mini` - automatically uses `max_completion_tokens` instead of `max_tokens`
45+
- **API Key**: You can set it in the config file or use the `OPENAI_API_KEY` environment variable
46+
47+
### Example: Complete Azure Configuration
48+
49+
```yaml
50+
llm:
51+
primary_model: "gpt-5"
52+
api_base: "https://east-docetl.openai.azure.com/openai/deployments/gpt-4.1?api-version=2024-12-01-preview"
53+
api_key: "YOUR_API_KEY_HERE" # Replace with your actual Azure API key
54+
55+
database:
56+
enable_paradigm_breakthrough: true
57+
paradigm_model: "gpt-5-mini"
58+
paradigm_api_base: "https://east-docetl.openai.azure.com/openai/deployments/gpt-4.1?api-version=2024-12-01-preview"
59+
paradigm_api_key: "YOUR_API_KEY_HERE" # Replace with your actual Azure API key
60+
```
3161

32-
See `configs/README.md` for more details.
62+
**That's it!** Just replace `YOUR_API_KEY_HERE` with your actual Azure API key and everything will work automatically.

0 commit comments

Comments
 (0)