> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pipecat.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Lokutor Speech-to-Text

> LokutorSTTService streams real-time speech-to-text over a WebSocket to Lokutor's own Conv recognition model.

> [!NOTE]
>
> **Community-maintained integration.** This service is built and
> maintained by
> [lokutor-ai](https://github.com/lokutor-ai)
> . Pipecat does not test or officially support it. Please report issues and
> request changes on the
> [source repository](https://github.com/lokutor-ai/pipecat-lokutor)
> . Learn more about
> [community integrations](https://docs.pipecat.ai/api-reference/server/services/community-integrations.md)
> .

## Overview

`LokutorSTTService` streams audio to [Lokutor](https://lokutor.com)'s real-time
recogniser (`wss://api.lokutor.com/ws/stt`) and pushes `InterimTranscriptionFrame`
and `TranscriptionFrame` results. One model covers nine languages (`en`, `es`,
`ca`, `gl`, `eu`, `pt`, `fr`, `it`, `de`), and the language can be set or left
for the service to detect.

> [card] [Source Repository](https://github.com/lokutor-ai/pipecat-lokutor)
>
> Source code, examples, and issues for the Lokutor integration

> [card] [PyPI Package](https://pypi.org/project/pipecat-lokutor/)
>
> The `pipecat-lokutor` package on PyPI

> [card] [Lokutor App](https://app.lokutor.com)
>
> Get an API key

> [card] [Documentation](https://docs.lokutor.com)
>
> Lokutor API and service documentation

## Installation

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

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

## Prerequisites

1. **Lokutor Account**: Sign up and get an API key at [app.lokutor.com](https://app.lokutor.com)
2. **Audio input at 16 kHz mono** (Pipecat's default). The service refuses to
   start on any other input rate; set `audio_in_sample_rate=16000` in
   `PipelineParams`.

### Required Environment Variables

* `LOKUTOR_API_KEY`: Your Lokutor API key

## Configuration

**api\_key** `str` *required*

Lokutor API key (or a short-lived `wst_` ticket) used to authenticate the
WebSocket connection.

**base\_url** `str` (default: wss\://api.lokutor.com/ws/stt)

WebSocket URL of the STT endpoint.

**sample\_rate** `int` (default: None)

Must be `16000` or `None` (use the pipeline's rate, which must be 16 kHz).

**finalize\_on\_vad\_stop** `bool` (default: True)

Send `end` as soon as Pipecat's VAD reports that the user stopped speaking, so
the final transcript arrives promptly; the socket is then reopened for the
next utterance. Set to `False` to rely on the server's own end-of-utterance
detection (about 0.7 s of silence).

**settings** `LokutorSTTService.Settings` (default: None)

Runtime settings. See [Settings](#settings) below.

**ttfs\_p99\_latency** `float` (default: None)

P99 time from end of speech to final transcript, in seconds. Measure it for
your setup with the [Pipecat STT
benchmark](https://github.com/pipecat-ai/stt-benchmark).

### Settings

| Parameter | Type | Default | Description |
| - | - | - | - |
| `language` | `Language` | `EN` | Language of the audio. `None` lets the service detect it. |
| `keyterms` | `list[str]` | `None` | Custom vocabulary (up to 100 names or terms), written as you want them. |

## Usage

```python theme={null}
import os

from pipecat.pipeline.pipeline import Pipeline
from pipecat.transcriptions.language import Language
from pipecat_lokutor import LokutorSTTService

stt = LokutorSTTService(
    api_key=os.getenv("LOKUTOR_API_KEY"),
    settings=LokutorSTTService.Settings(
        language=Language.ES,
        keyterms=["Lokutor", "Pipecat"],
    ),
)

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

## Compatibility

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


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.