praisonai daemon keeps provider clients, MCP connections, and agents hot in memory — repeated praisonai run calls reuse the already-warm agent instead of paying cold-start costs every time.
Quick Start
Run prompts — they attach automatically
praisonai run forwards to it automatically.How It Works
| What is warm | What is rebuilt per call |
|---|---|
| Provider client (LiteLLM) | Prompt text |
| MCP connections | Output format (structured, stream, etc.) |
| Loaded agent config | Session/memory overrides |
| Tool registrations | Per-invocation flags (see below) |
When run Falls Back to In-Process
praisonai run does not forward to the daemon when you use these flags. They are handled in-process instead:
| Flag | Reason |
|---|---|
--session, --continue, --fork | Session continuity requires stateful context |
--memory | Memory backend must be initialized per-session |
--approval | Approval backends need a live terminal or channel |
--tools, --toolset | Per-invocation tool overrides change agent config |
--attach | Live session tagging for multi-terminal observation |
--output json, --stream | Structured output modes attach directly to the process |
--trace, --profile | Tracing and profiling require direct process access |
run behaves exactly as if no daemon were running — fully backward compatible.
CLI Reference
praisonai daemon start
Start the warm runtime server.
| Option | Type | Default | Description |
|---|---|---|---|
--host, -h | str | 127.0.0.1 | Loopback address to bind. Non-loopback addresses are rejected. |
--port, -p | int | 0 (auto) | Port to bind. 0 picks a free port automatically. |
--model, -m | str | None | Default model for warm agents. Inherits your configured default when unset. |
--idle-timeout | float | 1800.0 | Seconds of inactivity before the daemon auto-shuts-down. 0 disables. |
--background, -b | bool | False | Detach from the terminal and run in the background. |
--background spawns python -m praisonai_code.runtime as a detached process. The wrapper shim python -m praisonai.runtime remains for full-stack installs. Foreground and background modes both work on a standalone pip install praisonai-code.praisonai daemon status
| Option | Type | Default | Description |
|---|---|---|---|
--json | bool | False | Machine-readable JSON output. |
praisonai daemon stop
SIGTERM to the daemon process. If the lockfile is stale (PID reuse), cleans up the lockfile instead of killing a random process.
Version compatibility
The warm runtime records its package version in the lockfile. Thin clients (praisonai run, praisonai attach) require a matching major version before reusing the runtime — a stale daemon after upgrade is ignored and the CLI falls back to in-process execution (or attach exits with code 1).
After upgrading PraisonAI:
Security
The daemon only binds to loopback (
127.0.0.1). Any --host value that is not a loopback address is rejected at startup with exit code 1.| Protection | How |
|---|---|
| Loopback-only | ipaddress.is_loopback check at startup — non-loopback --host exits 1 |
| Token auth | Bearer token generated at startup, stored in lockfile with 0600 permissions |
| PID-reuse safety | daemon stop pings before sending SIGTERM; stale lockfile is cleaned, not used to kill a random process |
| Concurrent prompt safety | Per-model lock serializes /run calls — concurrent prompts cannot corrupt agent state |
| Error isolation | Agent evicted from cache on failed start() — transient LLM errors don’t leave a half-consumed turn cached |
Troubleshooting
Runtime descriptor is stale
Runtime descriptor is stale
The lockfile exists but the PID it points to is dead. This usually happens after a crash or force-kill.Fix: Run
praisonai daemon stop — it detects the stale lockfile and cleans it up automatically. Then praisonai daemon start again.Runtime did not report ready in time (--background)
Runtime did not report ready in time (--background)
The daemon started but did not write its lockfile within the timeout.Fix: Try starting in foreground mode first (
praisonai daemon start) to see error output. Common causes: port already in use, missing credentials, MCP server refusing connection.praisonai run still feels slow
praisonai run still feels slow
Verify the daemon is actually running and being detected:If the daemon is running but
run is still in-process, you may be using a flag that forces in-process execution (see the fallback table above).daemon start --background exits immediately
daemon start --background exits immediately
On some systems, background detach requires a clean environment. Try:
Related
Models
Default model resolution — which model the daemon uses when none is specified
MCP
MCP handshake is the biggest cold-start cost that the daemon eliminates
Session Resume
For stateful multi-turn continuity (not forwarded to daemon)
CLI Reference
Full CLI flag reference
Attach
Stream live session events from another terminal

