Skip to content

feat: let a pool skip the multilingual turn detector - #152

Merged
mahimairaja merged 1 commit into
mainfrom
feat/optional-turn-detector
Oct 10, 2026
Merged

mahimairaja merged 1 commit into
mainfrom
feat/optional-turn-detector

Conversation

@mahimairaja

@mahimairaja mahimairaja commented Oct 10, 2026 •

Copy link
Copy Markdown
Member

Before: every OpenRTC worker imports the multilingual turn detector when it starts. That import registers livekit's inference runner, so livekit starts an inference process of about 250 MB even when no agent uses the detector. On a 500 MB host that does not fit.

After: AgentPool(turn_detector=False) skips the import in both the coroutine and process servers. Prewarm loads only Silero and stores no turn detector factory, and sessions fall back to VAD turn detection unless their own turn_handling sets something else. The default stays True, so nothing changes for existing pools.

How: the flag goes from AgentPool into ServerParams (servers) and _PoolRuntimeState (prewarm). _default_turn_detection returns "vad" when no factory was prewarmed. New tests in tests/test_turn_detector_optout.py cover both servers, prewarm, the VAD fallback and the flag plumbing. Docs and the changelog have one line each. make ci passes locally (99.46% coverage).

AgentPool(turn_detector=False) stops both servers from importing the
multilingual turn detector, so livekit starts no inference process for
it (about 250 MB), and prewarm stores no factory. Sessions fall back to
VAD turn detection unless their turn_handling says otherwise.
@coderabbitai

coderabbitai Bot commented Oct 10, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository: mahimailabs/openrtc-runtime/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c3fbe0cb-6e5c-4eec-8065-a18b40d47875

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅

View logs ↗
No Preview URL. Enable ↗ 7e6b955 2026-10-10T03:50:38.584Z Visit the dashboard ↗

@codecov

codecov Bot commented Oct 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@cloudflare-workers-and-pages

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅

View logs ↗
No Preview URL. Enable ↗ 7e6b955 2026-10-10T03:51:17.029Z Visit the dashboard ↗

@mahimairaja
mahimairaja merged commit 2abc4b9 into main Oct 10, 2026
17 checks passed
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.

1 participant