_head_call_error(head_call_error, force_download, ...
# ask-ai
p
_head_call_error(head_call_error, force_download, local_files_only)\n File \"/usr/local/lib/python3.11/site-packages/huggingface_hub/file_download.py\", line 1649, in _raise_on_head_call_error\n raise LocalEntryNotFoundError(\nhuggingface_hub.errors.LocalEntryNotFoundError: Cannot find the requested files in the disk cache and outgoing traffic has been disabled. To enable hf.co look-ups and downloads online, set 'local_files_only' to False.", "level": "ERROR", "name": "livekit.agents", "pid": 86, "job_id": "AJ_RpdTf8YnPssp", "timestamp": "2025-08-02T030933.493104+00:00"} and my docker is # syntax=docker/dockerfile:1 ARG PYTHON_VERSION=3.13.1 FROM python:${PYTHON_VERSION}-slim # Keeps Python from buffering stdout and stderr to avoid silent crashes. ENV PYTHONUNBUFFERED=1 # Create a non-privileged user for security best practices. ARG UID=10001 RUN adduser \ --disabled-password \ --gecos "" \ --home "/home/appuser" \ --shell "/sbin/nologin" \ --uid "${UID}" \ appuser # Install gcc and other build dependencies. RUN apt-get update && \ apt-get install -y \ gcc \ python3-dev \ && rm -rf /var/lib/apt/lists/* WORKDIR /home/appuser # Copy requirements and install dependencies as root user COPY requirements.txt . RUN python -m pip install --no-cache-dir -r requirements.txt # Copy the rest of the app files COPY . . # Give ownership of the app directory to appuser RUN chown -R appuser:appuser /home/appuser # Switch to non-root user USER appuser # Ensure cache dir exists and is owned by appuser (optional if needed) RUN mkdir -p /home/appuser/.cache # Download dependent models at build time RUN python main.py download-files # Expose port for health check or app access EXPOSE 8081 # Run the main application CMD ["python", "main.py", "start"]
t
Thanks for reaching out, Yassine. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
The error
LocalEntryNotFoundError
indicates that the requested files are not available in the local disk cache, and outgoing traffic has been disabled. To resolve this: • Ensure that the required files or models are downloaded during the Docker build process. You can do this by running the command
python main.py download-files
as part of your Dockerfile, which you already have included. • Verify that the
local_files_only
parameter is set to
False
if you want to allow online lookups and downloads from Hugging Face Hub. • Check that the
.cache
directory exists and is accessible by the user running the application. If the issue persists, confirm that the models or files you are trying to access are correctly specified in your code or configuration. Sources: livekit-plugins/livekit-plugins-turn-detector/livekit/plugins/turn_detector...
p
can you give me example of docker file that will resolve this problem ?
t
Here's a friendly example of a Dockerfile that makes sure all the necessary files get downloaded and are ready to go, so you won't run into that pesky `LocalEntryNotFoundError`:
Copy code
# syntax=docker/dockerfile:1
ARG PYTHON_VERSION=3.13.1
FROM python:${PYTHON_VERSION}-slim

# Keeps Python from buffering stdout and stderr to avoid silent crashes.
ENV PYTHONUNBUFFERED=1

# Create a non-privileged user for security best practices.
ARG UID=10001
RUN adduser \
    --disabled-password \
    --gecos "" \
    --home "/home/appuser" \
    --shell "/sbin/nologin" \
    --uid "${UID}" \
    appuser

# Install gcc and other build dependencies.
RUN apt-get update && \
    apt-get install -y \
    gcc \
    python3-dev \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /home/appuser

# Copy requirements and install dependencies as root user
COPY requirements.txt .
RUN python -m pip install --no-cache-dir -r requirements.txt

# Copy the rest of the app files
COPY . .

# Give ownership of the app directory to appuser
RUN chown -R appuser:appuser /home/appuser

# Switch to non-root user
USER appuser

# Ensure cache dir exists and is owned by appuser
RUN mkdir -p /home/appuser/.cache

# Download dependent models at build time
RUN python main.py download-files

# Expose port for health check or app access
EXPOSE 8081

# Run the main application
CMD ["python", "main.py", "start"]
Here are a few friendly pointers about this Dockerfile: • The
RUN python main.py download-files
command is there to make sure all the files you need are downloaded while the image builds. • We explicitly create the
.cache
directory and make sure the non-root user owns it, so you won’t have any permission headaches later on. • Dependencies get installed smoothly from the
requirements.txt
file. Just a heads up—make sure your
main.py
script has the logic to download those necessary files or models. If you need a hand with that, I’m here to help!
p
still ghet this "Could not find model livekit/turn-detector with revision v0.3.0-intl. Make sure you have downloaded the model before running the agent. Use
python3 your_agent.py download-files
to download the models.", "level": "ERROR", "name": "livekit.plugins.turn_detector", "pid": 77, "inference": true, "timestamp": "2025-08-02T033301.282787+00:00"} 043301 {"message": "process initialized", "level": "INFO", "name": "livekit.agents", "pid": 77, "inference": true, "elapsed_time": 1.69, "timestamp": "2025-08-02T033301.284850+00:00"} 043301 {"message": "error initializing inference runner\nTraceback (most recent call last):\n File \"/usr/local/lib/python3.13/site-packages/li
t
Hey there! To fix the issue with the
livekit/turn-detector
model not being found, here are some friendly steps you can follow in your Docker setup: 1. Include Model Download in Dockerfile: Make sure to add a step in your Dockerfile that downloads the model files while building the image. Here's a quick example:
Copy code
# syntax=docker/dockerfile:1
FROM python:3.11-slim

