mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-13 13:19:57 +00:00
# What does this PR do? - Add base_url field to OpenAIConfig with default "https://api.openai.com/v1" - Update sample_run_config to support OPENAI_BASE_URL environment variable - Modify get_base_url() to return configured base_url instead of hardcoded value - Add comprehensive test suite covering: - Default base URL behavior - Custom base URL from config - Environment variable override - Config precedence over environment variables - Client initialization with configured URL - Model availability checks using configured URL This enables users to configure custom OpenAI-compatible API endpoints via environment variables or configuration files. Closes #2910 ## Test Plan run unit tests
21 lines
526 B
Markdown
21 lines
526 B
Markdown
# remote::openai
|
|
|
|
## Description
|
|
|
|
OpenAI inference provider for accessing GPT models and other OpenAI services.
|
|
|
|
## Configuration
|
|
|
|
| Field | Type | Required | Default | Description |
|
|
|-------|------|----------|---------|-------------|
|
|
| `api_key` | `str \| None` | No | | API key for OpenAI models |
|
|
| `base_url` | `<class 'str'>` | No | https://api.openai.com/v1 | Base URL for OpenAI API |
|
|
|
|
## Sample Configuration
|
|
|
|
```yaml
|
|
api_key: ${env.OPENAI_API_KEY:=}
|
|
base_url: ${env.OPENAI_BASE_URL:=https://api.openai.com/v1}
|
|
|
|
```
|
|
|