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

@kalpalabs/voiceagent-sdk

v0.0.2

Published

VoiceAgent TypeScript SDK

Downloads

6

Readme

Kalpalabs VoiceAgent typescript sdk

Call control

import { VoiceAgent } from '@kalpalabs/voiceagent-sdk';

const agent = new VoiceAgent('<client-api-key>');

// Automatically connects your microphone and audio output
// in the browser via websockets.
// Provide parameters that you want to override for this call
// rest of the parameters will be taken from default `Agent Parameters` section below
await agent.start({
    "llm": {
        "model": "llama-3.1-8b",
        "system_prompt": "You are a helpful agent",
    },
    "tts": {
        "voice_name": "dan"
    },
});

// mute and unmute user's microphone
agent.isMuted(); // false
agent.setMuted(true);
agent.isMuted(); // true

// say(message: string, endCallAfterSpoken?: boolean) can be used to invoke speech and gracefully terminate the call if needed
agent.say("Our time's up, goodbye!", true);

// stop session
agent.stop();

Agent parameters

Full list of supported params and their default values:

"params": {
    "llm": {
      "model": "llama-3.3-70b",
      "max_output_tokens": 512,
      "system_prompt": "You are a helpful agent",
      "temperature": 0.5,
      "top_p": 0.9,
    },
    "tts": {
      "max_output_tokens": 2048,
      "voice_name": "tara"
    },
    "vad": {
      "threshold": 0.6,
      "min_silence_duration_ms": 500,
      "speech_pad_ms": 500
    }
}

currently we only support openai/whisper-large-v3-turbo for STT and canopylabs/orpheus-tts-0.1-finetune-prod for TTS.

For LLM we support one of the following options: "llama-3.1-8b", "llama-3.3-70b", "qwen-3-32b", "llama-4-scout-17b-16e-instruct", "llama-4-maverick-17b-128e-instruct"

For TTS, voice_name can take one of the following options: "tara", "leah", "jess", "leo", "dan", "mia", "zac", "zoe"

Events

You can listen to the following events that agent emits and perform custom actions on them:

agent.on('speech-start', () => {
  console.log('Assistant speech has started');
});

agent.on('speech-end', () => {
  console.log('Assistant speech has ended');
});

agent.on('call-start', () => {
  console.log('Call has started');
});

agent.on('call-end', () => {
  console.log('Call has stopped');
});

// Function calls and transcripts will be sent via messages
agent.on('message', (message) => {
  console.log(message);
});

agent.on('error', (e) => {
  console.error(e);
});

Full list of Kalpalabs -> Client messages

These are the additional messages that you can handle in your code within agent.on('message') event:

  1. Call start message contains the conversation_id of the current call:
{
  "type": "call_start",
  "conversation_id": "<conversation_id>"
}
  1. Transcript message (both user and assistant):
{
  "type": "transcript",
  "transcript": "<transcript>",
  "role": "user|assistant",
}
  1. Transcript update message (assistant partial transcript):
{
  "type": "transcript_update",
  "transcript": "<partial_transcript>",
  "role": "assistant",
  "request_id": "<request_id>"
}
  1. Speech start message:
{
  "type": "speech_start",
  "role": "user|assistant"
}
  1. Response finished message when current "turn" of assistant speaking is finished:
{
  "type": "response_finished"
}
  1. Latency message - TTFB latency (in ms) of the current "turn" of conversation:
{
  "type": "latency",
  "latency": 500
}
  1. Error message:
{
  "type": "error",
  "message": "<error_message>"
}
  1. Disconnect message - Server is now going to disconnect the websocket:
{
  "type": "disconnect",
  "reason": "<disconnection_reason>"
}