brash-barista-66564
07/29/2025, 4:43 PMtall-airline-16756
07/29/2025, 4:43 PMtall-airline-16756
07/29/2025, 4:44 PMdownload-files command requires a job context, which isn't available during the Docker build process. To resolve this, you can directly use the plugin's download_files() method to pre-download the model files without requiring a job context.
Here’s how you can modify your setup:
1. Create a separate script (e.g., download_models.py) with the following content:
from livekit.plugins.turn_detector import EOUPlugin
plugin = EOUPlugin()
plugin.download_files()
This script uses the plugin's download_files() method to download all necessary model files, including the tokenizer, ONNX model files, and the languages.json configuration file.
1. Update your Dockerfile to use this script during the build process:
FROM python:3.11-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy the download script
COPY download_models.py .
# Download models during build
RUN python download_models.py
# Copy your agent code
COPY . .
CMD ["python", "voice_agent.py"]
This approach bypasses the job context requirement and ensures the models are downloaded successfully during the Docker build.
Sources: livekit-plugins/livekit-plugins-silero/README.md