Skip to main content
If Ollama (or any OpenAI-compatible local server) is running, praisonai run "...", praisonai code "...", and praisonai chat "..." all work with no API key and no setup β€” each routes its keyless local-first branch through the shared ensure_configured_or_onboard() helper. Start a local model, run a prompt β€” no OPENAI_API_KEY, no --model, no praisonai setup. When no cloud key is configured but a local endpoint answers, PraisonAI adopts it as the zero-config default.
On resume, a recorded session model takes precedence over this local-first fallback. A resumed cloud session is not switched to a reachable local endpoint. See Session Model Restore.

Quick Start

1

Start Ollama

2

Run a prompt β€” no key, no model flag

No OPENAI_API_KEY. No --model. No praisonai setup.
3

See the one-line notice

PraisonAI prints a transparency notice to stderr, then answers:

How It Works

PraisonAI checks for a cloud provider key first. When none is present, it probes for a local endpoint before falling back to the terminal default. A cloud key always wins.

Detection precedence

The probe honours your environment in this exact order:
  1. OPENAI_BASE_URL if set.
  2. else OLLAMA_HOST if set (a bare host:port is accepted; a scheme is added if missing).
  3. else http://127.0.0.1:11434.
At that host it tries Ollama’s native /api/tags first β€” the first tag becomes ollama/<name>. If that fails, it tries the OpenAI-compatible /v1/models β€” the first id becomes openai/<id>. This second path detects llama.cpp, LM Studio, and vLLM.

Timing and safety


Environment Variables

Point detection at a specific endpoint with either variable.
OLLAMA_HOST is intentionally not a cloud credential β€” a running local host is not an API key, so it never suppresses local detection.

Other local servers

llama.cpp, LM Studio, and vLLM expose an OpenAI-compatible /v1/models endpoint, so they are detected via the fallback probe. Point PraisonAI at the port your server uses:
The first model id the server reports becomes openai/<id>.

Behaviour Matrix

Detection combines with your terminal mode as follows. All four entrypoints share the local-first branch inside ensure_configured_or_onboard() β€” see First-run Onboarding β†’ Shared onboarding helper. The non-TTY / --quiet / --output json error message is:

Best Practices

Local-first is zero-config, but praisonai setup is still the way to add a hosted provider (OpenAI, Anthropic, …). Once a cloud key is configured, it takes precedence over any running local server.
Passing --model <name> bypasses local detection and routes to that model’s own provider gate. Use it to force a specific model regardless of what is running locally.
To ignore a running local endpoint, either unset the local env vars or name a cloud model directly:
For llama.cpp / LM Studio / vLLM on a custom port, export OPENAI_BASE_URL before running:

First-run Onboarding

How PraisonAI routes a keyless first run

Setup

Add a hosted provider credential

Run Command

Run agents from files or prompts

Ollama

Use Ollama models with PraisonAI