Skip to main content

Overview

FloeBudgetGuardProcessor is a floe-guard budget processor for Pipecat. Drop one processor after your LLM service and it enforces a spend ceiling one turn at a time — it reserves before a turn, settles on the real usage the pipeline reports, and hard-stops a turn that would cross your budget (so a runaway agent dies at 0.10,notontheinvoice).ItpriceseverylegofthecallSTT(0.10, not on the invoice). It prices every leg of the call — STT (/sec), LLM (/token),TTS(/token), TTS (/1k chars), and telephony ($/min) — from a cost map bundled with the package, so you get a per-call receipt with no account, no API key, and no network calls.

Source Repository

Source code, examples, and issues for floe-guard

PyPI Package

The floe-guard package on PyPI

Runnable demo

A no-network, no-key example that prints a per-leg call receipt

Documentation

floe-guard’s Pipecat setup notes

Installation

This is a community-maintained package distributed separately from pipecat-ai:

Prerequisites

None. floe-guard runs entirely in your process — no account, no API key, no environment variables, and no network calls. Prices come from a cost map that ships with the package.

Configuration

FloeBudgetGuardProcessor takes a BudgetGuard (your ceiling) and, optionally, the voice-map vendor for each leg so STT / TTS / telephony are priced automatically: A leg with no vendor and no per-unit override is left un-metered; an unpriceable vendor fails closed rather than metering at a silent $0. Pass a per-unit override for a negotiated rate.

Usage

Place the processor directly after the LLM service, and create the PipelineTask with usage metrics enabled (Pipecat only emits usage frames when they are on):
LLM and TTS auto-meter from the frames Pipecat emits. STT and telephony have no native usage frame, so meter them explicitly (e.g. budget.meter_telephony(1.5) for a 1.5-minute call). A blocked turn pushes a fatal ErrorFrame by default, or invokes your on_budget_exceeded callback. See the runnable example — it runs with no API key and no network and prints a per-leg receipt.

Compatibility

Tested with Pipecat 1.x. floe-guard[pipecat] requires pipecat-ai>=1.0.