Hey! I’m self-hosting a livekit STT-LLM-TTS agent....
# inference
q
Hey! I’m self-hosting a livekit STT-LLM-TTS agent. It works flawlessly on my machine: • starts with
session.generateReply()
- I can hear it speaking • then I can converse with it as expected But when deployed on Fly.io, it behaves like this: • starts with session.generateReply() - I can hear it speaking - GOOD ✅ • then as soon as I start speaking, I get this error:
Copy code
2025-11-04T11:06:36Z app[d8d4295f266538] fra [info]2025-11-04T11:06:36.590Z [uncaughtException] Error [ERR_IPC_CHANNEL_CLOSED]: Channel closed
2025-11-04T11:06:36Z app[d8d4295f266538] fra [info]    at target.send (node:internal/child_process:753:16)
2025-11-04T11:06:36Z app[d8d4295f266538] fra [info]    at InferenceProcExecutor.doInference (file:///app/node_modules/@livekit/agents/dist/ipc/inference_proc_executor.js:60:15)
2025-11-04T11:06:36Z app[d8d4295f266538] fra [info]    at #doInferenceTask (file:///app/node_modules/@livekit/agents/dist/ipc/job_proc_executor.js:63:50)
2025-11-04T11:06:36Z app[d8d4295f266538] fra [info]    at ChildProcess.<anonymous> (file:///app/node_modules/@livekit/agents/dist/ipc/job_proc_executor.js:49:58)
2025-11-04T11:06:36Z app[d8d4295f266538] fra [info]    at ChildProcess.emit (node:events:531:35)
2025-11-04T11:06:36Z app[d8d4295f266538] fra [info]    at emit (node:internal/child_process:949:14)
2025-11-04T11:06:36Z app[d8d4295f266538] fra [info]    at process.processTicksAndRejections (node:internal/process/task_queues:91:21)
I’ve spent a lot of time debugging this and I have no clue what goes wrong. Any ideas ? Thanks!!! ---------- This is my
new voice.AgentSession()
:
Copy code
export function createAgentSession({
  vad,
  userData,
}: {
  vad: silero.VAD;
  userData: UserContext;
}): voice.AgentSession {
  return new voice.AgentSession({
    stt: createSTT(),
    llm: createLLM(),
    tts: createTTS(),
    turnDetection: new livekit.turnDetector.MultilingualModel(),
    vad,
    voiceOptions: VOICE_OPTIONS,
    userData,
  });
}
l
Possible resource constraints on Fly.io killing the child process? I also suggest you post this to the #C07FY8WHGPM channel, this channel is for LiveKit's inference, https://blog.livekit.io/introducing-livekit-inference/, and it looks like you are using plugins.
👍 1
🙏 1
q
Thank you!