# Optional, private Laya 0.3.20 endpoint. Supply an immutable image with the # reviewed multilingual checkpoint baked in; this service never downloads it. services: laya: profiles: ["laya"] image: ${LAYA_IMAGE:?Set LAYA_IMAGE to a verified immutable Laya 0.3.20 image} container_name: ${CONTAINER_PREFIX:-novel}-laya restart: unless-stopped command: ["python", "/opt/novelworld/serve.py"] user: "10001:10001" cpus: 4 mem_limit: 6g pids_limit: 128 read_only: true cap_drop: [ALL] security_opt: [no-new-privileges:true] logging: driver: local environment: LAYA_API_KEY: ${LAYA_API_KEY:?LAYA_API_KEY is required} LAYA_MODEL_PATH: ${LAYA_MODEL_PATH:?Set the pinned local multilingual checkpoint path} LAYA_DEVICE: cpu LAYA_THREADS: "4" OMP_NUM_THREADS: "4" MKL_NUM_THREADS: "4" HF_HUB_OFFLINE: "1" TRANSFORMERS_OFFLINE: "1" PYTHONDONTWRITEBYTECODE: "1" TOKENIZERS_PARALLELISM: "false" volumes: - ./infra/laya/serve.py:/opt/novelworld/serve.py:ro tmpfs: - /tmp:size=64m,mode=1777 networks: [novel-net] healthcheck: test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/health', timeout=3).read()"] interval: 10s timeout: 5s start_period: 90s retries: 6