mirror of
https://github.com/tiennm99/litellm.git
synced 2026-08-05 18:24:49 +00:00
fix(crusoe): split Custom API Base docs into two independent examples
The previous example set CRUSOE_API_BASE via env var and also passed api_base= in the same call, making it look like both were required. They are independent alternatives.
This commit is contained in:
@@ -147,21 +147,31 @@ model_list:
|
||||
|
||||
## Custom API Base
|
||||
|
||||
```python showLineNumbers title="Custom API Base"
|
||||
**Option 1: Environment variable**
|
||||
|
||||
```python showLineNumbers title="Custom API Base via env var"
|
||||
import os
|
||||
import litellm
|
||||
from litellm import completion
|
||||
|
||||
# Using environment variable
|
||||
os.environ["CRUSOE_API_BASE"] = "https://custom.crusoecloud.com/v1"
|
||||
os.environ["CRUSOE_API_KEY"] = "" # your API key
|
||||
|
||||
# Or pass directly
|
||||
response = completion(
|
||||
model="crusoe/meta-llama/Llama-3.3-70B-Instruct",
|
||||
messages=[{"content": "Hello!", "role": "user"}],
|
||||
)
|
||||
```
|
||||
|
||||
**Option 2: Pass directly**
|
||||
|
||||
```python showLineNumbers title="Custom API Base via parameter"
|
||||
from litellm import completion
|
||||
|
||||
response = completion(
|
||||
model="crusoe/meta-llama/Llama-3.3-70B-Instruct",
|
||||
messages=[{"content": "Hello!", "role": "user"}],
|
||||
api_base="https://custom.crusoecloud.com/v1",
|
||||
api_key="your-api-key"
|
||||
api_key="your-api-key",
|
||||
)
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user