This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Local AI Packaged is a self-hosted AI infrastructure stack using Docker Compose. It bundles LLM inference (Ollama), chat UI (Open WebUI), workflow automation (n8n, Flowise), databases (PostgreSQL, Qdrant, Neo4j, Supabase), observability (Langfuse), web search (SearXNG), and reverse proxy (Caddy or SWAG) into a single deployable environment.
Fork of coleam00/local-ai-packaged.
# Interactive first-time setup wizard
python3 start_services.py --setup
# Generate .env with auto-detected GPU and secure secrets
python3 generate_env.py --yes --regen-sensitive
# Deploy all services
python3 start_services.py
# Deploy specific services only
python3 start_services.py --services n8n openwebui ollama qdrant
# Deploy with specific options
python3 start_services.py --profile gpu-nvidia --environment public --proxy swag
python3 start_services.py --no-supabase --no-caddy
python3 start_services.py --update --dry-run
# Update containers and restart
./update_services.sh [profile] # e.g., ./update_services.sh gpu-nvidia
# Direct docker compose (project name is "localai")
docker compose -p localai -f docker-compose.yml --profile cpu up -d
docker compose -p localai -f docker-compose.yml --profile cpu downgenerate_env.py creates .env with secrets, GPU detection, and BASE_DOMAIN hostname expansion. start_services.py clones Supabase (sparse checkout), toggles Caddy/Supabase in docker-compose.yml, generates SearXNG secret, detects SWAG proxy, resolves service dependencies, starts Supabase stack first (10s wait), then starts main stack with selected profile and services.
--services flag accepts any combination of: n8n, openwebui, flowise, qdrant, neo4j, langfuse, searxng, ollama. The SERVICE_DEPS map in start_services.py automatically includes required infrastructure (postgres, redis, etc.).
Three Docker Compose profiles select the Ollama variant: cpu, gpu-nvidia, gpu-amd. An additional n8n-worker profile enables Redis-backed queue mode workers.
- private (
docker-compose.override.private.yml): All ports bound to127.0.0.1 - public (
docker-compose.override.public.yml): Ports on0.0.0.0, designed for reverse proxy routing
- Caddy (built-in): Configured via
Caddyfile, auto Let's Encrypt - SWAG (auto-detected): Proxy-conf templates in
swag/directory, auto-installed to SWAG's proxy-confs dir - None: Direct port access only
Set BASE_DOMAIN in .env and all service hostnames auto-derive as <service>.BASE_DOMAIN. Individual overrides via *_HOSTNAME variables. Expansion happens in generate_env.py.
PostgreSQL init scripts in postgres/init/ create separate databases for n8n, Langfuse, and Flowise to prevent schema collisions.
Set N8N_EXECUTIONS_MODE=queue in .env to enable Redis-backed execution queue. Add --profile n8n-worker to start worker containers for horizontal scaling.
docker-compose.yml— main orchestration; uses YAML anchors (x-n8n,x-ollama,x-init-ollama,x-logging)start_services.py— smart launcher with interactive wizard, service selection, proxy detectiongenerate_env.py— .env generator with GPU detection and BASE_DOMAIN hostname expansionn8n_pipe.py— Open WebUI custom pipe that routes chat to n8n webhooksCaddyfile— Caddy reverse proxy routes using env var hostnamesswag/— SWAG reverse proxy subdomain conf templatespostgres/init/— PostgreSQL init scripts for database isolationsearxng/settings-base.yml— SearXNG base config (runtimesettings.ymlis generated/gitignored)n8n/backup/workflows/— pre-built RAG agent workflows (V1/V2/V3)flowise/— exported chatflows and custom tool definitions
Supabase is auto-cloned via git sparse-checkout (only docker/ dir) into supabase/. Its docker-compose is included via the include: directive. start_services.py toggles this include on/off by commenting the relevant line.
.envis generated from.env.example— never commit.envsupabase/,volumes/,shared/,neo4j/are gitignored (runtime data)- Project language is French (commits, README)
- All images are pinned to specific versions (except Open WebUI
maintag and SearXNGlatest)