---
title: Getting started
description: Install the packages, add the Vite plugin, and speak your first sentence.
icon: rocket
---

1. **Install**

    Add the engines you need. Each one pulls in `@kucukkanat/speech-core` and `@kucukkanat/speech-audio`.

    ```sh
    bun add @kucukkanat/tts @kucukkanat/stt @kucukkanat/voices   # or npm i / pnpm add
    bun add @kucukkanat/speech-react                             # optional: React hooks
    ```

2. **Configure your bundler**

    The models run in Web Workers that ship inside the packages. Vite, esbuild and Bun take one plugin (webpack 5,
    Next.js and Rspack need none; see [Bundlers](/speech/guides/bundlers) for each setup). With Vite:

    ```ts no-check
    // vite.config.ts
    import { speechSdk } from "@kucukkanat/speech-core/vite";
    import react from "@vitejs/plugin-react";
    import { defineConfig } from "vite";

    export default defineConfig({
      plugins: [react(), speechSdk({ isolation: true })],
    });
    ```

3. **Speak**

    ```ts
    import { createTTS } from "@kucukkanat/tts";

    const tts = createTTS();

    // Call from a click handler the first time: browsers only allow audio after a user gesture.
    document.querySelector("button")?.addEventListener("click", async () => {
      await tts.speak("Hello! This voice is generated entirely inside your browser.");
    });
    ```

4. **Listen**

    ```ts
    import { createSTT } from "@kucukkanat/stt";

    const stt = createSTT();
    const session = stt.listen(); // loads the model on first use, then opens the microphone
    session.on("update", ({ committed, partial }) => console.log(committed, partial));
    setTimeout(() => session.stop(), 10_000);
    console.log("Final:", (await session).text);
    ```

## Browser requirements

| | Needs |
|---|---|
| Text-to-speech | **WebGPU** (recent Chrome/Edge, Safari 26+). Without it, `load()` rejects with `webgpu-required`. |
| Speech-to-text | WebGPU or WASM with Moonshine; WebGPU with Voxtral Realtime. |
| Microphone | A secure context: HTTPS or `localhost`. |
| Cross-origin isolation | Optional. Makes the WASM fallback multi-threaded. |

Check up front instead of waiting for an error:

```ts
import { detectCapabilities } from "@kucukkanat/speech-core";

const caps = await detectCapabilities(); // never throws; everything is false during SSR
if (!caps.webgpu) console.warn("No WebGPU: text-to-speech won't run here.");
if (!caps.secureContext) console.warn("The microphone needs HTTPS or localhost.");
```

:::tip
Models download from Hugging Face on first use (Chatterbox Turbo ~725 MB, Moonshine ~158 MB) and are cached by the
browser, so later visits start in seconds — even offline. See [Hosting](/speech/guides/hosting) to serve them yourself.
:::

## Next steps

**[Text-to-speech](/speech/packages/tts)**

Voices, streaming, karaoke, clips.

**[Speech-to-text](/speech/packages/stt)**

Microphone, files and custom streams.

**[React](/speech/packages/react)**

Hooks for every engine.

**[Voice cloning](/speech/guides/voice-cloning)**

Record, clone and speak.

**[Bundlers](/speech/guides/bundlers)**

Vite, esbuild, Bun, webpack, Next.js.

**[Playground](/speech/playground)**

Try everything in the browser.
