big-application-86058
12/19/2025, 1:57 PMtall-airline-16756
12/19/2025, 1:57 PMtall-airline-16756
12/19/2025, 1:57 PMdownload-files command works and when to use it.
What it does
• Pre-downloads ML model weights and other runtime dependencies (VAD, turn detector, noise-cancellation models) so they’re available locally before the agent runs.
• Ensures fast startup and avoids on-demand model downloads during calls.
How to run it
• Python agent:
uv run agent.py download-files
• Node.js: add a script in package.json like:
"scripts": {
"download-files": "tsc && node agent.js download-files"
}
then run pnpm download-files (or your package manager).
When to run it
• Run once during project setup or during your Docker image build so containers ship with models included.
• Not required on every agent startup.
Why it’s required
• Plugins such as livekit-agents[silero], livekit-agents[turn-detector], and livekit-plugins-noise-cancellation need local model files to operate with low latency.
If you’d like, tell me whether you’re using the Python agent, Node.js, or Docker and I’ll give exact commands or a Dockerfile snippet.
Sources: examples/bank-ivr | livekit/livekit_composite | DeepWiki | LiveKit turn detector plugin | LiveKit docs | Voice AI quickstart | LiveKit docs | examples/survey | livekit/livekit_composite | DeepWiki | examples/voice_agents | livekit/livekit_composite | DeepWikibig-application-86058
12/19/2025, 1:58 PMfrom livekit.agents import AgentSession, Agent, RoomInputOptions, ModelSettings, metrics, MetricsCollectedEvent
from livekit.plugins import (
openai,
cartesia,
elevenlabs,
deepgram,
noise_cancellation,
silero,
)
from livekit.plugins.turn_detector.multilingual import MultilingualModel
from livekit.plugins.turn_detector.english import EnglishModeltall-airline-16756
12/19/2025, 1:58 PMlivekit-plugins-noise-cancellation plugin.
• silero: downloads Silero VAD model weights used by livekit-agents[silero].
• turn_detector (MultilingualModel and EnglishModel): downloads the turn-detection model files for both the multilingual and English turn-detector implementations used by livekit-agents[turn-detector].
The other imported plugins do not require local model weights to be downloaded by `download-files`:
• openai, cartesia, elevenlabs, deepgram — these rely on external APIs/SDKs and do not add local ML model downloads.
If you want, tell me whether you expect multilingual+English turn models or only one, and I’ll list the exact model filenames and a sample command to download them.big-application-86058
12/19/2025, 1:59 PMtall-airline-16756
12/19/2025, 1:59 PMuv run agent.py download-files will fetch them (plus Silero VAD and noise-cancellation if those plugins are present).
Save as agent.py:
# agent.py
from livekit.agents import AgentSession
from livekit.plugins.turn_detector import MultilingualModel, EnglishModel
from livekit.plugins import silero, noise_cancellation
# Reference both models so download-files will include them
multilingual_model = MultilingualModel()
english_model = EnglishModel()
# Optional: configure an AgentSession that uses one of the models at runtime
session = AgentSession(
turn_detection=multilingual_model, # use multilingual at runtime (recommended)
vad=silero.VAD.load(), # ensures Silero VAD model is referenced
# add other components (stt, tts, llm) as needed
)
if __name__ == "__main__":
print("Agent module loaded. Run `uv run agent.py download-files` to download models.")
Then run:
uv run agent.py download-files
This will download the multilingual and English turn-detector models as well as any models required by silero and noise_cancellation plugins referenced in the file.
Sources: Improved End-of-Turn Model Cuts Voice AI Interruptions 39% | Building the all-in-one platform for voice AI agents | LiveKit turn detector plugin | LiveKit docs | Voice AI quickstart | LiveKit docsbig-application-86058
12/19/2025, 2:00 PMmultilingual_model = MultilingualModel()
english_model = EnglishModel()tall-airline-16756
12/19/2025, 2:00 PMMultilingualModel() and EnglishModel() just to trigger downloads.
Details:
• uv run agent.py download-files downloads model files for plugins you import and reference. Explicitly instantiating a model (e.g., MultilingualModel()) ensures that model is referenced and its weights are included.
• The multilingual model largely replaces the English model and is recommended. If you only need multilingual at runtime, instantiating just MultilingualModel() is sufficient for runtime use; download-files may still fetch both models if the turn-detector plugin registers them as available.
• Best practice: explicitly reference any model you definitely want downloaded. If you want both multilingual and English files present, instantiate both as you showed. If you only need multilingual, instantiate only that one.big-application-86058
12/19/2025, 2:01 PMtall-airline-16756
12/19/2025, 2:01 PMdownload-files step downloads files for plugins and models that are actually referenced by your code. Simply importing a module may not register the specific model class for download.
• To be certain a model's weights are fetched, explicitly reference or instantiate it (e.g., MultilingualModel() and/or EnglishModel()), or otherwise use the class in your code so the download step can detect it.
• If you want both multilingual and English turn models present, instantiate both before running:
multilingual_model = MultilingualModel()
english_model = EnglishModel()
If you tell me whether you prefer only multilingual at runtime (but still want both downloaded) or you want both active, I’ll give the minimal code snippet for that case.