Skip to content

Gandr TTS in a Haystack pipeline.

One pip install, one component, and any Haystack pipeline can speak its answer.

Ask Claude CodeAsk ChatGPT

The whole integration

Install, construct, add to the pipeline.

Integration
pip install gandr-haystack

from gandr_haystack import GandrTTS

tts = GandrTTS(voice="gandr-mia")

The component fits a standard Haystack pipeline. The key comes from GANDR_API_KEY.

What it needs

What it takes

One packagepip install gandr-haystack
A keyGANDR_API_KEY in the environment
HaystackAny recent version with pipeline components
Python3.9 or newer

Speech as a pipeline component

Haystack pipelines are explicit graphs: documents in, answers out. GandrTTS slots in as a component at the end of the graph, so a pipeline that retrieves and answers can speak its result without an extra service.

The component fits a standard Haystack pipeline and reads its key from GANDR_API_KEY. The voice is set at construction.

What the flat stream changes

A retrieval pipeline can answer many queries in a day, and speaking every one of them is a bill on a per-character meter. On a flat stream the pipeline talks as much as the work needs and nothing is counted.

  • A component, not a sidecar service
  • One stream carries the whole pipeline workload
  • No per-character meter on spoken answers

Notes

Where in the pipeline does the TTS component go?

At the end, after the answer is produced. It takes the text and returns audio in place.

Which voice does the component use?

Whatever gandr- voice id you pass at construction, for example GandrTTS(voice="gandr-mia").

A key and one stream, and your pipeline speaks.

Get a key

Full API reference , gandr.ai/docs