# Install dependencies
COPY requirements.txt .
RUN pip install -r requirements.txt

# Copy application code
COPY . .

# Download model files during build
RUN python main.py download-files

# Run the application
CMD ["python", "main.py", "start"]
1. Verify Model Download Command: Double-check that your app has a
download-files
command to grab the needed model weights. Usually, the turn-detector plugin adds this when you install it via pip. 2. Install Required Dependencies: Don't forget to include the turn-detector plugin in your
requirements.txt
like this:
Copy code
livekit-agents[turn-detector]
1. Run the Container: Once built, run your container as usual. The models will already be downloaded during build time, so they’ll be ready to go when the container starts. Following these steps should get the
livekit/turn-detector
model properly downloaded and working inside your Docker container. If you hit any bumps or have questions, just let me know—I’m happy to help! Sources: examples/Dockerfile-example | LiveKit turn detector plugin | LiveKit Docs
p
": "Could not find model livekit/turn-detector with revision v0.3.0-intl. Make sure you have downloaded the model before running the agent. Use
python3 your_agent.py download-files
to download the models.", "level": "ERROR", "name": "livekit.plugins.turn_detector", "pid": 77, "inference": true, "timestamp": "2025-08-02T033944.528730+00:00"} 043944 {"message": "process initialized", "level": "INFO", "name": "livekit.agents", "pid": 77, "inference": true, "elapsed_time": 1.71, "timestamp": "2025-08-02T033944.530834+00:00"} still get this # syntax=docker/dockerfile:1 ARG PYTHON_VERSION=3.13.1 FROM python:${PYTHON_VERSION}-slim # Keeps Python from buffering stdout and stderr to avoid silent crashes. ENV PYTHONUNBUFFERED=1 # Create a non-privileged user for security best practices. ARG UID=10001 RUN adduser \ --disabled-password \ --gecos "" \ --home "/home/appuser" \ --shell "/sbin/nologin" \ --uid "${UID}" \ appuser # Install gcc and other build dependencies. RUN apt-get update && \ apt-get install -y \ gcc \ python3-dev \ && rm -rf /var/lib/apt/lists/* WORKDIR /home/appuser # Copy requirements and install dependencies as root user COPY requirements.txt . RUN python -m pip install --no-cache-dir -r requirements.txt # Copy the rest of the app files COPY . . # Give ownership of the app directory to appuser RUN chown -R appuser:appuser /home/appuser # Switch to non-root user USER appuser # Ensure cache dir exists and is owned by appuser RUN mkdir -p /home/appuser/.cache # Download dependent models at build time RUN python main.py download-files # Expose port for health check or app access EXPOSE 8081 # Run the main application CMD ["python", "main.py", "start"]
t
It looks like the model
livekit/turn-detector
with revision
v0.3.0-intl
still isn’t showing up. Could you help me out by checking a few things? • Is your application’s
download-files
command definitely downloading the
livekit/turn-detector
model with the right revision? • Do you see any errors or messages when the
download-files
command runs during the Docker build? • Is the
livekit/turn-detector
model publicly available, or does it need some kind of login or special permissions? Getting these details will really help us figure out what’s going on. Thanks so much!
p
i get this during the download 043921 2025-08-02 033921,507 - DEBUG filelock - Attempting to acquire lock 140598816026704 on /home/appuser/.cache/huggingface/hub/.locks/models--livekit--turn-detector/1a367 2e6666001d0874ddcf42785f5b44fb75294.lock 043921 2025-08-02 033921,507 - DEBUG filelock - Lock 140598816026704 acquired on /home/appuser/.cache/huggingface/hub/.locks/models--livekit--turn-detector/1a367 2e6666001d0874ddcf42785f5b44fb75294.lock 043921 2025-08-02 033921,513 - DEBUG filelock - Attempting to release lock 140598816026704 on /home/appuser/.cache/huggingface/hub/.locks/models--livekit--turn-detector/1a367 2e6666001d0874ddcf42785f5b44fb75294.lock 043921 2025-08-02 033921,513 - DEBUG filelock - Lock 140598816026704 released on /home/appuser/.cache/huggingface/hub/.locks/models--livekit--turn-detector/1a367 2e6666001d0874ddcf42785f5b44fb75294.lock 043921 2025-08-02 033921,513 - INFO livekit.agents - Finished downloading files for <livekit.plugins.turn_detector.EOUPlugin object at 0x7fe042b09be0> 043922 Exporting to image 043930 Exporting to image 043933
t
Hey there! From the debug logs, it looks like the model download process is trying to grab and release a lock on the file path
/home/appuser/.cache/huggingface/hub/.locks/models--livekit--turn-detector
. This is totally normal—it helps make sure that multiple processes don’t step on each other’s toes while accessing the same file. Since the logs show the lock was successfully acquired and released, it seems like the download went through without any file locking hiccups. But, the error that popped up afterward suggests the model might not have downloaded properly or it’s not accessible for some reason. Here are a few things you can check to troubleshoot: • Make sure the model
livekit/turn-detector
with revision
v0.3.0-intl
actually exists and that your environment can access it. • Take a peek in the directory
/home/appuser/.cache/huggingface/hub/models--livekit--turn-detector
to see if the files are there. • Double-check that the
download-files
command in your app is set up to download the right model revision. • And just in case, confirm there aren’t any network or authentication issues blocking the download. If you want, I’m here to help you work through these steps—just let me know!