version: "3.7" services: app_proxy: environment: APP_HOST: localai_api_1 APP_PORT: 8080 PROXY_AUTH_WHITELIST: "/v1/*" api: image: localai/localai:v5.1.1@sha256:be4a4ddbfee108b20004382c66832c019be86ee0d4fc6637375664b701b832d4 restart: on-failure healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8080/readyz"] interval: 1m timeout: 20m retries: 5 environment: - MODELS_PATH=/models - LOCALAI_BACKENDS_PATH=/backends - LOCALAI_EXTERNAL_BACKENDS=cpu-llama-cpp # Keep existing generated images on the package bind mount after the upstream default moved. - LOCALAI_GENERATED_CONTENT_PATH=/tmp/generated - LOCALAI_DATA_DIRS=/models /backends /configuration /data /tmp/generated # Honor the external HTTPS scheme forwarded by the Umbrel app gateway. - LOCALAI_TRUSTED_PROXIES=${GATEWAY_IP} # The image pins its backend capability to CPU; point the override file at a missing path so # LocalAI detects the host GPU and offers matching CUDA/ROCm/SYCL backends in its gallery - LOCALAI_FORCE_META_BACKEND_CAPABILITY_RUN_FILE=/nonexistent # The image bakes a malformed NVIDIA_REQUIRE_CUDA that the NVIDIA container runtime rejects - NVIDIA_DISABLE_REQUIRE=true volumes: - ${APP_DATA_DIR}/data/models:/models:cached - ${APP_DATA_DIR}/data/backends:/backends:cached - ${APP_DATA_DIR}/data/data:/data:cached - ${APP_DATA_DIR}/data/configuration:/configuration:cached - ${APP_DATA_DIR}/data/images/:/tmp/generated/images/