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

@leia-org/luke-server

v0.1.1

Published

Unified realtime AI server for OpenAI and Gemini

Readme

@leia-org/luke-server

The server-side component of the Luke library, responsible for managing WebSocket connections, authentication, and orchestrating communication with AI providers (OpenAI Realtime, Gemini Live).

Features

  • Unified Interface: Abstract away differences between OpenAI and Gemini.
  • WebSocket Server: Handles real-time audio and text streaming.
  • Authentication: Built-in support for JWT and custom validation.
  • Session Management: persistent sessions and database integration hooks.
  • Hybrid Recording: Records sessions in MP3 (if ffmpeg available) or WAV, with automatic silence trimming.

Installation

pnpm add @leia-org/luke-server

Usage

import { createLukeServer, openai, gemini } from '@leia-org/luke-server';

const server = createLukeServer({
  providers: [
    openai({ apiKey: process.env.OPENAI_API_KEY }),
    gemini({ apiKey: process.env.GEMINI_API_KEY }),
  ],
  // ... configuration
});

  console.log('Luke server running on port 3001');
});

Recording Configuration

Luke can automatically record sessions. It prioritizes MP3 (via ffmpeg) for storage efficiency but falls back to WAV if ffmpeg is not found.

const server = createLukeServer({
  // ...
  recording: {
    enabled: true,
    directory: './recordings',
    // Supported variables: {id}, {timestamp}, X (random char), N (random number)
    filenameTemplate: 'session_{id}_{timestamp}', 
  }
});

Note: MP3 recording requires ffmpeg to be installed and available in the system PATH. It automatically applies filters to remove long periods of silence (>1s) and normalizes audio rate to 24kHz.

Configuration

The createLukeServer function accepts a configuration object with the following properties:

| Option | Type | Required | Description | |--------|------|----------|-------------| | providers | LukeProvider[] | Yes | Array of initialized provider instances (e.g., openai({...}), gemini({...})). | | auth | AuthConfig | Yes | Configuration for authentication. | | auth.jwt | JwtConfig | No | JWT verification settings (secret, algorithms). | | auth.validate | Function | Yes | Callback to validate decoded token and return user object. | | session | SessionConfig | No | Hooks for session lifecycle management. | | session.create | Function | No | Called when a new session is established. | | session.onEnd | Function | No | Called when a session ends (disconnect, error, timeout). | | config | ProviderSessionConfig | No | Default configuration for provider sessions. | | config.systemInstruction | string | No | System prompt for the AI model. | | config.tools | ToolDefinition[] | No | Tools available to the model. | | onConnect | Function | No | Callback when a client successfully connects. | | onDisconnect | Function | No | Callback when a client disconnects. | | onTranscription | Function | No | Callback for real-time transcription events. |