> ## 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.

# Marimba Turn

> MarimbaTurnAnalyzer: local, audio-only end-of-turn detection with Charcot AI's multilingual Marimba model, on CPU or GPU

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

## Overview

`MarimbaTurnAnalyzer` is a turn analyzer that decides when the user has
finished speaking. It asks [Marimba](https://huggingface.co/charcot-ai/marimba),
a multilingual model that answers typed questions about audio, whether the
speaker has finished their turn, and reads the answer as a probability. It needs
no transcript and no API key, and it runs locally on CPU or GPU.

The model is described in the paper
[Marimba: A System One Model for Speech](https://arxiv.org/abs/2611.18330).

> [card] [Source Repository](https://github.com/Charcot-AI/marimba-api/tree/main/examples/pipecat)
>
> Code, example and README of the Pipecat integration

> [card] [Model Card](https://huggingface.co/charcot-ai/marimba)
>
> Marimba weights (Apache-2.0), evaluation and limits

## Installation

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

```bash theme={null}
uv add "marimba-audio[pipecat]"
```

## Prerequisites

No account or API key. Unless you pass `model`, the default Marimba model
downloads from Hugging Face on the first prediction.

* **Python 3.11 or later**
* **A VAD analyzer in the pipeline**, for example `SileroVADAnalyzer`

## Configuration

```python theme={null}
from marimba.integrations.pipecat import MarimbaTurnAnalyzer
```

`MarimbaTurnAnalyzer(model=None, threshold=0.5, num_channels=1, sample_rate=None, params=None)`

**threshold** `float` (default: 0.5)

Turn-end probability at or above which the turn is complete. Raises
`ValueError` when it is outside 0 to 1.

**model** `marimba.Marimba | None` (default: None)

Model to use. `None` loads the default Marimba model on the first prediction.

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

Input sample rate. `None` takes the transport's.

**num\_channels** `int` (default: 1)

Channel count of the incoming PCM16 audio; multichannel input is averaged to
mono before analysis.

**params** `SmartTurnParams | None` (default: None)

Timing parameters (`stop_secs`, `pre_speech_ms`, `max_duration_secs`), as for
[Smart
Turn](https://docs.pipecat.ai/api-reference/server/utilities/turn-detection/smart-turn-overview.md).

## Usage

Pass the analyzer to the user aggregator's stop strategy:

```python theme={null}
from marimba.integrations.pipecat import MarimbaTurnAnalyzer
from pipecat.audio.vad.silero import SileroVADAnalyzer
from pipecat.processors.aggregators.llm_response_universal import LLMUserAggregatorParams
from pipecat.turns.user_stop import TurnAnalyzerUserTurnStopStrategy
from pipecat.turns.user_turn_strategies import UserTurnStrategies

user_params = LLMUserAggregatorParams(
    user_turn_strategies=UserTurnStrategies(
        stop=[TurnAnalyzerUserTurnStopStrategy(turn_analyzer=MarimbaTurnAnalyzer())]
    ),
    vad_analyzer=SileroVADAnalyzer(),
)
```

## Compatibility

Tested with Pipecat v1.16.0 and `marimba-audio` 0.1.2 on Python 3.13. See the
[changelog](https://github.com/Charcot-AI/marimba-api/blob/main/CHANGELOG.md)
for the latest version.

## Notes

* **Audio window**: The analyzer scores the last eight seconds of the user's
  audio, resampled to 16 kHz.
* **Evaluation**: On Smart Turn's evaluation, turn-end AUROC is 0.930, against
  0.982 for Smart Turn v3.2; that evaluation is in-distribution for Smart Turn.
  Results and limits are on the
  [model card](https://huggingface.co/charcot-ai/marimba) and in the
  [paper](https://arxiv.org/abs/2611.18330).


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