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

# turn-1-mini

> Local, audio-only end-of-turn detection with p99lab's turn-1-mini model

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="P99Lab" maintainerUrl="https://github.com/P99Lab" repo="https://github.com/P99Lab/pipecat-p99lab" />

## Overview

`LocalTurn1MiniAnalyzer` is a turn analyzer that decides when the user has
finished speaking. It runs [turn-1-mini](https://huggingface.co/p99lab/turn-1-mini),
a 5.3M-parameter causal streaming model, on the user's audio. It needs no
transcript, no API key and no GPU: the model runs locally on one CPU core.

It is used wherever Pipecat accepts a turn analyzer, with the same wiring as the
turn analyzers that ship with Pipecat.

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

  <Card title="Model Card" icon="cube" href="https://huggingface.co/p99lab/turn-1-mini">
    turn-1-mini weights (Apache-2.0), evaluation and limits
  </Card>
</CardGroup>

## Installation

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

```bash theme={null}
uv pip install git+https://github.com/P99Lab/pipecat-p99lab
```

## Prerequisites

No account or API key. The model (22 MB) downloads from Hugging Face on first
use and then works offline.

* **A VAD analyzer in the pipeline**, for example `SileroVADAnalyzer`
* **English audio**: the model is trained and evaluated on English only

## Configuration

`LocalTurn1MiniAnalyzer(params=Turn1MiniParams(...))`

| Parameter | Default | Description |
| - | - | - |
| `threshold` | `0.5` | Probability above which the turn is treated as finished. Lower is faster and interrupts more; higher is more patient. |
| `fallback_secs` | off | Optional: end the turn after this much silence if the score during the silence reached `fallback_threshold`. Shortens long waits after short answers. |
| `fallback_threshold` | off | Score needed for the fallback to apply. |

Presets: `Turn1MiniParams.fast()` (0.2), `Turn1MiniParams.balanced()` (0.5,
default) and `Turn1MiniParams.patient()` (0.7).

## Usage

```python theme={null}
from pipecat.audio.vad.silero import SileroVADAnalyzer
from pipecat.turns.user_stop import TurnAnalyzerUserTurnStopStrategy
from pipecat.turns.user_turn_strategies import UserTurnStrategies
from pipecat_p99lab import LocalTurn1MiniAnalyzer

turn_strategies = UserTurnStrategies(
    stop=[TurnAnalyzerUserTurnStopStrategy(turn_analyzer=LocalTurn1MiniAnalyzer())]
)

# Pass to the user aggregator:
# LLMUserAggregatorParams(user_turn_strategies=turn_strategies, vad_analyzer=SileroVADAnalyzer())
```

A complete example is in the repository's
[`examples/foundational`](https://github.com/P99Lab/pipecat-p99lab/tree/main/examples/foundational)
folder.

## Compatibility

Tested with Pipecat v1.12.0 and v0.0.108, Python 3.12.

## Notes

* Known weak spot: after a short answer followed by silence, the model can wait
  for the timeout. The `fallback_secs` option addresses this.
* Maintained by p99lab, the company that makes turn-1-mini. Contact:
  [research@p99lab.com](mailto:research@p99lab.com)


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