services: llama-chat: build: . container_name: uncensored-llama # Run as root so we have permission to write the download to the host's folder user: root deploy: resources: reservations: devices: - driver: nvidia count: 1 capabilities: [gpu] volumes: # 1. Mount the project directory - .:/app # 2. Mount the Cache # If the user HAS the model, it reads it. # If the user DOES NOT have the model, it downloads it here (saving it for next time). - ${HOME}/.cache/huggingface:/root/.cache/huggingface environment: # Tell the library where to look - HF_HOME=/root/.cache/huggingface # Clean visuals - TERM=xterm-256color # IMPORTANT: We REMOVED 'HF_HUB_OFFLINE=1'. # Now, if the model is missing, Unsloth is allowed to go fetch it. stdin_open: true tty: true ipc: host