MODEL_NAME and provider keys; PraisonAI resolves the OpenAI-compatible endpoint before the agent runs.
As of PraisonAI 4.6.106, the endpoint resolver is available directly from The legacy path
praisonai-code:from praisonai.llm.env import ... still works via a sys.modules shim — both resolve to the same object.Quick Start
1
Use OpenAI (default)
Set your OpenAI API key and create an agent:
2
Use Anthropic directly
No base URL needed - automatic provider routing:
3
Use Groq for fast inference
High-speed inference with automatic routing:
4
Use Google Gemini
Access Google’s latest models directly:
How It Works
Provider-specific defaults
If you setMODEL_NAME=anthropic/claude-3-5-sonnet, you do not need to set OPENAI_BASE_URL — the right base URL is picked automatically.
Environment Variables
Defaults
Common Patterns
Run against Ollama
- bash
- python
Run against a corporate OpenAI proxy
- bash
- python
Use Anthropic directly
- bash
- python
Use Groq for speed
- bash
- python
Use Google Gemini
- bash
- python
Use Azure OpenAI / Bedrock via LiteLLM
- bash
- python
User Interaction Flow
Best Practices
Set OPENAI_BASE_URL, not OPENAI_API_BASE
Set OPENAI_BASE_URL, not OPENAI_API_BASE
OPENAI_BASE_URL is the standard OpenAI SDK environment variable and has the highest precedence. Use this for all new configurations rather than the legacy OPENAI_API_BASE.Empty string ≠ unset
Empty string ≠ unset
An empty string value is skipped during resolution, and the next variable in precedence order is tried. To disable a variable, unset it completely rather than setting it to an empty string.
Use .env files for local dev
Use .env files for local dev
Create a Load it in your Python code:
.env file in your project root for local development:Realtime/WebSocket endpoints
Realtime/WebSocket endpoints
For realtime features, WebSocket URLs are auto-derived from HTTP URLs. The system automatically:
- Converts
https://towss:// - Strips
/v1suffix to avoid/v1/v1/realtime - Appends the appropriate realtime path
OPENAI_BASE_URL - the realtime endpoint is handled automatically.Related
AutoGen Config List
Build an AutoGen-style config_list from the resolved endpoint
Standalone LLM Modules
All LLM modules available without the wrapper package
LLM Configuration
Complete LLM configuration options
Models
Supported models and providers
Provider Pages
Anthropic
Claude models and configuration
Groq
High-speed inference setup
Gemini models and API access
Cohere
Language model configuration
OpenRouter
Multi-provider router setup
Ollama
Local model deployment
tool_resolver), safe loader (_safe_loader), framework probes (_framework_availability), and plugin registry (tool_registry) also moved to praisonai_code — completing the same C7 arc as LLM config. See Tool Discovery Order and Local Tools Loading.
