Skip to content

Fix Cloud crashloop by downloading model files as runtime user#29

Open
mattvick wants to merge 1 commit intolivekit-examples:mainfrom
mattvick:bugfix/required-model-files-not-found-locally
Open

Fix Cloud crashloop by downloading model files as runtime user#29
mattvick wants to merge 1 commit intolivekit-examples:mainfrom
mattvick:bugfix/required-model-files-not-found-locally

Conversation

@mattvick
Copy link
Copy Markdown

@mattvick mattvick commented Mar 24, 2026

What changed

  • Moved the download-files step out of the Docker build stage and into the runtime stage of Dockerfile.
  • Removed build-stage RUN pnpm download-files.
  • Added RUN node dist/main.js download-files after USER appuser.

Why

Resolves #30

The agent was crashing in LiveKit Cloud because turn-detector model files were downloaded under the root user cache (/root/.cache/...) during build, but the worker runs as appuser and looks in /app/.cache/... at runtime.
This mismatch caused missing model files (model_q8.onnx) and startup failure (CrashLoop).

Result

  • Model artifacts are now cached under the same user/home directory used at runtime.
  • Agent startup no longer fails due to missing turn-detector files in Cloud deployments.
agent-status

Validation

  • Deployment logs previously showed missing cache/model errors and runner initialization timeout.
  • With this change, runtime download path and runtime user are aligned, which resolves the cache-location mismatch causing the crash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Agent crashes when deployed to LiveKit Cloud

1 participant