Runtime errors and troubleshooting
If you only have an HTTP 500 and no message, read How to read the real error first. The useful text is almost always in the server log, not in the HTTP body.
Find your error string below to see the cause and the fix. Request-shape errors (bad JSON, unknown field, wrong content type) are in API errors.
Symptom, cause, fix
The left column is the string as it appears in the LocalAI server log (or, for the cooldown case, in the HTTP response). Match on the string, then read across.
| Error string / symptom | Likely cause | Fix |
|---|---|---|
could not load model: ... | The selected backend started but rejected the model (bad path, corrupt or truncated GGUF, wrong architecture, unsupported quantization). The ... is the backend’s own message. | Read the wrapped backend message. Re-download the model if it is truncated. Confirm the backend matches the model (for example a GGUF needs llama-cpp). Run with DEBUG=true to see the full backend output. |
could not load model (no success): ... | The backend replied to the load request but reported failure without a fatal error. | Same as above. The trailing message is the backend’s status text; check it for the concrete reason (out of memory, unsupported option, missing file). |
could not load model - all backends returned error: ... | LocalAI tried every candidate backend for the model and each one failed. Usually the backend for this model type is not installed, or the model file is unusable. | Install the correct backend with local-ai backends install <backend> (or from the Backends page). Confirm the model config backend: field names an installed backend. Inspect the concatenated per-backend messages for the real cause. |
grpc service not ready | The backend process was spawned but its gRPC server did not become healthy in time (slow start, crash on startup, or the process died while loading). When a local backend has already exited, the error includes its exit code and last stderr line. | Use the included stderr diagnostic when present; otherwise check the log lines just above. A crash here often means out of memory, a missing shared library, or an incompatible CPU (see SIGILL). Increase available RAM/VRAM or pick a smaller quantization. |
failed to load model: ... | Returned by the load endpoints and several feature paths (voice, realtime, audio transform) when the model config could not be resolved or the backend load failed. | Confirm the model name exists (local-ai models list) and its YAML is valid. The trailing text carries the specific reason. |
HTTP 503 with a Retry-After header, after a load failed | Model-load failure cooldown. After a model fails to load, LocalAI refuses new load attempts for that model for a short window so a client that keeps polling a broken model does not respawn a crashing backend on every request. The window starts at --model-load-failure-cooldown (default 10s) and doubles per consecutive failure up to 5m; it resets on the first success. | Fix the underlying load failure (see the rows above), then wait out the Retry-After seconds before retrying, or restart LocalAI to clear the cooldown. Set --model-load-failure-cooldown 0 (or LOCALAI_MODEL_LOAD_FAILURE_COOLDOWN=0) to disable the cooldown entirely. See /docs/reference/cli-reference/. |
HTTP 503 with no available nodes or no healthy nodes match selector | The scheduler could not find any healthy node to serve the model. All nodes are full and eviction cannot free a slot, a node_selector in the model’s scheduling config excludes every candidate, or every node that can take the model is already loading it (the model is already being loaded by another owner). The answer carries a Retry-After header. | Retry after a node becomes available or an in-flight request completes and frees a slot. In a cluster, add nodes or replicas. If a selector is set, confirm at least one healthy node matches it. |
HTTP 503 with no node has enough free memory for model ... | The model has a size estimate, no matching node has that much free VRAM, and evicting idle models cannot make room (the models on the nodes are serving requests, pinned, or needed for a min_replicas floor). The model is not placed on a node that lacks the room. | Retry after the Retry-After seconds. Free VRAM by unloading a model, add a node, or lower the model’s context size. |
HTTP 503 with the scheduling rule of the model cannot be read | In distributed mode, the frontend could not read the model’s scheduling rule from the database, for example during a statement timeout. It does not place the model without the rule. | Retry after the Retry-After seconds. If it persists, check the database load and the frontend logs. |
HTTP 429 with a Retry-After header, under load | Per-model concurrency limit reached. When a model config sets a MaxConcurrent limit, extra requests are rejected with 429 and a Retry-After (whole seconds, floor 1) instead of queueing. | Retry after the advised delay, raise the model’s concurrency limit, or run more replicas. |
HTTP 429 when backend inference is saturated | The process-wide --max-concurrent-backend-requests backend-execution ceiling is full. This protects inference and in-flight backend-trace memory without blocking UI or administrative endpoints. | Retry after the advised delay, reduce inference concurrency, raise the limit if the host has capacity, or add replicas. |
SIGILL (illegal instruction) on startup | The prebuilt backend uses CPU instructions your CPU does not have (for example AVX512, AVX2, F16C, FMA). | Use a backend built for your CPU, or build the backend yourself. See Creating a backend. |
CUDA / VRAM out of memory (backend log shows out of memory, CUDA error: out of memory, or the process is killed loading) | The model plus its KV cache does not fit in GPU memory. | Use a smaller quantization, reduce context_size:, offload fewer layers to the GPU (lower gpu_layers:), or free VRAM held by other processes. On multi-GPU hosts, confirm the model is not trying to load entirely onto one device. |
| Backend was terminated by the watchdog | The idle or busy watchdog stopped a backend that ran longer than its threshold. This is expected behavior when the watchdog is enabled, not a crash. | If the backend was killed prematurely, raise --watchdog-idle-timeout / --watchdog-busy-timeout, or disable the relevant watchdog (LOCALAI_WATCHDOG_IDLE=false, LOCALAI_WATCHDOG_BUSY=false). The next request reloads the model. |
| Context size exceeded / truncated output | The combined prompt and generation exceeded the model’s context window. | Shorten the prompt or raise context_size: in the model YAML (bounded by what the model and your memory allow). |
The backend engine (llama.cpp, vLLM, whisper.cpp and so on) writes the ... part above, and its wording can change between versions. Match on the LocalAI prefix (could not load model, grpc service not ready) and read the trailing text as the backend’s diagnosis.
How to read the real error
Most user-facing failures surface as an HTTP 500 whose body is a short, generic message. The real cause is in the LocalAI server log, where the backend gRPC error is logged in full:
Look at the server log, not just the HTTP response. A
500from a chat or completion request usually wraps a backend gRPC error. The log line that matters is the one printed by LocalAI when the backend replied (or failed to start).Turn on debug output. Run with
DEBUG=truein the environment, or pass--log-level=debugon the command line. The older--debugflag is deprecated. This prints the backend’s stdout/stderr, the load parameters, and per-token timing.Read the backend’s own output. Backend engines write their diagnostics to stderr, which LocalAI captures into its log at debug level. A load failure (
could not load model,grpc service not ready) almost always has the concrete reason (out of memory, missing library, unsupported quantization, illegal instruction) in the backend lines immediately above the LocalAI error.
Slow responses
Slow inference is almost always a hardware or configuration problem, not an error:
- Keep models on an SSD. On an HDD, set
mmap: falsein the model config so the model loads fully into memory. - Leave the thread count alone. LocalAI already picks a thread count from your physical cores (see Default thread count). Lower
--threadsonly if other programs compete for the CPU. - Run with
DEBUG=trueto see token-inference stats and confirm where time is going. - Confirm you are getting output at all: send a simple request with
"stream": trueand watch how fast tokens arrive. - Check GPU offload. If you expect GPU acceleration, confirm the model actually loaded onto the GPU (the backend log reports offloaded layers). See /docs/models/gpu-acceleration/.
See also
- /docs/api/api-errors/ for API-envelope error formats and status codes.
- /docs/start/first-agent/ for the “if your agent will not run” checklist (agent-specific failures).
- /docs/reference/cli-reference/ for the full flag list, including the model-load failure cooldown and watchdog options.