Skip to main content

pipecat-moses

Moses realtime speech-to-text and text-to-speech for Pipecat.

  • Speech-to-text in 25 European languages: partial transcripts while the user speaks, and the final as soon as Pipecat's VAD hears the end of the turn (the service sends flush, so there is no second pause to wait for).
  • Text-to-speech in 7 languages (English, German, French, Italian, Portuguese, Spanish, Dutch), with 27 built-in voices or your own recorded voice. The LLM's tokens are streamed as they arrive; the first audio of an answer starts after the first clause.
  • Hosted in Germany, nothing stored: audio, text and transcripts are processed in memory and dropped. Only the amount (seconds of audio, characters) is recorded for billing. Prepaid credit, no subscription.

Maintained by Moses AI, the company behind the service.

Installation

uv add pipecat-moses        # or: pip install pipecat-moses

Get an API key with the TTS and STT scopes at moses-ai.com/console (new accounts come with trial credit) and set it as MOSES_API_KEY.

Usage

import os

from pipecat.pipeline.pipeline import Pipeline
from pipecat_moses import MosesSTTService, MosesTTSService

stt = MosesSTTService(
    api_key=os.environ["MOSES_API_KEY"],
    settings=MosesSTTService.Settings(language="de"),       # or None to detect the language
)
tts = MosesTTSService(
    api_key=os.environ["MOSES_API_KEY"],
    settings=MosesTTSService.Settings(voice="german/juergen", language="de"),
)

pipeline = Pipeline([
    transport.input(),
    stt,
    user_aggregator,
    llm,
    tts,
    transport.output(),
    assistant_aggregator,
])

MosesSTTService

Argument Default
api_key required Key with the STT scope
url wss://moses-ai.com/stt/realtime
sample_rate pipeline input rate 8000, 16000, 24000, 32000 or 48000
flush_on_vad_stop True Send flush when Pipecat's VAD reports the end of speech
ttfs_p99_latency measured value P99 end of speech → final transcript, used by Pipecat's turn strategies

Settings (change them at runtime with STTUpdateSettingsFrame; no reconnect):

Field Default
language None (detect) bg cs da de el en es et fi fr hr hu it lt lv mt nl pl pt ro ru sk sl sv uk. Set it when you know it: short utterances are then decoded again in that language if they come out as English.
endpoint_ms server default (300) The server's own end-of-utterance pause, 100–3000 ms
interim_results True Partial transcripts

MosesTTSService

Argument Default
api_key required Key with the TTS scope
url wss://moses-ai.com/tts/realtime
warmup True Reserve a voice worker for the connection at once, for the fastest first audio
text_aggregation_mode TOKEN Stream tokens and let Moses cut clauses; SENTENCE sends whole sentences

Settings (change them at runtime with TTSUpdateSettingsFrame; applied from the next segment):

Field Default
voice alba English: alba, anna, vera, marius, jean, … (21 voices); german/juergen, french/estelle, italian/giovanni, portuguese/rafael, spanish/lola, dutch/daan; your own voice: clone:<name>. List: GET https://moses-ai.com/tts/v1/voices
language the voice's en de fr it pt es nl. With clone:<name>, your voice speaks that language
first_chunk_chars 30 Minimum length before the first segment may be cut at a comma

Audio comes as 24 kHz PCM; Pipecat resamples it to the pipeline's output rate.

Running the example

examples/voice_agent.py is a complete voice agent (Moses STT and TTS, an OpenAI LLM, Silero VAD) on Pipecat's development runner:

git clone https://github.com/mosesplatform/pipecat-moses && cd pipecat-moses
uv sync --extra example
cp env.example .env              # MOSES_API_KEY, OPENAI_API_KEY
uv run examples/voice_agent.py   # open http://localhost:7860/client and talk

MOSES_LANGUAGE=de MOSES_VOICE=german/juergen uv run examples/voice_agent.py talks German.

Latency

Measured from Germany, network included:

  • STT: the final transcript arrives about 0.15 s after Pipecat's VAD reports the end of speech.
  • TTS: the first audio arrives about 0.12 s after the first text.

Limits and errors

  • Per account at once: 2 STT streams and 2 TTS connections by default (ask for more). Each bot uses one of each.
  • A wrong key, a key without the needed scope, or no credit stops the service with an error instead of reconnecting. A lost worker or a full server is retried.
  • revision events (a final decoded again in the set language) are logged, not pushed: the first final has already gone to the LLM.

Compatibility

Tested with Pipecat 1.17.0. Python 3.11+.

License

BSD 2-Clause, see LICENSE.

Metadata

Release files for pipecat-moses 0.1.0

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

Source distribution (sdist)

Source distribution for pipecat-moses 0.1.0
File Size Uploaded Provenance Actions
pipecat_moses-0.1.0.tar.gz 16.6 kB Without provenance Details for pipecat_moses-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pipecat-moses 0.1.0
File Interpreter ABI Platform Actions
pipecat_moses-0.1.0-py3-none-any.whl Python 3 none any Details for pipecat_moses-0.1.0-py3-none-any.whl

Total release size: 32.1 kB

Release files / pipecat_moses-0.1.0.tar.gz

Download URL pipecat_moses-0.1.0.tar.gz
Size 16.6 kB
Tags Source
SHA-256 checksum
How to use checksums
88caee014c0e8302dc7c86501bbcea8e01eb4aac3821a530b7b20fd6434e4ec5
BLAKE2b-256 checksum
How to use checksums
3619b0c510d2b72ef729b68cdf191c7521402cd6f60aea1c4b1e27f45904b9b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.12 {"installer":{"name":"uv","version":"0.13.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / pipecat_moses-0.1.0-py3-none-any.whl

Download URL pipecat_moses-0.1.0-py3-none-any.whl
Size 15.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c90990da7718ce86c5c0a34547499fec050c99be4768b918a21156aefccfb6a3
BLAKE2b-256 checksum
How to use checksums
42bf4c78b2244343e767a48804f6aaa2eb541b7aa88b82b28981eb3d151da40b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.12 {"installer":{"name":"uv","version":"0.13.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for pipecat-moses 0.1.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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