Skip to main content
Point PraisonAI at any OpenAI-compatible /v1 host by setting base_url and api_key on the Agent — bare catalog model ids are fine, no provider/ prefix required.

Quick Start

1

Simplest form

Pass base_url and api_key at the top level with a bare model id.
2

Environment-variable variant

Set the host once with environment variables, then keep the code clean.
3

Dict form (equivalent)

The dict form does the same thing when you prefer to bundle connection settings inside llm.

How It Works

PraisonAI routes a bare model id plus a base_url through the OpenAI-compatible client.

Configuration Options

Set these top-level Agent parameters for any OpenAI-compatible host.

Agent SDK Reference

Full parameter surface for the Agent class.

Common Patterns

Every host uses the same 5-line pattern — only base_url and the catalog id change.

Choosing Which Style to Use

Pick the routing style that matches what you connect to.

Best Practices

The top-level base_url is cleaner than the dict form for single-agent scripts. Reach for the dict form only when you want connection settings bundled inside llm.
Set OPENAI_API_BASE and OPENAI_API_KEY when the host stays the same across runs. This keeps code portable across environments.
Most OpenAI-compatible chat hosts don’t serve embeddings. Configure embeddings separately — see the Embeddings docs.
PraisonAI adds the openai/ prefix internally when base_url is set. Adding it manually is harmless but unnecessary.
Those keep their native adapters. Use base_url only for OpenAI-compatible Chat Completions hosts.

OpenAI

First-party OpenAI models.

LiteLLM Proxy

Route through a self-hosted LiteLLM proxy gateway.

Ollama

Local Ollama models.

Custom Provider

Register a fully custom Python provider.