Skip to content

Commit bd4b620

Browse files
Merge pull request #307 from scaleapi/dm/litellm-key-templates
Switch agent templates from OPENAI_API_KEY to LITELLM_API_KEY
2 parents 3a60add + 1d6eb7f commit bd4b620

24 files changed

Lines changed: 139 additions & 34 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# {{ agent_name }} - Environment Variables
2+
# Copy this file to .env and fill in the values
3+
4+
# API key for your LLM provider
5+
LITELLM_API_KEY=
6+
7+
# LLM base URL (optional - override to use a different provider)
8+
# OPENAI_BASE_URL=
9+
10+
# SGP Configuration (optional - for tracing)
11+
# SGP_API_KEY=
12+
# SGP_ACCOUNT_ID=

src/agentex/lib/cli/templates/default-langgraph/README.md.j2

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ TOOLS = [my_tool]
7474
Edit `project/graph.py` to modify the model, system prompt, or graph structure.
7575

7676
### 3. Configure Credentials
77-
Set your OpenAI API key:
78-
1. In `manifest.yaml` under `env.OPENAI_API_KEY`
79-
2. Or export: `export OPENAI_API_KEY=...`
77+
Set your LLM API key:
78+
1. In `manifest.yaml` under `env.LITELLM_API_KEY`
79+
2. Or export: `export LITELLM_API_KEY=...`
8080
3. Or create a `.env` file in the project directory
8181

8282
### 4. Run Locally

src/agentex/lib/cli/templates/default-langgraph/manifest.yaml.j2

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ agent:
7676
# Maps Kubernetes secrets to environment variables
7777
# Common credentials include:
7878
credentials:
79-
- env_var_name: OPENAI_API_KEY
80-
secret_name: openai-api-key
79+
- env_var_name: LITELLM_API_KEY
80+
secret_name: litellm-api-key
8181
secret_key: api-key
8282
- env_var_name: SGP_API_KEY
8383
secret_name: sgp-api-key
@@ -89,7 +89,7 @@ agent:
8989
# Optional: Set Environment variables for running your agent locally as well
9090
# as for deployment later on
9191
env:
92-
OPENAI_API_KEY: "" # Set your OpenAI API key
92+
LITELLM_API_KEY: "" # Set your LLM API key
9393
# OPENAI_BASE_URL: "<YOUR_OPENAI_BASE_URL_HERE>"
9494

9595
# Deployment Configuration

src/agentex/lib/cli/templates/default-langgraph/project/acp.py.j2

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ from dotenv import load_dotenv
99
load_dotenv()
1010
import os
1111

12+
# LiteLLM proxy auth: copy LITELLM_API_KEY to OPENAI_API_KEY for OpenAI client compatibility
13+
_litellm_key = os.environ.get("LITELLM_API_KEY")
14+
if _litellm_key:
15+
os.environ["OPENAI_API_KEY"] = _litellm_key
16+
1217
import agentex.lib.adk as adk
1318
from agentex.lib.adk import create_langgraph_tracing_handler, stream_langgraph_events
1419
from agentex.lib.core.tracing.tracing_processor_manager import add_tracing_processor_config
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# {{ agent_name }} - Environment Variables
2+
# Copy this file to .env and fill in the values
3+
4+
# API key for your LLM provider
5+
LITELLM_API_KEY=
6+
7+
# LLM base URL (optional - override to use a different provider)
8+
# OPENAI_BASE_URL=
9+
10+
# SGP Configuration (optional - for tracing)
11+
# SGP_API_KEY=
12+
# SGP_ACCOUNT_ID=

src/agentex/lib/cli/templates/default/README.md.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ pip install -r requirements.txt
139139
### 4. Configure Credentials
140140
Options:
141141
1. Add any required credentials to your manifest.yaml via the `env` section
142-
2. Export them in your shell: `export OPENAI_API_KEY=...`
142+
2. Export them in your shell: `export LITELLM_API_KEY=...`
143143
3. For local development, create a `.env.local` file in the project directory
144144

145145
```python

src/agentex/lib/cli/templates/default/manifest.yaml.j2

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,14 @@ agent:
8080
secret_name: redis-url-secret
8181
secret_key: url
8282
# credentials:
83-
# - env_var_name: OPENAI_API_KEY
84-
# secret_name: openai-api-key
83+
# - env_var_name: LITELLM_API_KEY
84+
# secret_name: litellm-api-key
8585
# secret_key: api-key
8686

8787
# Optional: Set Environment variables for running your agent locally as well
8888
# as for deployment later on
8989
env: {}
90-
# OPENAI_API_KEY: "<YOUR_OPENAI_API_KEY_HERE>"
90+
# LITELLM_API_KEY: "<YOUR_LITELLM_API_KEY_HERE>"
9191
# OPENAI_BASE_URL: "<YOUR_OPENAI_BASE_URL_HERE>"
9292
# OPENAI_ORG_ID: "<YOUR_OPENAI_ORG_ID_HERE>"
9393

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# {{ agent_name }} - Environment Variables
2+
# Copy this file to .env and fill in the values
3+
4+
# API key for your LLM provider
5+
LITELLM_API_KEY=
6+
7+
# LLM base URL (optional - override to use a different provider)
8+
# OPENAI_BASE_URL=
9+
10+
# SGP Configuration (optional - for tracing)
11+
# SGP_API_KEY=
12+
# SGP_ACCOUNT_ID=

src/agentex/lib/cli/templates/sync-langgraph/README.md.j2

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ TOOLS = [my_tool]
7272
Edit `project/graph.py` to modify the model, system prompt, or graph structure.
7373

7474
### 3. Configure Credentials
75-
Set your OpenAI API key:
76-
1. In `manifest.yaml` under `env.OPENAI_API_KEY`
77-
2. Or export: `export OPENAI_API_KEY=...`
75+
Set your LLM API key:
76+
1. In `manifest.yaml` under `env.LITELLM_API_KEY`
77+
2. Or export: `export LITELLM_API_KEY=...`
7878
3. Or create a `.env` file in the project directory
7979

8080
### 4. Run Locally

src/agentex/lib/cli/templates/sync-langgraph/manifest.yaml.j2

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ agent:
7575
# Maps Kubernetes secrets to environment variables
7676
# Common credentials include:
7777
credentials:
78-
- env_var_name: OPENAI_API_KEY
79-
secret_name: openai-api-key
78+
- env_var_name: LITELLM_API_KEY
79+
secret_name: litellm-api-key
8080
secret_key: api-key
8181
- env_var_name: SGP_API_KEY
8282
secret_name: sgp-api-key
@@ -85,7 +85,7 @@ agent:
8585
# Optional: Set Environment variables for running your agent locally as well
8686
# as for deployment later on
8787
env:
88-
OPENAI_API_KEY: "" # Set your OpenAI API key
88+
LITELLM_API_KEY: "" # Set your LLM API key
8989
# OPENAI_BASE_URL: "<YOUR_OPENAI_BASE_URL_HERE>"
9090

9191

0 commit comments

Comments
 (0)