Skip to main content

pipecat-floe

Floe services for Pipecat. One Floe key for the LLM, STT, and TTS legs of a voice agent — metered per call with pre-call spend caps.

Three drop-in Pipecat services:

  • FloeLLMService — OpenAI-compatible LLM routed through Floe.
  • FloeTTSService — OpenAI-compatible text-to-speech routed through Floe.
  • FloeSTTService — streaming speech-to-text over Floe's WebSocket.

Install

pip install pipecat-floe

This pulls in pipecat-ai, websockets, httpx, and loguru. For the example bot you also want a transport + VAD:

pip install "pipecat-ai[silero,websocket]"

Pipecat version compatibility

Built and verified against pipecat-ai 1.7.0 (Python 3.11+). The services subclass Pipecat's own OpenAILLMService, OpenAITTSService, and WebsocketSTTService. Those base classes are stable, but Pipecat's import paths and constructor kwargs do shift between releases — pin pipecat-ai and re-verify when you upgrade.

Quickstart

One key powers all three legs. Set FLOE_API_KEY in your environment (get a key at dev-dashboard.floelabs.xyz) and:

from pipecat_floe import FloeSTTService, FloeLLMService, FloeTTSService

stt = FloeSTTService()                              # streaming STT (WebSocket)
llm = FloeLLMService(model="openai/gpt-4o-mini")    # OpenAI-compatible
tts = FloeTTSService(model="openai/tts-1", voice="alloy")

# ...then drop stt / llm / tts into a Pipecat Pipeline as usual.

Three legs, one Floe key, one budget. Each service reads FLOE_API_KEY from the environment (or pass api_key=...). A single spend cap on the agent bounds the whole run — STT, LLM, and TTS together.

See examples/bot.py for a runnable pipeline wiring a WebSocket transport → STT → LLM → TTS.

Run the example

cd examples
pip install -r requirements.txt
cp .env.example .env      # fill in FLOE_API_KEY
python bot.py             # WebSocket server on ws://localhost:8765

Connect an audio WebSocket client to ws://localhost:8765 and talk. Full instructions in examples/README.md.

Public API

FloeLLMService(
    *, model="openai/gpt-4o-mini", api_key=None,
    base_url="https://credit-api.floelabs.xyz/v1", task_id=None, **kwargs
)

FloeTTSService(
    *, model="openai/tts-1", voice="alloy", api_key=None,
    base_url="https://credit-api.floelabs.xyz/v1", task_id=None, **kwargs
)

FloeSTTService(
    *, model="deepgram/nova-3", encoding="linear16", sample_rate=16000,
    language="en", api_key=None,
    base_url="wss://credit-api.floelabs.xyz/v1/audio/transcriptions/stream",
    **kwargs
)
  • api_key defaults to the FLOE_API_KEY environment variable; a ValueError is raised if neither is set.
  • task_id (LLM/TTS) tags calls with an X-Floe-Task-Id header so a per-task budget can bound one conversation.
  • **kwargs pass through to the underlying Pipecat base class (temperature, custom settings, keepalive, reconnect options, ...).

Limits / footguns

Limit Detail
STT is a dedicated plugin, not a base-URL swap The LLM and TTS legs are OpenAI-compatible base-URL swaps. Streaming STT is notFloeSTTService speaks Floe's own WebSocket protocol (raw PCM up, JSON transcripts down). You cannot point Pipecat's OpenAISTTService at Floe for streaming.
Model IDs must be fully qualified Use provider/model, e.g. openai/gpt-4o-mini, anthropic/claude-sonnet-4-6, deepgram/nova-3, openai/tts-1. A bare gpt-4o-mini will be rejected by Floe.
STT audio format PCM only, in the declared encoding (linear16 / mulaw / alaw) at sample_rate 8000–48000. Pipecat delivers linear16 PCM by default, which matches.
TTS sample rate The underlying OpenAI TTS service emits 24 kHz PCM; passing a different sample_rate logs a warning.
task_id on TTS Attached via a custom httpx client's default headers. If you pass your own http_client, task_id is ignored for TTS (add the header to your client yourself).
Welcome credit A new Floe agent key comes with welcome credit that covers the first calls. After that, keep the agent funded or capped — an empty balance surfaces as a {"type":"error","code":"insufficient_balance"} on STT and an error frame on LLM/TTS.
Pipecat version Pinned to pipecat-ai 1.7.0 (see above). Re-verify on upgrade.

How it works

  • LLM / TTS — thin subclasses of Pipecat's OpenAILLMService / OpenAITTSService pointed at https://credit-api.floelabs.xyz/v1 with your Floe key. Streaming, metrics (usage + TTFB), and OpenTelemetry tracing are inherited unchanged.
  • STT — a subclass of Pipecat's WebsocketSTTService (the same base used by Deepgram and Gladia). It opens wss://credit-api.floelabs.xyz/v1/audio/transcriptions/stream with an Authorization: Bearer <FLOE_API_KEY> header, streams frame.audio PCM up, and maps is_final:falseInterimTranscriptionFrame, is_final:trueTranscriptionFrame. A server {"type":"error"} is pushed to the pipeline as an ErrorFrame and the stream is torn down cleanly. Reconnect-with-backoff and audio buffering come from the base class.

License

MIT — see LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pipecat_floe-0.1.0.tar.gz (15.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pipecat_floe-0.1.0-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file pipecat_floe-0.1.0.tar.gz.

File metadata

  • Download URL: pipecat_floe-0.1.0.tar.gz
  • Upload date:
  • Size: 15.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pipecat_floe-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5160f4eeec4ac15a67a6fb8861125d7ec699a75a3119300f362d9b4f09aa051e
MD5 6125864a9addccdb03f4c01782b77c17
BLAKE2b-256 88653dd601abff722a0d4e3d2ab4d3750a3f24a36dc81280db43f26c3b2e6ab6

See more details on using hashes here.

File details

Details for the file pipecat_floe-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pipecat_floe-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pipecat_floe-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e1a09c25ad00eb2c09de93654435bdc2cda31aeb8760a7fde7f3ab1f0c9a834c
MD5 beac1407fe4626946b0e0476e86a4f7f
BLAKE2b-256 503200e32d0f9d493f09376c3d36b6ac3cb65d9fe9ade2666cac87ee8015b026

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page