Troubleshooting
This guide covers common issues you may encounter when using LocalAI, organized by category. For each issue, diagnostic steps and solutions are provided.
Quick Diagnostics
Before diving into specific issues, run these commands to gather diagnostic information:
Restarts and long chats
When LocalAI gets SIGTERM or SIGINT (a rolling update, docker stop), it stops in three steps, each with a limit:
| Step | What happens | Limit |
|---|---|---|
| Drain | It stops accepting new requests, makes /readyz answer 503 and waits for in-flight requests (chat streams included) to finish. A reply that still streams at the end is cut. | --shutdown-timeout (LOCALAI_SHUTDOWN_TIMEOUT), default 20s, plus 1 second for a request that does not stop |
| Close the chats | The chat turns that still run are stopped and stored. A turn that does not stop in time, for example a tool that ignores the stop, is marked interrupted in the database by the closing process itself, so that it can resume. | 15 seconds |
| Other hooks | The rest of the process closes. The chats close inside this step. | 20 seconds in all |
The whole stop takes at most --shutdown-timeout plus 21 seconds: 41 seconds with the default. Give the platform a longer termination grace period than that. In Kubernetes the grace period also counts the preStop hook, so with terminationGracePeriodSeconds: 60 and a preStop of 10 seconds, 50 seconds are left after SIGTERM, and the default leaves 9 to spare. With the Kubernetes default of 30 seconds and no preStop, set --shutdown-timeout to 5s or less, or raise the grace period. A process that is killed before it ends leaves its turns running until the stale-turn check (one minute) marks them interrupted. Either way, the chat shows the turn as interrupted and resumes it by itself (see Chats).
For Docker deployments:
Request latency diagnostics
Debug logging alone does not enable profiling or request phase timing. Use Profiling and request diagnostics for an opt-in, bounded investigation on one frontend. The guide distinguishes CPU execution, lock waits, discovery filesystem work, and the model router callback. It includes direct pod port-forward instructions and warnings about unauthenticated, sensitive profiles. Enable diagnostics only through a separately approved rollout; do not expose profiling through the public API. Report non-reproduction if matched requests do not reproduce the delay.
Installation Issues
Binary Won’t Execute on Linux
Symptoms: Permission denied or “cannot execute binary file” errors.
Solution:
If you see “cannot execute binary file: Exec format error”, you downloaded the wrong architecture. Verify with:
macOS: the app does not open
Symptoms: macOS shows a warning when you open LocalAI, or the app does not start.
Solution: The app in the release DMG and the local-ai binary are signed with an Apple Developer ID and notarized, so a current release opens without a workaround. Check that you downloaded LocalAI.dmg from the releases page. To check the signature, run the spctl command in the desktop app guide. A copy that was modified or downloaded from another place fails this check.
macOS: the server stops with “Code Signature Invalid”
Symptoms: on Apple silicon, local-ai stops with SIGKILL (Code Signature Invalid) when it reads a PDF, for example a file added to a collection or a chat.
Solution: LocalAI reads PDFs with WebAssembly code that it compiles at run time, and the hardened runtime of macOS allows this only when the binary has the com.apple.security.cs.allow-unsigned-executable-memory entitlement. Releases after v5.0.1 are signed with it. On v5.0.0 or v5.0.1, update LocalAI. Until you can, set chats_index_files to false in the runtime settings: the server then stops reading the text of PDFs in your files, so it does not crash, but PDF text is not searchable. A binary that you build yourself must be signed with Entitlements.plist (make osx-signed).
Audio requests fail with “ffmpeg not found”
Symptoms: transcription, text to speech in a format other than WAV, or an audio upload fails with ffmpeg not found. At start the log shows ffmpeg is not available; audio conversion will fail.
Solution: LocalAI runs the ffmpeg program to convert audio. It does not bundle it. Install it and restart LocalAI:
- Windows:
winget install Gyan.FFmpegorchoco install ffmpeg. You can also download a build and put the folder offfmpeg.exeonPATH. - macOS:
brew install ffmpeg. - Linux: use the package manager, for example
apt install ffmpegorzypper install ffmpeg.
To use a program that is not on PATH, set LOCALAI_FFMPEG_PATH to its full path, for example LOCALAI_FFMPEG_PATH=C:\tools\ffmpeg\bin\ffmpeg.exe.
Model Loading Problems
Model Not Found
Symptoms: API returns 404 or "model not found" error.
Diagnostic steps:
Check the model exists in your models directory:
Verify your models path is correct:
Confirm the model name matches your request:
Model Fails to Load (Backend Error)
Symptoms: Model is found but fails to load, with backend errors in the logs.
Common causes and fixes:
- Wrong backend: Ensure the backend in your model YAML matches the model format. GGUF models use
llama-cpp, diffusion models usediffusers, etc. See the compatibility table for details. - Backend not installed: Check installed backends:
- Corrupt model file: Re-download the model. Partial downloads or disk errors can corrupt files.
- Wrong model format: LocalAI uses GGUF format for llama.cpp models. Older GGML format is deprecated.
Model Configuration Issues
Symptoms: Model loads but produces unexpected results or errors during inference.
Check your model YAML configuration:
Common mistakes:
modelpath must be relative to the models directory, not an absolute paththreadsset higher than physical CPU cores causes contentioncontext_sizetoo large for available RAM causes OOM errors
GPU and Memory Issues
GPU Not Detected
NVIDIA (CUDA):
When working correctly, LocalAI logs should show: ggml_init_cublas: found X CUDA devices.
Ensure you are using a CUDA-enabled container image (tags containing cuda-12 or cuda-13). CPU-only images cannot use NVIDIA GPUs.
AMD (ROCm):
If your GPU is not in the default target list, open up an Issue. Supported targets include: gfx908, gfx90a, gfx942, gfx950, gfx1030, gfx1100, gfx1101, gfx1102, gfx1103, gfx1150, gfx1151, gfx1152, gfx1153, gfx1200, gfx1201.
Intel (SYCL):
Use container images with gpu-intel in the tag. Known issue: SYCL hangs when mmap: true is set - disable it in your model config:
If the Intel diffusers backend exits while importing PyTorch with
libsycl.so.9: undefined symbol: urDeviceWaitExp, version LIBUR_LOADER_0.12,
the SYCL library has loaded an incompatible Unified Runtime loader. This happens
before the gRPC server starts; later connection-refused errors are a consequence
of that import failure.
Update the separately installed Intel diffusers backend as well as the
gpu-intel container image. Updating the parent image alone does not replace a
backend retained in your backends directory. On Linux, the Python backend launcher
prefers venv/lib when it contains libsycl.so*, ahead of the backend’s packaged
lib directory and inherited LD_LIBRARY_PATH. The venv still needs a compatible
SYCL library, Unified Runtime loader and adapters; changing search order cannot
repair an incomplete runtime installation.
If the failure persists, include the container image digest, installed backend
name and OCI digest, full import traceback, launch command, and any library mounts
in your issue. From inside the affected container, record the inherited
LD_LIBRARY_PATH, the installed backend path, and the libsycl.so*,
libur_loader.so* and libur_adapter_* files in both venv/lib and lib.
Use readelf --dyn-syms --wide and readelf --version-info on the SYCL library and
loaders to compare their symbols and versions. Running the installed backend’s
run.sh with LD_DEBUG=libs,versions captures which loader is actually selected
under its startup environment. An import torch check using the venv Python and
the same library search path can isolate this failure without generating an image.
Overriding backend auto-detection:
If LocalAI picks the wrong GPU backend, override it:
Wrong VRAM Total Detected
Symptoms: the startup log line Total available VRAM or the Nodes page shows far more GPU memory than the cards have, often close to the system RAM of the host.
LocalAI reads per-GPU VRAM from the vendor tools (nvidia-smi, rocm-smi, xpu-smi). When they give no figure, it can only fall back to the memory that the PCI enumeration attributes to the card, which is the system RAM of the card’s NUMA node. LocalAI does not use that figure for NVIDIA cards, and logs a warning instead.
- Check that the vendor tool works in the same environment as LocalAI:For NVIDIA containers, the
utilitydriver capability putsnvidia-smiinto the container (NVIDIA_DRIVER_CAPABILITIES=compute,utility, orcapabilities: [gpu, utility]in Docker Compose). The LocalAI images set it by default. - Start with
--log-level=debugand look fornvidia-smi failedor a warning that names the detection source. - Until detection works, set the total yourself:This is different from
LOCALAI_VRAM_BUDGET, which is the share of the total LocalAI may use. See VRAM Budget.
Out of Memory (OOM)
Symptoms: Model loading fails or the process is killed by the OS.
Solutions:
- Use smaller quantizations: Q4_K_S or Q2_K use significantly less memory than Q8_0 or Q6_K
- Reduce context size: Lower
context_sizein your model YAML - Enable low VRAM mode: Add
low_vram: trueto your model config - Limit active models: Only keep one model loaded at a time:
- Enable idle watchdog: Automatically unload unused models:
- Manually unload a model:
Models Stay Loaded and Consume Memory
By default, models remain loaded in memory after first use. This can exhaust VRAM when switching between models.
Configure LRU eviction:
Configure watchdog auto-unload:
These can also be set via environment variables (LOCALAI_WATCHDOG_IDLE=true, LOCALAI_WATCHDOG_IDLE_TIMEOUT=15m) or in the Web UI under Settings → Watchdog Settings.
See the VRAM Management guide for more details.
API Connection Problems
Connection Refused
Symptoms: curl: (7) Failed to connect to localhost port 8080: Connection refused
Diagnostic steps:
Verify LocalAI is running:
Check the bind address and port:
Check for port conflicts:
Authentication Errors (401)
Symptoms: 401 Unauthorized response.
If API key authentication is enabled (LOCALAI_API_KEY or --api-keys), include the key in your requests:
Keys can also be passed via x-api-key or xi-api-key headers.
Request Errors (400/422)
Symptoms: 400 Bad Request or 422 Unprocessable Entity.
Common causes:
- Malformed JSON in request body
- Missing required fields (e.g.,
modelormessages) - Invalid parameter values (e.g., negative
top_nfor reranking)
Enable debug logging to see the full request/response:
See the API Errors reference for a complete list of error codes and their meanings.
Performance Issues
Slow Inference
Diagnostic steps:
Enable debug mode to see inference timing:
Use streaming to measure time-to-first-token:
Common causes and fixes:
- Model on HDD: Move models to an SSD. If stuck with HDD, disable memory mapping (
mmap: false) to load the model entirely into RAM. - Thread overbooking: Set
--threadsto match your physical CPU core count (not logical/hyperthreaded count). - Default sampling: LocalAI uses mirostat sampling by default, which produces better quality output but is slower. Disable it for benchmarking:
- No GPU offloading: Ensure
gpu_layersis set in your model config to offload layers to GPU: - Context size too large: Larger context sizes require more memory and slow down inference. Use the smallest context size that meets your needs.
High Memory Usage
- Use quantized models (Q4_K_M is a good balance of quality and size)
- Reduce
context_size - Enable
low_vram: truein model config - Disable
mmlock(memory locking) if it’s enabled - Set
--max-active-backends=1to keep only one model in memory
Docker-Specific Problems
Container Fails to Start
Diagnostic steps:
GPU Not Available Inside Container
NVIDIA:
AMD:
Intel:
Health Checks Failing
Add a health check to your Docker Compose configuration:
Models or Settings Not Persisted Between Upgrades
Container-local files are discarded when an upgrade recreates the container. Mount all of LocalAI’s stateful paths:
The paths on the left can be any persistent host directories or named volumes. The container paths on the right must match exactly. See Persistent Storage for Docker, Podman, and UnRAID guidance.
Network and P2P Issues
P2P machines do not connect
Symptoms: a device, remote or worker that you paired with an invite does not connect, or the invite fails.
- Check that the server runs in the right P2P mode:
shareto accept paired machines,connectto only use other servers. - Open Cluster, Sharing on the server and check the peer ID, the reachability and the path of each device.
- Behind strict NAT on both sides, add a relay that you run. See Run a relay.
The P2P troubleshooting section has the full list. A setup that still uses a P2P token, --p2p or --federated does not start: see Moving from the old P2P network.
Still Having Issues?
If your issue isn’t covered here:
- Search existing issues: Check the GitHub Issues for similar problems
- Enable debug logging: Run with
DEBUG=trueor--log-level=debugand include the logs when reporting - Open a new issue: Include your OS, hardware (CPU/GPU), LocalAI version, model being used, full error logs, and steps to reproduce
- Community help: Join the LocalAI Discord for community support