Skip to main content

lazybird-haystack

Lazybird text to speech for Haystack. The LazybirdTextToSpeech component turns text into natural AI speech (MP3) in your pipelines and agents, for voiceovers, spoken answers, announcements and anything else that should talk.

Lazybird is an AI voiceover generator with realistic voices in 80 languages, voice cloning, voice design and a text to speech API.

Install

pip install lazybird-haystack

Requires Python 3.10 or later and Haystack 2.12 or later.

Set up your account

  1. Sign up for Lazybird. The free plan includes 3,000 credits to start, no credit card needed.
  2. Open Studio settings and create an API key.
  3. Set it as an environment variable:
export LAZYBIRD_API_KEY="your-api-key"

Usage

Text to speech

from lazybird_haystack import LazybirdTextToSpeech

tts = LazybirdTextToSpeech()
result = tts.run(text="Welcome back. Your report is ready.")
result["audio"].to_file("welcome.mp3")

run returns audio, a Haystack ByteStream with the MP3 and mime_type audio/mpeg. Text that starts with <speak> is sent as SSML, for pauses and pronunciation:

tts.run(text='<speak>Good morning. <break time="500ms"/> The front door is open.</speak>')

Voices, languages and settings

from lazybird_haystack import LazybirdTextToSpeech, list_voices

for voice in list_voices("british narrator")[:5]:
    print(voice["id"], voice["displayName"], voice["language"])

tts = LazybirdTextToSpeech(
    voice_id="tgJ2Hes6DauwTg8kFrRPLN",  # Elyssia, the default voice
    locale="es-ES",  # any voice can speak other languages and accents
    speed=1.1,  # 1 is normal (0.5 to 2)
    settings={"pitch": 1.0, "volume": 1.0},
)

list_voices returns your own voices first, then the Lazybird library. run also takes voice_id and settings to override them per call.

In a pipeline

PromptBuilder fills in a template and LazybirdTextToSpeech speaks it:

from haystack import Pipeline
from haystack.components.builders import PromptBuilder
from lazybird_haystack import LazybirdTextToSpeech

pipeline = Pipeline()
pipeline.add_component("template", PromptBuilder(template="Hi {{ name }}, your order {{ order }} has shipped."))
pipeline.add_component("tts", LazybirdTextToSpeech())
pipeline.connect("template.prompt", "tts.text")

result = pipeline.run({"template": {"name": "Maya", "order": "1042"}})
result["tts"]["audio"].to_file("order.mp3")

To load a saved pipeline in Haystack 3, add this package to the trusted modules: Pipeline.loads(yaml, allowed_modules=["lazybird_haystack"]).

Spoken answers from an LLM

from haystack import Pipeline
from haystack.components.builders import ChatPromptBuilder
from haystack.components.converters import OutputAdapter
from haystack.components.generators.chat import OpenAIChatGenerator
from haystack.dataclasses import ChatMessage
from lazybird_haystack import LazybirdTextToSpeech

template = [ChatMessage.from_user("Answer in two short sentences: {{ question }}")]

pipeline = Pipeline()
pipeline.add_component("prompt", ChatPromptBuilder(template=template, required_variables=["question"]))
pipeline.add_component("llm", OpenAIChatGenerator())  # needs OPENAI_API_KEY
pipeline.add_component("answer", OutputAdapter(template="{{ replies[0].text }}", output_type=str))
pipeline.add_component("tts", LazybirdTextToSpeech())
pipeline.connect("prompt.prompt", "llm.messages")
pipeline.connect("llm.replies", "answer.replies")
pipeline.connect("answer.output", "tts.text")

result = pipeline.run({"prompt": {"question": "Why is the sky blue?"}})
result["tts"]["audio"].to_file("answer.mp3")

Errors

An invalid API key, missing credits or another failed request raises LazybirdError with a message that says what to fix.

Pricing

One credit is one character of text, shared between the Lazybird studio and the API. The free plan includes 3,000 credits to start; paid plans start at $9 a month and include commercial usage rights. See pricing.

Resources

License

MIT

Metadata

Release files for lazybird-haystack 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lazybird-haystack 0.1.2
File Size Uploaded Provenance Actions
lazybird_haystack-0.1.2.tar.gz 7.9 kB With provenance Details for lazybird_haystack-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lazybird-haystack 0.1.2
File Interpreter ABI Platform Actions
lazybird_haystack-0.1.2-py3-none-any.whl Python 3 none any Details for lazybird_haystack-0.1.2-py3-none-any.whl

Total release size: 14.8 kB

Release files / lazybird_haystack-0.1.2.tar.gz

Download URL lazybird_haystack-0.1.2.tar.gz
Size 7.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ac422556000f16e81427526035de380cf5f1879c6fe2c890d3a9e678c0def7dd
BLAKE2b-256 checksum
How to use checksums
ad9da7208ef9c91cb7ee405f5610a1c991f945b43060b1a4d9e4e20b0bc99440
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

Release files / lazybird_haystack-0.1.2-py3-none-any.whl

Download URL lazybird_haystack-0.1.2-py3-none-any.whl
Size 6.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
713fdeee4e63ffa6b844e3117893dddc61f1542d87e76a5bb85b21a3b122e84e
BLAKE2b-256 checksum
How to use checksums
aa5031242effae3a5391edd6205c5ac5ee4635b30405667e29eed0b510cfbfaf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

Security for lazybird-haystack 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for lazybird_haystack-0.1.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page