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

loudkit

v0.1.1

Published

loudkit text-to-speech over onnxruntime-node: the same engine, the same sampling law, no torch.

Readme

loudkit for JavaScript and TypeScript

Text to speech in Node, on onnxruntime-node. No Python, no torch.

Hello

Node 20 or newer.

npm install loudkit

The onnxruntime-node dependency has an install script for optional native binaries, including CUDA. If your package manager blocks dependency scripts, review and allow that dependency's script when you need those binaries. The bundled CPU runtime does not require the optional CUDA download; selecting CUDA also requires a driver compatible with the installed runtime.

hello.mjs:

import { Engine } from "loudkit";

const engine = await Engine.load("loudreader/loudr-1");
const result = await engine.synthesize("Hello from loudkit.", engine.voice("joe"), { seed: 7 });
result.saveWav("hello.wav");
console.log(`hello.wav, ${(result.audio.length / result.sampleRate).toFixed(2)}s`);
await engine.close();
node hello.mjs

The first run downloads the model files into ~/Library/Caches/loudkit/loudreader--loudr-1 on macOS and ~/.cache/loudkit/loudreader--loudr-1 on Linux ($LOUDKIT_CACHE moves it), the directory the Go, Rust and Swift ports share, and checks every file against the release's own SHA256SUMS; later runs read what is there. engine.voices() names the 28 voices. close() hands back the runtime's memory; it matters when you build a second engine.

The snippets on this page need loudkit 0.1.1. From a checkout: npm run build, then node examples/hello.mjs, which is this file.

Both loudr-1 and loudr-1-turbo use this API in 0.1.1. Change the model name to switch; keep the same voice profile. A local release directory works as well as a published model name.

The rest of the front door

await download("loudreader/loudr-1", "loudr-1");          // a directory of your own
await download(repo, dir, { revision: "v0.1.1", cloning: true });
await Engine.load("loudr-1");                            // a directory or a repo id
engine.voices();                                         // the names in the release
engine.voice("joe");                                     // one of them
await engine.synthesize(text, voice, { seed, language, speed, previousTokens });
for await (const chunk of engine.stream(text, voice, options)) play(chunk.audio);
const mine = await engine.enroll("me.wav", { name: "mine", language: "en" });
saveVoice(mine, "mine.safetensors");                     // a portable profile
loadVoice("mine.safetensors");
result.saveWav(path);  result.toWav();                   // 16-bit PCM

synthesize takes text of any length: it splits at sentence boundaries and joins the audio. Every option has a default: seed 0, the voice's own language, normal speed. stream yields chunks as they are made; options.shouldCancel stops within one decode step. enroll on an engine loaded by repo id fetches the enrollment graphs once; a directory of your own needs { cloning: true }. Engine.loadPaths(checkpoint, onnxDir, tokenizer) opens a layout of your own.

Streaming, timestamps, speed and barge-in: docs/guides/07-js-ts.md.

Execution provider

onnxProvider picks the onnxruntime execution provider; the five values are the same in every port: auto (the default), cpu, cuda, coreml, directml.

const engine = await Engine.load("loudr-1", { onnxProvider: "auto" });
console.log(engine.onnxProvider);  // the one that ran, never "auto"
console.log(engine.describe());

auto takes CUDA where the build offers it and CPU otherwise. A named provider the build does not carry is an error, never a quiet fall back to CPU. Which providers exist is fixed when onnxruntime-node is installed:

| platform | providers | | --- | --- | | darwin/x64, darwin/arm64 | cpu, coreml | | linux/x64 | cpu, cuda | | win32/x64, win32/arm64 | cpu, directml |

availableProviders() reports what the installed build offers. This package refuses coreml, because onnxruntime-node cannot keep its compile cache; use the Swift package for CoreML. A GPU provider can change the token stream and waveform; conformance runs pin CPU. See docs/benchmarks.md.

Build and test

npm ci
npm test                 # weight-free conformance vectors
npm run test:all         # + engine conformance (needs checkpoint + graphs)

onnxruntime-node ships the native runtime as a package dependency. The checkpoint, graphs and tokenizer are not bundled; Engine.load fetches them.