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

kokoro-local-runtime

v0.1.0

Published

Self-contained local Kokoro TTS runtime for Node and Bun

Readme

kokoro-local-runtime

Reusable Node/Bun package containing the headless Kokoro runtime and its isolated support modules. It includes Python, ONNX CPU, WebGPU, and CoreML backends in one self-contained tarball.

npm install kokoro-local-runtime

API

import { createKokoro } from "kokoro-local-runtime"

const kokoro = createKokoro({ homeDir: "/absolute/cache/root" })

await kokoro.prepare("javascript-onnx-q8", {
  onEvent: console.log,
})

const started = await kokoro.start("javascript-onnx-q8")
await started.worker.generate(
  "Hello from Kokoro.",
  "/tmp/hello.wav",
  "af_heart",
  { speed: 1.2 },
)
await started.worker.stop()
await kokoro.dispose()

homeDir is required. The package never reads TTS_LAB_HOME, plays audio, or downloads/builds during import. prepare() is the explicit setup boundary and accepts an AbortSignal.

The optional fourth worker argument contains strictly validated request-scoped synthesis parameters. Every Kokoro profile currently exposes speed from 0.5 to 2.0 in 0.1 increments. Parameter changes do not reload the model.

Two deliberate subpaths expose facilities needed by other local TTS engines:

import { downloadAssets, NdjsonRuntimeWorker } from "kokoro-local-runtime/core"
import { FluidAudioBuilder } from "kokoro-local-runtime/fluidaudio"

core contains resumable downloads, process-tree cancellation, shared uv bootstrap, and the concurrent NDJSON worker. fluidaudio contains the shared lazy builder and backend command helpers. Kokoro and Pocket use the same FluidAudioBuilder, pinned Swift package, cache path <homeDir>/tools/fluidaudio-0.15.5-v5, and tts-lab-fluidaudio product.

Profiles

  • python-pytorch-fp32
  • javascript-onnx-q8
  • javascript-onnx-fp32
  • javascript-webgpu-fp32
  • native-coreml-ane

The exported catalog contains the stable profile IDs, 28 English voices, pinned Python model assets, sizes, hashes, capability checks, and runtime restrictions. Existing TTS Lab cache paths remain compatible.

Bun resolves the package's bun export condition directly to TypeScript source, both in the workspace and from a packed install. Node resolves compiled dist. Both forms are included in the package and verified independently.

JavaScript profiles require Node 22+ or Bun 1.3+ and execute through Transformers.js 4.2.0 directly. The native profile requires macOS 14+, Apple Silicon, Swift 6, and Xcode Command Line Tools. Python setup is explicit and isolated under the supplied home directory.

The JavaScript runtimes depend directly on @huggingface/transformers 4.2.0 and phonemizer 1.2.1. Their non-streaming English adapter is derived from kokoro-js 1.2.1 commit 664c76a704021239ba59c84dcbaa4d3dece01fe9 and loads the 28 bundled voice tensors module-relatively in Node or Bun. Browser support is not provided by this package.

Packed contents include built JavaScript and declarations for all three exports, the Python worker, 28 voices, the complete pinned Swift package including Package.resolved, and all license and notice files. Generated binaries, model data, and build caches are not included.

The package's SPDX license expression is MIT AND Apache-2.0: original package code is MIT-licensed, while the adapted files and bundled Kokoro voice assets identified in THIRD_PARTY_NOTICES are Apache-2.0-licensed.