> ## Documentation Index
> Fetch the complete documentation index at: https://daily-docs-pr-4892.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Lokutor

> Text-to-speech service implementation using Lokutor's CPU-only speech synthesis

export const CommunityMaintained = ({maintainer, maintainerUrl, repo}) => <Note>
    <strong>Community-maintained integration.</strong> This service is built and
    maintained by{" "}
    <a href={maintainerUrl} target="_blank" rel="noreferrer">
      {maintainer}
    </a>
    . Pipecat does not test or officially support it. Please report issues and
    request changes on the{" "}
    <a href={repo} target="_blank" rel="noreferrer">
      source repository
    </a>
    . Learn more about{" "}
    <a href="/api-reference/server/services/community-integrations">
      community integrations
    </a>
    .
  </Note>;

<CommunityMaintained maintainer="lokutor-ai" maintainerUrl="https://github.com/lokutor-ai" repo="https://github.com/lokutor-ai/pipecat-lokutor" />

## Overview

`LokutorTTSService` generates speech from text using [Lokutor](https://lokutor.com)'s
text-to-speech API over a persistent WebSocket connection. Lokutor runs on
CPU-only infrastructure and supports multiple languages (EN, ES, FR, PT, KO).
The service outputs `TTSAudioRawFrame`s.

<CardGroup cols={2}>
  <Card title="Source Repository" icon="github" href="https://github.com/lokutor-ai/pipecat-lokutor">
    Source code, examples, and issues for the Lokutor integration
  </Card>

  <Card title="PyPI Package" icon="cube" href="https://pypi.org/project/pipecat-lokutor/">
    The `pipecat-lokutor` package on PyPI
  </Card>

  <Card title="Lokutor App" icon="book" href="https://app.lokutor.com">
    Get an API key and test available voices
  </Card>

  <Card title="Documentation" icon="book" href="https://docs.lokutor.com">
    Lokutor API and service documentation
  </Card>
</CardGroup>

## Installation

This is a community-maintained package distributed separately from `pipecat-ai`:

```bash theme={null}
uv add pipecat-lokutor
```

## Prerequisites

### Lokutor Account Setup

Before using the Lokutor TTS service, you need:

1. **Lokutor Account**: Sign up and get an API key at [app.lokutor.com](https://app.lokutor.com)
2. **API Key**: Used to authenticate the WebSocket connection

### Required Environment Variables

* `LOKUTOR_API_KEY`: Your Lokutor API key (used by the example to populate `api_key`)

## Configuration

<ParamField path="api_key" type="str" required>
  Lokutor API key used to authenticate the WebSocket connection.
</ParamField>

<ParamField path="voice_id" type="str" default="F1">
  Identifier of the voice to use. Browse and test voices at
  [app.lokutor.com](https://app.lokutor.com).
</ParamField>

<ParamField path="sample_rate" type="int" default="44100">
  Output audio sample rate in Hz.
</ParamField>

<ParamField path="params" type="LokutorTTSService.InputParams" default="None">
  Runtime input parameters for generation. See [Input
  Parameters](#input-parameters) below.
</ParamField>

<ParamField path="settings" type="LokutorTTSSettings" default="None">
  Optional Pipecat TTS settings applied on top of the defaults.
</ParamField>

<ParamField path="base_url" type="str" default="wss://api.lokutor.com/ws">
  Base WebSocket URL for the Lokutor API.
</ParamField>

### Input Parameters

Runtime-configurable parameters passed via the `params` constructor argument
using `LokutorTTSService.InputParams(...)`.

| Parameter  | Type       | Default | Description                              |
| ---------- | ---------- | ------- | ---------------------------------------- |
| `language` | `Language` | `None`  | Synthesis language (EN, ES, FR, PT, KO). |
| `speed`    | `float`    | `1.0`   | Speech speed multiplier.                 |
| `steps`    | `int`      | `5`     | Number of synthesis steps.               |
| `visemes`  | `bool`     | `False` | Whether to request viseme data.          |

<Note>
  Available parameters and defaults are defined by the integration. See the
  [source repository](https://github.com/lokutor-ai/pipecat-lokutor) for the
  authoritative, up-to-date list.
</Note>

## Usage

```python theme={null}
from pipecat_lokutor import LokutorTTSService

tts = LokutorTTSService(
    api_key="your_api_key",
    voice_id="F1",
    params=LokutorTTSService.InputParams(
        language="en",
        speed=1.0,
        steps=5,
        visemes=False,
    ),
)

# ... add tts to your pipeline:
from pipecat.pipeline.pipeline import Pipeline

pipeline = Pipeline([
    transport.input(),
    stt,
    llm,
    tts,
    transport.output(),
])
```

## Compatibility

Tested with Pipecat v0.0.86+. Check the [source
repository](https://github.com/lokutor-ai/pipecat-lokutor) for the latest tested
version and changelog.
