Skip to main content
Point PraisonAI at Ollama, LM Studio, llama.cpp, or vLLM — no cloud key required.
See also: to skip the ollama/<model> prefix and let PraisonAI find and configure a running local server for you, set llm="local" — the explicit form. As of PR #4900, llm="local" correctly hands /v1 to LM Studio, vLLM, llama.cpp, and mlx-lm — earlier releases did not, and those engines returned 404 on chat. Keyless auto-detection remains the implicit form. See the Local Model Resolver.
Agent(llm="local", knowledge=[...]) on releases before PR #4870 silently sent documents and queries to OpenAI for embeddings. See Local Memory & Knowledge for the fix and how to verify.
Runtime accuracy since PR #4924. PraisonAI now uses the measurements the local layer already takes:
  • Context window comes from the server (/api/show), not the litellm default — a 40960-token model is no longer budgeted at 128000. See Context Window Management.
  • Embedding width reaches the vector store — nine more local embedders carry measured dimensions. See Local Memory & Knowledge.
  • Optional[...] tool arguments work on Ollama / LM Studio / vLLM, and tools + output_json/output_pydantic is refused up front instead of silently fabricating an answer. See Local Tool Schemas.

Quick Start

1

Zero-config with Ollama

Start Ollama, pull a model, and run — PraisonAI detects the endpoint when no cloud key is set.
2

Point at any OpenAI-compatible server

Set OPENAI_BASE_URL to target LM Studio, llama.cpp, or vLLM.
Paste the URL your server prints. http://localhost:1234/v1 (what LM Studio prints) and http://localhost:1234 are both handled — since PR #4870 the resolver strips a trailing /v1 before appending, so requests never become /v1/v1/models.

How It Works

PraisonAI probes for a reachable local server only when no cloud provider key is set, then adopts the first model it finds. Since PR #4870, the /v1/models probe always runs and any 2xx counts as present. Even if GET / returns 404 (as llama-server, LM Studio and vLLM do), the /v1/models probe still runs and finds the server — earlier versions reported these servers as “did not answer (refused)” while they were actively serving. Detection is timeout-bounded (~150 ms) and caches negatives for 30 s, so the first-run hot path stays fast when nothing is listening.

Helper model for internal calls

PraisonAI makes a small number of internal LLM calls for things like session-title generation, context compaction, memory quality scoring, and workflow routing. By default they use gpt-4o-mini. If your local server doesn’t serve a model called gpt-4o-mini (Ollama, LM Studio, and vLLM don’t) those calls will fail with a “model not found” error, even though the agent itself works fine. Set PRAISONAI_AUXILIARY_MODEL to a small local model:
The complete four-line copy-paste example:
The auxiliary model is separate from your agent’s model. Point OPENAI_MODEL_NAME (or Agent(llm=…)) at your big local model for the agent’s own reasoning; point PRAISONAI_AUXILIARY_MODEL at a smaller one for the internal helper calls. The two do not need to be the same — that’s the whole point of the split (PR #4812).
Which knob to set:

Configuration Options

Precedence (first match wins): --model <name> → any cloud provider key → reachable local endpoint (OPENAI_BASE_URLOLLAMA_HOST127.0.0.1:11434) → gpt-4o-mini fallback.

Common Patterns

Pin a specific model explicitly with --model:

Mixing local and hosted models

Setting a local base_url for local development is safe to combine with hosted model names — a base_url says where the server is, not what it serves.
Detection runs in a fixed order: an explicit ollama/ prefix wins, then closed-weights names keep their native adapter, then the base_url is checked, then the model name, then the default. The ollama/ prefix is the user speaking explicitly — it wins over everything, even a closed-weights name:
Nested and vendor-qualified routes resolve to the family they name, so they keep their native adapter behind a local base_url too:

Best Practices

The probe runs only when no cloud key is set, times out at ~150 ms, and caches negatives for 30 s — a first run with nothing listening is not slowed down.
Any cloud provider key (e.g. OPENAI_API_KEY, ANTHROPIC_API_KEY) skips the local probe entirely. OLLAMA_HOST is not a cloud key, so it participates in local detection instead.
Pass --model ollama/llama3.2 (or any id) to bypass auto-detection and target an exact model.
Set PRAISONAI_HOME to move sessions, credentials, and cache in one place — handy for Nix, Docker, or Snap packaging. Defaults to ~/.praisonai.

Provider Auto-Detection

The full precedence reference for model resolution.

First-run Onboarding

The complete credential resolution ladder.

Local Model Resolver

Set llm="local" to auto-discover and configure a running local server.