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.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, andtools+output_json/output_pydanticis 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 usegpt-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 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_URL → OLLAMA_HOST → 127.0.0.1:11434) → gpt-4o-mini fallback.
Common Patterns
--model:
Mixing local and hosted models
Setting a localbase_url for local development is safe to combine with hosted model names — a base_url says where the server is, not what it serves.
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:
base_url too:
Best Practices
Detection stays off the hot path
Detection stays off the hot path
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.
Cloud keys always win
Cloud keys always win
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.Use --model to override detection
Use --model to override detection
Pass
--model ollama/llama3.2 (or any id) to bypass auto-detection and target an exact model.Relocate state with PRAISONAI_HOME
Relocate state with PRAISONAI_HOME
Set
PRAISONAI_HOME to move sessions, credentials, and cache in one place — handy for Nix, Docker, or Snap packaging. Defaults to ~/.praisonai.Related
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.
