This message was deleted.
# ask-ai
s
This message was deleted.
t
Thanks for reaching out, Carlos. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
It sounds like you’re seeing 5–15s cold-start delay when a BitHuman avatar joins via LiveKit. You can reduce this by preloading models and keeping processes warm. Quick wins: • Pre-bundle the BitHuman model: Bake the
.imx
into your image during build so it’s on disk at runtime. Example pattern: add a “download files” step in your Docker build, then reference it via
BITHUMAN_MODEL_PATH
so the plugin loads locally instead of fetching on first use. Guide • Prewarm the worker: Use the agent worker’s
prewarm
to load the avatar/model into memory once per process and keep a few idle processes ready via
num_idle_processes
. Worker options • Avoid heavy local models when possible: Use a
avatar_id
or
avatar_image
with BitHuman to skip large local loads. bitHuman integration • Keep instances warm: Disable scale-to-zero or maintain a small pool of warm agents to bypass platform cold starts. Deployment tips If helpful, I can share: • A Dockerfile snippet to pre-download the model • A
prewarm
code example that caches the model and sets
num_idle_processes
Sources: Virtual avatar plugins | LiveKit Docs | Agent Deployment & Docker Configuration | livekit/livekit_composite | DeepW... | Worker options | LiveKit Docs | Node.js Agents Architecture | livekit/livekit_composite | DeepWiki | Deploying to production | LiveKit Docs
f
Yes, pre bundling may not work because we fetch the agents on demand and store them in a tmp folder, but the others could help
t
Got it—since you fetch agents on demand to a tmp folder, let’s focus on prewarm and keeping workers hot. To reduce the 5–15s cold start: • Prewarm the worker: Use
WorkerOptions.prewarm
to load the BitHuman resources once per process and stash them in
proc.userData
, so the first job is fast. Pair this with
num_idle_processes
to keep a small pool ready. See worker options. • Use BitHuman without heavy local models: Prefer
avatar_id
or
avatar_image
so the provider uses an existing cloud avatar instead of loading a large
.imx
. See BitHuman plugin. • Keep instances warm: Avoid scale-to-zero and keep a minimal number of agents running to skip platform cold starts. See deployment tips. Would you like a short
prewarm
code sample (showing
proc.userData
usage) or guidance on choosing between
avatar_id
vs
avatar_image
for your flow?
f
Yes, give me a code example please
t
I don't have the answer you're looking for. You could also try asking your question: • in one of the other Slack channels or • to https://deepwiki.com/livekit/livekit_composite which is trained on all LiveKit source code If you find the answer, please post it here to help others!