AI Services Troubleshooting¶
Diagnose and fix common AI service issues.
Time to read: ~10 min Prerequisites: AI Services Management
Quick Diagnostics¶
Production AI is two containers: ai-gateway (:8090, Triton + routers) and ai-llm (:8091, llama.cpp). There is no scripts/start-ai.sh.
# Container status
podman ps -a --filter name=ai-gateway --filter name=ai-llm
# Aggregate gateway health (healthy only when Triton + all models are ready)
curl -s http://localhost:8090/health | jq
# Per-router health
curl -s http://localhost:8090/yolo26/health | jq
curl -s http://localhost:8090/florence/health | jq
curl -s http://localhost:8090/clip/health | jq
curl -s http://localhost:8090/enrichment/health | jq
curl -s http://localhost:8090/enrich-lt/health | jq
# LLM health
curl -s http://localhost:8091/health | jq
# GPU availability
nvidia-smi
# Recent logs
podman logs --tail=100 ai-gateway 2>&1 | tail -50
podman logs --tail=100 ai-llm 2>&1 | tail -50
Host-run dev services (started via ai/start_detector.sh, ai/start_llm.sh, ai/start_nemotron.sh) log to the terminal, except start_nemotron.sh which writes /tmp/nemotron.log.
Gateway / Triton Issues¶
Gateway Never Becomes Healthy¶
Common causes:
- Model weights missing — Triton loads every model in
/models/zooat startup (--model-control-mode=none). Run./ai/download_models.sh(manifest:models.yml), then restart the gateway. start_periodnot elapsed — Triton initialises 13+ models; the compose healthcheck allows 180s before it counts failures.- GPU not visible — check the CDI spec exists (
ls /etc/cdi/nvidia.yaml) andCUDA_VISIBLE_DEVICES=${GPU_AI_SERVICES:-1}points at a real card; verify withpodman exec ai-gateway nvidia-smi.
One Router Reports Degraded¶
curl -s http://localhost:8090/enrich-lt/health | jq # per-model ready flags
podman exec ai-gateway curl -s http://localhost:8002/v2/models/pose | jq '.state,.ready'
Restart the Gateway¶
YOLO26 Issues¶
Standalone Host-Run Server Fails to Start¶
tail -f /tmp/yolo26-detector.log 2>/dev/null || # logs go to the terminal (ai/start_detector.sh)
uv sync --extra dev # ModuleNotFoundError: No module named 'transformers'
If YOLO26_MODEL_PATH points at a missing TensorRT engine, the server falls back per YOLO26_AUTO_REBUILD (rebuild from YOLO26_PT_MODEL_PATH) and then to PyTorch — see the startup messages in its log.
CUDA out of memory:
- Close other GPU applications; check VRAM:
nvidia-smi - Restart the gateway:
podman compose -f docker-compose.prod.yml restart ai-gateway
Nemotron LLM Issues¶
Service Won't Start¶
llama-server not found (host-run only): the ai-llm image builds llama.cpp inside the image; for ai/start_nemotron.sh on the host, set LLAMA_SERVER_PATH or install it — see AI Installation.
Model file not found:
CUDA initialization failed:
Port already in use:
LLM Slow to Answer¶
The Nano 30B model takes minutes to load (compose start_period 300s). Watch it:
Service Unhealthy¶
Diagnosis¶
# Check if services are responding
curl -v http://localhost:8090/health
curl -v http://localhost:8091/health
# Container state + restart counts
podman inspect -f '{{.State.Status}} {{.RestartCount}}' ai-gateway ai-llm
# Monitor GPU
nvidia-smi -l 1
Solutions¶
- Restart containers:
podman compose -f docker-compose.prod.yml restart ai-gateway ai-llm - Check logs for errors:
podman compose -f docker-compose.prod.yml logs --tail=100 ai-gateway - Verify CUDA (host-run only):
python3 -c "import torch; print(torch.cuda.is_available())"
Slow Inference¶
Symptoms¶
- Detection: 200-500ms instead of 30-50ms
- LLM: 30-60 seconds instead of 2-5 seconds
Check GPU Utilization¶
Common Causes¶
CPU fallback (GPU not being used):
# Verify CUDA is being used (host-run server)
python3 -c "import torch; print(torch.cuda.is_available())"
# Gateway: confirm Triton model instances are on GPU
podman exec ai-gateway nvidia-smi
Thermal throttling:
If > 85C, improve cooling or reduce load.
Concurrent load: other processes using the GPU — check nvidia-smi --query-compute-apps=pid,process_name,used_memory --format=csv.
Out of Memory (OOM)¶
Symptoms¶
Services crash with OOM errors (CUDA out of memory in gateway/llm logs).
Solutions¶
1. Free VRAM:
# Restart AI containers (fuser -k kills *all* GPU processes — avoid on shared hosts)
podman compose -f docker-compose.prod.yml restart ai-gateway ai-llm
2. Shrink the LLM footprint: GPU_LAYERS defaults to auto (all layers on GPU); lowering it (e.g. GPU_LAYERS=25) offloads fewer layers to VRAM — see AI Configuration. Or run the gateway on the second GPU (GPU_AI_SERVICES=1, already the default split).
3. Reduce concurrent load: the backend caps parallel AI calls with AI_MAX_CONCURRENT_INFERENCES (config.py default 4 on the standard build).
Connection Issues¶
Backend Can't Reach AI Services¶
Symptoms:
Check:
- Are the AI containers up and healthy?
podman ps -a(the gateway needs ~3 min for Triton to load all models) - Is the URL correct in
.env/ compose env (AI_GATEWAY_URL,YOLO26_URL,NEMOTRON_URL)? In the compose stack these arehttp://ai-gateway:8090/...andhttp://ai-llm:8091— the legacy per-model hostnames (ai-yolo26,ai-florence,ai-clip,ai-enrichment) no longer exist. - Is there a firewall blocking the ports? (The gateway and LLM bind
127.0.0.1on the host by default — cross-host access needs a proxy/tunnel.)
Docker/Podman networking:
The correct URL depends on your deployment mode (production compose DNS vs host-run AI vs "backend container + host AI"). Start here:
- Deployment Modes & AI Networking (decision table + copy/paste
.envsnippets)
From Container Can't Reach Host¶
# Docker - verify host.docker.internal resolves
docker exec <container> getent hosts host.docker.internal
# Podman - verify host.containers.internal resolves
podman exec <container> getent hosts host.containers.internal
If not resolving, use host IP directly.
Log Analysis¶
Gateway Common Log Messages¶
| Message | Meaning | Action |
|---|---|---|
successfully loaded 'yolo26' | Triton model ready | None |
CUDA out of memory | Not enough VRAM | Free VRAM / move LLM to GPU 0 |
model … unavailable | Weights missing | ./ai/download_models.sh, restart |
address already in use | Port conflict | Check who holds 8090/8002 |
Nemotron Common Log Messages¶
| Message | Meaning | Action |
|---|---|---|
model loaded | Service ready | None |
ggml_cuda_init: failed | CUDA not available | Check NVIDIA drivers |
bind: Address already in use | Port conflict | Kill existing process |
context length exceeded | Prompt too long | Reduce context size |
Getting Help¶
When reporting issues, collect:
# System info
nvidia-smi
python3 --version
# Service status
podman ps -a
# Health checks
curl -s http://localhost:8090/health 2>&1
curl -s http://localhost:8091/health 2>&1
# Recent logs
podman logs --tail=100 ai-gateway 2>&1
podman logs --tail=100 ai-llm 2>&1
Next Steps¶
- AI Performance - Optimize performance
- AI TLS - Secure communications
See Also¶
- AI Issues (Reference) - More detailed AI troubleshooting
- GPU Troubleshooting - CUDA and VRAM issues
- Connection Troubleshooting - Network problems
- Troubleshooting Index - Full symptom reference