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

# Speaker diarization with Docker

> Add speaker labels to a transcript on your own GPU servers, in any cloud or on premises.

The self-hosted diarization stack adds speaker labels to a transcript on your own GPU servers. You post the audio and its word timestamps, and get each word's speaker back in the same HTTP response. It's built to follow the [self-hosted Sync stack](https://assemblyai.com/docs/self-hosted/docker/sync.md): a Sync response with word timestamps posts to it as is. Audio and transcripts never leave your network.

> [!NOTE]
>
> Self-hosting requires a commercial agreement with AssemblyAI. [Contact our sales team](https://www.assemblyai.com/contact/sales) to discuss your needs.

Everything you need to deploy and operate the stack lives in the public [`streaming-self-hosting-stack`](https://github.com/AssemblyAI/streaming-self-hosting-stack) repository, and that repository is the source of truth. This page explains what the stack does and where to find things.

## How it works

The stack is two Docker Compose services: a GPU container that serves the diarization API, and a license proxy that validates your license and reports usage. It needs an NVIDIA T4 or newer GPU with at least 16 GB of memory.

To transcribe and label speakers in one deployment, run the repository's sync-and-diarization example. It runs both services with one license proxy and one license file, on one GPU or on two.

## Request and response

`POST /v1/diarize` takes `multipart/form-data` with two parts:

* `audio`: the audio file.
* `transcript`: JSON with a `words` array, where each word has `text`, `start` and `end` in milliseconds. A [Sync STT](https://assemblyai.com/docs/self-hosted/docker/sync.md) response requested with `"timestamps": true` has this shape already.

The response has `words` and `utterances`, each with a `speaker` label (`A`, `B`, …) and a `speaker_confidence`, and a `speakers` list. The model reports at most 8 speakers. As with the Sync stack, the service doesn't check credentials, but every request needs a non-empty `Authorization` header.

By default the stack accepts up to 1 hour of audio and handles one request at a time. The stack's README explains how to change both.

This is a separate API from the hosted API's [speaker diarization](https://assemblyai.com/docs/pre-recorded-audio/label-speakers.md), which you turn on with `speaker_labels` in a Pre-recorded STT request.

## Getting started

1. Ask your AssemblyAI representative for a license file and image-pull credentials.
2. Complete the prerequisites in the [repository README](https://github.com/AssemblyAI/streaming-self-hosting-stack#readme).
3. Follow the [diarization stack's README](https://github.com/AssemblyAI/streaming-self-hosting-stack/tree/main/diarization/docker), or the [sync-and-diarization example](https://github.com/AssemblyAI/streaming-self-hosting-stack/tree/main/examples/sync-diarization) to run it with Sync STT.

## Support

For deployment questions, image access, license issues, or to report bugs, contact your AssemblyAI representative.
