Skip to content

CLI crashes on Windows when using Bun due to unresolved native inference binaries #1900

Description

@Mnnbnsl

Describe the bug

When bootstrapping a standard AgentSession voice pipeline on Windows 10/11 x64 using the Bun runtime ecosystem (bun src/main.ts dev), the worker runtime crashes immediately during initialization when setting up inference.TurnDetector().

Even when explicitly attempting to set turnHandling.turnDetection: undefined, the underlying engine still defaults to warming up the lk_eot_audio engine, triggering a failure because Bun on Windows does not fetch or bind platform-specific native C++ Node addons (@livekit/local-inference-win32-x64-msvc) properly out of optional dependencies.

Changing the flag to the explicit string variant 'vad' bypasses it, but the default fallback state crashes out of the box when run with Bun.

Relevant log output

bun src/main.ts dev
◇ injected env (0) from .env.local
[01:33:51.054] DEBUG (18628): initializing inference runner
runner: "lk_eot_audio"
6 | #logger = log();
7 | #mod;
8 | async initialize() {
9 | this.#mod = _getLocalInferenceModule();
10 | if (this.#mod === void 0) {
11 | throw new Error(
^
error: EotRunner: @livekit/local-inference native binding unavailable in the inference process
at initialize (...\node_modules@livekit\agents\dist\inference\eot\runner.js:11:17)
at (...\node_modules@livekit\agents\dist\ipc\inference_proc_lazy_main.js:43:17)

[01:33:51.531] WARN (18628): @livekit/local-inference native binding not loadable; local VAD/EOT paths disabled
err: "@livekit/local-inference: failed to load @livekit/local-inference-win32-x64-msvc. Re-run npm install (or pnpm install) so the optional platform dependency for win32-x64 is fetched."

[01:33:51.583] FATAL (23772): closing worker due to error.

Describe your environment

  • OS: Windows 11 (x64)
  • Runtime: Bun v1.3.14 (Windows x64 Native)
  • Framework Packages: @livekit/agents (Latest JS SDK version)

Minimal reproducible example

  1. Scaffold a fresh repository on a Windows machine.

  2. Initialize dependencies using bun add @livekit/agents @livekit/plugins-ai-coustics livekit-server-sdk

  3. Put down standard agent cli.runApp worker code containing turnDetection: new inference.TurnDetector().

  4. Fire bun src/main.ts dev.

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions