LiteLLM Proxy

Route PraisonAI agents through a self-hosted LiteLLM Proxy gateway

Next

Environment Variables

python
import os
from praisonaiagents import Agent

os.environ["LITELLM_PROXY_BASE_URL"] = "http://localhost:4000"
os.environ["LITELLM_PROXY_API_KEY"] = "your-proxy-key"

agent = Agent(
    name="Proxy Agent",
    llm="litellm-proxy/gpt-4",
)

Aliases: litellm-proxy, llm-proxy, litellm-gateway. Model IDs are passed through unchanged (no prefix added).

Python

python
# export LITELLM_PROXY_BASE_URL=http://localhost:4000
# export LITELLM_PROXY_API_KEY=your-key
from praisonaiagents import Agent

agent = Agent(
    instructions="You are a helpful assistant",
    llm="llm-proxy/gpt-4o",
)
agent.start("Summarise LiteLLM Proxy benefits")

Self-Hosted vs Cloud

DeploymentLITELLM_PROXY_BASE_URL
Local devhttp://localhost:4000
Docker / k8sYour service URL
LiteLLM cloudProvider-supplied endpoint