models.providers.<id>.localService starts a provider-owned local model server on demand. When a model or embedding request selects that provider, OpenClaw probes the health endpoint, starts the process if it is down, waits for readiness, then sends the request. Use it to avoid keeping expensive local servers running all day.
How it works
- A model or embedding request resolves to a configured provider.
- If that provider has
localService, OpenClaw probeshealthUrl. - On a successful probe, OpenClaw uses the already-running server.
- On a failed probe, OpenClaw spawns
commandwithargs. - OpenClaw polls the health endpoint until
readyTimeoutMsexpires. - The request goes through the normal model or embedding transport.
- If OpenClaw started the process and
idleStopMsis set, it stops the process after the last in-flight request has been idle that long.
healthUrl, this process reuses it without adopting it (each process only manages the child it personally started). Startup and exit logs include bounded, redacted child-output tails plus timing and exit details; configured environment values are never emitted.
Managed llama.cpp
The official llama.cpp provider generates this shape automatically. Its guided setup installs a pinned, verifiedllama-server, writes an absolute command and
router preset, selects a free loopback port, and stores the resulting baseUrl
and localService config. Chat and local embeddings lease the same managed
router through the normal OpenAI-compatible transports.
Do not copy a generated command path between machines. Run llama.cpp setup on
each Gateway host so OpenClaw selects and verifies the matching platform build.
See llama.cpp Provider.
Config shape
timeoutSeconds on the provider entry (not localService) so slow cold starts and long generations do not hit the default model request timeout. Set an explicit healthUrl whenever your server exposes readiness somewhere other than /models on the base URL.
Fields
llmman example
llmman is a custom OpenAI-compatible/v1 backend, so the same localService API works with an llmman provider entry. It listens on 127.0.0.1:17434 by default; LLMMAN_HOST overrides the bind address, while LLMMAN_LLM_LIBRARY overrides GPU auto-detection. Its API has no authentication, so keep the default loopback bind unless a trusted network boundary restricts access.
command with the result of which llmman on the machine running OpenClaw. Full llmman setup: llmman.
ds4 example
Related
Local models
Local model setup, provider choices, and safety guidance.
llmman
Run OpenClaw through the llmman OpenAI-compatible local server.