npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ariaflowagents/livekit-plugin

v1.0.0

Published

AriaFlow plugin for LiveKit Agents — runtime adapter, transport foundation, Gemini STT/TTS

Readme

@ariaflow/livekit-plugin

AriaFlow plugin for LiveKit Agents — connects AriaFlow Runtime to LiveKit's voice infrastructure for building production voice agents.

Features

  • Runtime Adapter — wraps AriaFlow Runtime as a LiveKit LLM provider (AriaRuntimeLLMAdapter)
  • Voice SessionsAriaFlowVoiceSession (WebSocket) and AriaFlowLivekitSession (LiveKit rooms)
  • Two-Layer Turn Detection — Silero VAD + EOU text model + LLM turn markers
  • Gemini STT/TTS — Google Gemini Live speech-to-text and text-to-speech
  • Filler Coordinator — audio filler management during tool execution
  • Recording — session recording with pluggable storage adapters
  • Codec Utilities — G.711 (PCMU/PCMA) encode/decode, resampling

Install

bun add @ariaflow/livekit-plugin

Peer dependencies:

bun add @livekit/agents @livekit/rtc-node @ariaflowagents/core

Quick Start

import { WebSocketAgentServer } from '@ariaflow/livekit-plugin-transport-ws';
import { AriaFlowVoiceSession, TurnDetector } from '@ariaflow/livekit-plugin';
import { GeminiLiveSTT, GeminiLiveTTS } from '@ariaflow/livekit-plugin/gemini';
import { Runtime } from '@ariaflowagents/core';
import { openai } from '@ai-sdk/openai';

const runtime = new Runtime({
  agents: [{
    id: 'assistant',
    name: 'Voice Assistant',
    model: openai('gpt-4o-mini'),
    prompt: 'You are a helpful voice assistant.',
  }],
  defaultAgentId: 'assistant',
  defaultModel: openai('gpt-4o-mini'),
});

// Load turn detection models once at startup
const detector = new TurnDetector();
await detector.initialize();

const server = new WebSocketAgentServer({ port: 8080 });

server.onConnection(async (transport) => {
  const voiceSession = new AriaFlowVoiceSession({
    runtime,
    stt: new GeminiLiveSTT(),
    tts: new GeminiLiveTTS(),
    vad: detector.vad ?? undefined,
    turnDetection: detector.eouTurnDetector ?? undefined,
    turnMarkerConfig: detector.turnMarkerConfig,
    greeting: 'Hello! How can I help you?',
  });

  await server.startSession(transport, voiceSession);
});

await server.listen();

Turn Detection

The plugin implements a two-layer turn detection system:

Layer 1: VAD + EOU text model

  • Silero VAD detects speech boundaries (start/end of speech)
  • EOU (End-of-Utterance) ONNX model predicts whether the transcript looks like a complete turn
  • These run at the audio/STT level inside LiveKit's AgentSession

Layer 2: LLM turn markers

  • The LLM is instructed to prefix responses with a Unicode marker indicating turn completeness
  • — user's turn is complete, respond normally
  • — user will likely continue shortly, suppress response
  • — user needs more time to think, suppress and wait longer
const detector = new TurnDetector({
  // Disable individual layers:
  // disableVAD: true,
  // disableEOU: true,

  // Custom marker config:
  turnMarkerConfig: {
    enabled: true,
    incompleteShortWaitMs: 5000,
    incompleteLongWaitMs: 10000,
  },
});
await detector.initialize();

Exports

| Export Path | Contents | |-------------|----------| | @ariaflow/livekit-plugin | Core: sessions, LLM adapter, turn detection, transport, codecs | | @ariaflow/livekit-plugin/gemini | Gemini Live STT/TTS | | @ariaflow/livekit-plugin/recording | Recording manager and storage adapters | | @ariaflow/livekit-plugin/codec/g711 | G.711 PCMU/PCMA encode/decode | | @ariaflow/livekit-plugin/utils/resample | Audio resampling utilities |

Examples

See examples/ for runnable examples:

  • basic_voice_agent.ts — minimal agent with a tool
  • multi_agent_handoff.ts — router + game agent handoff
  • restaurant_agent.ts — 4-agent restaurant system
  • turn_detection_demo.ts — turn detection configuration
  • livekit_room_agent.ts — LiveKit room (WebRTC) agent
  • livekit_room_with_tools.ts — room agent with tools

Changelog

0.1.0

Turn Detection (RFC-011, RFC-012)

  • Added two-layer turn detection system (src/turn_detection/)
    • TurnDetector — orchestrator that loads VAD and EOU models in parallel
    • loadSileroVAD() — process-level singleton loader for Silero VAD with concurrent-call deduplication
    • EOUDetector — standalone port of LiveKit's EOU ONNX model, no getJobContext() dependency
    • EOUTurnDetectorAdapter — bridges EOUDetector to LiveKit's _TurnDetector interface
    • detectTurnMarker() / stripMarker() — LLM turn marker detection and stripping
    • TURN_MARKER_SYSTEM_PROMPT — system prompt fragment for LLM marker compliance
  • Modified AriaRuntimeLLMAdapter to intercept turn markers in LLM responses when configured
  • Modified AriaFlowVoiceSession to accept turnMarkerConfig option
  • Modified AriaFlowLivekitSession to accept turnMarkerConfig option
  • Added dependencies: @livekit/agents-plugin-silero, onnxruntime-node, @huggingface/hub, @huggingface/transformers

Examples

  • Added basic_voice_agent.ts — minimal voice agent with turn detection
  • Added multi_agent_handoff.ts — multi-agent routing demo
  • Added restaurant_agent.ts — 4-agent restaurant system
  • Added turn_detection_demo.ts — turn detection configuration demo
  • Added livekit_room_with_tools.ts — room-based agent with tools
  • Updated livekit_room_agent.ts — added turn detection, migrated to ServerOptions/defineAgent API

Initial Release

  • AriaRuntimeLLMAdapter — wraps AriaFlow Runtime as a LiveKit LLM provider
  • AriaFlowVoiceSession — WebSocket-based voice session
  • AriaFlowLivekitSession — LiveKit room-based voice session
  • FillerCoordinator — audio filler management during tool execution
  • Gemini Live STT/TTS integration
  • Recording with pluggable storage adapters (S3)
  • G.711 codec utilities (PCMU/PCMA)
  • Audio resampling utilities