Skip to main content

urun-pipecat

uRun services for Pipecat — build voice agents and pipelines on uRun's OpenAI-compatible inference endpoint.

Contents

Get started

Talk to a voice agent from your terminal — speech in through your microphone, spoken reply back out. Python 3.11+.

Install the package (sounddevice, the audio backend on macOS and Windows, comes with it — its wheels bundle PortAudio; on Linux, capture and playback go through the PipeWire command-line tools):

pip install urun-pipecat

Authenticate with a uRun API key from the uRun console:

export URUN_API_KEY="urun_sk_..."

Run the demo:

python -m urun_pipecat.examples.mic

Wear headphones, wait for the status line to show ● Listening…, and speak. The session renders as a scrolling transcript: what you say appears as a grey line that commits when your turn ends, the agent's reply appears as text while its speech plays, and the session ends after 60 seconds (○ Session ended). Pick a mic with --check-mic first if capture fails; it runs a two-second keyless capture check.

On Linux, the mic and the speaker run through PipeWire — make pw-record, pw-play, and pw-dump available on your PATH (pipewire-bin on Ubuntu). See the mic example's README for platform details and flags.

What it provides

An LLM service, streaming speech-to-text, speech synthesis, a combined speech-to-speech service, and a wrapper that colocates a whole voice pipeline onto one speech-to-speech session. One runtime dependency: pipecat-ai[openai]>=1.11,<2.

UrunLLMService extends Pipecat's OpenAILLMService to work with https://inference.urun.sh/v1:

  • OpenAI-compatible chat completions — streaming, tools, structured output, all through the endpoint's /v1/chat/completions lane.
  • Reasoning as thought frames — reasoning-capable uRun models stream reasoning on the delta's reasoning_content field (never inside content). The service maps it to LLMThoughtStartFrame / LLMThoughtTextFrame / LLMThoughtEndFrame, so reasoning is available to observers and logging without being sent to TTS.
  • Loud authentication — a uRun API key is required at construction (argument or URUN_API_KEY); a missing key fails immediately, not on the first request.

UrunTTSService is a thin wrapper over Pipecat's OpenAITTSService for uRun's /v1/audio/speech lane (24 kHz mono PCM16): the same defaults (endpoint, API-key handling, qwen3-tts-customvoice:bf16, voice "Ryan", 24 kHz) and any voice string — uRun validates voices server-side against the model's published list and answers a 400 naming the accepted set.

from urun_pipecat import UrunTTSService

tts = UrunTTSService()  # uses URUN_API_KEY from the environment

UrunSTTService extends Pipecat's OpenAIRealtimeSTTService for uRun's realtime transcription session (wss://inference.urun.sh/v1/realtime): streaming interim and final transcript frames, the same loud API-key handling, and the default model nemotron-3.5-asr:fp16. uRun binds the session to its model at WebSocket upgrade time, so the service appends &model=... to the session URL at connect time and strips the model from the session configuration it sends afterwards. The session offers no server-side turn detection, so the pipeline's local VAD (e.g. Silero) drives the audio-buffer commits — finals arrive at utterance boundaries rather than continuously, and interim text between boundaries is not durable.

The service also exposes consumed_audio_seconds: the audio it has actually handed to the endpoint, counting sends that completed. A feeder can subtract it from what it pushed to know how much of its audio is still queued and bound that backlog.

from urun_pipecat import UrunSTTService

stt = UrunSTTService()  # uses URUN_API_KEY from the environment

UrunRealtimeVoiceService extends Pipecat's OpenAIRealtimeLLMService for uRun's combined voice-agent realtime session (wss://inference.urun.sh/v1/realtime?model=voice-agent): one speech-to-speech session that takes the user's speech continuously and returns the agent's speech and transcript. The model rides the connect URL — the session keeps the model it was dialed with. The endpoint does its own turn detection: the pipeline sends whatever audio arrives, resampled to the session's 24 kHz mono PCM when the transport captures at another rate. Pass transcript_preview=True to also receive the transcription model's live hypothesis of the open utterance as replaceable preview frames — display-only, never part of the conversation history. Off by default; an endpoint without the feature ignores the opt-in and the session runs unchanged.

from urun_pipecat import UrunRealtimeVoiceService

service = UrunRealtimeVoiceService(model="voice-agent")
pipeline = Pipeline([transport.input(), service, transport.output()])

A headset conversation with it, no room needed, is the local microphone example.

Usage

from urun_pipecat import UrunLLMService

llm = UrunLLMService()  # uses URUN_API_KEY from the environment

or explicitly:

llm = UrunLLMService(
    api_key="urun_sk_...",
    settings=UrunLLMService.Settings(
        model="qwen3.8-27b:nvfp4",  # any id from GET /v1/models
        system_instruction="You are a helpful voice assistant.",
    ),
)

Use it anywhere a Pipecat LLM service fits, e.g. in a Pipeline:

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

See the examples shipped inside the package for complete, runnable voice pipelines:

Three ways to run a voice pipeline

The same trio of models — ears, brain, voice — can run on uRun three ways, and it is worth keeping them apart:

  • A Pipecat-managed cascade is what the three services build: three independent network lanes — a realtime transcription session, a chat-completions stream, a speech-synthesis call — with Pipecat owning the turns. The pipeline's local VAD declares utterance boundaries, the context aggregators assemble the conversation, tools work, and each lane can use any model from GET /v1/models. Every turn pays three network round trips.
  • A speech-to-speech session (uRun's s2s pool) is a different surface, with or without Pipecat: one duplex WebSocket — audio goes up, transcripts and speech come back down — with turn detection server-side. The three models are fixed when the session starts and share one serving stack. No pipeline code is involved; any client that speaks the session protocol can use it.
  • One-GPU colocation is that same session applied to a Pipecat pipeline: UrunColocated keeps the Pipecat graph — transport, context, bookkeeping — and moves the trio onto one speech-to-speech session, so the three models share one GPU stack behind a single socket instead of three lanes.
Standalone cascade Speech-to-speech session UrunColocated
Who runs the turn Pipecat (local VAD, aggregators) the session, server-side the session; turns mirrored into the context for bookkeeping
Network three lanes one duplex WebSocket one duplex WebSocket
Models any per lane (GET /v1/models) the session's trio, fixed at dial time the colocatable trio (table below)
Pipecat context, tools, transport full none — no Pipecat involved context and transport carry over; tools and pre-seeded context have no wire path yet (v1)

The rest of this section covers the colocation wrapper.

Colocated voice pipelines

A standalone voice pipeline drives three network lanes — a realtime transcription session, a chat-completions stream, a speech synthesis call — so every turn pays three round trips and the three models sit on three serving stacks. uRun's s2s pool colocates all three on one GPU stack behind a single duplex session (the GPT-Live protocol on /v1/live/sessions): audio goes up one socket, transcripts and speech come back down it, and the models share one weights' memory instead of three HTTP lanes.

UrunColocated(pipeline) moves a pipeline onto that session. Wrapping is recognition, not rewriting: build the standalone pipeline exactly as you already do, then wrap it before constructing the PipelineWorker (the worker runs the pipeline object it was constructed with):

from loguru import logger

from urun_pipecat import UrunColocated, UrunColocationError

try:
    pipeline = UrunColocated(pipeline)  # same models, one session
except UrunColocationError:
    # The application owns the fallback. The library never degrades
    # silently: on any refusal the original pipeline is untouched, so
    # log the downgrade loudly and keep serving the same models on
    # the standalone lanes (or re-raise — the choice is the app's).
    logger.warning("colocation rejected; running the standalone pipeline")

The matcher reads the pipeline's behaviour — the models the services are plumbed to use and the hosts they point at — never their class names, so a pipeline of stock OpenAI-shaped services pointed at uRun wraps exactly as well as one using this package's services. It recognizes the voice shape [transport input, STT, user aggregator, LLM, TTS, transport output, assistant aggregator] and replaces the three services with one UrunColocatedSession; the transport processors and the two context aggregators (so your LLMContext) carry over unchanged. The session derives its URL from the chat/speech base (https://host/v1 becomes wss://host/v1/live/sessions; override with the sessions_url argument), requires the same uRun API key, and connects when the pipeline runs — wrapping is offline-safe.

A trio colocates when each model has a slot on the s2s pool:

Lane Colocatable models (quantization suffix ignored)
STT parakeet-tdt-0.6b-v3, whisper-large-v3-turbo, qwen3-asr-1.7b
LLM qwen3.8-27b, gemma-4-12b, phonellm-mini-alpha-2-nvfp4
TTS qwen3-tts-1.7b-base, qwen3-tts-customvoice, qwen3-tts-voicedesign, kokoro-82m, breeze-tts-2

An uncolocatable model, a different shape, or services pointing at different deployments raises UrunColocationError — the wrap never falls back on its own. What the colocated path does differently, it says at wrap time, loudly:

  • the session speaks the pool's configured default voice — the standalone TTS voice setting has no effect on the colocated path;
  • tools registered on the context cannot be called by the colocated engine, and pre-seeded context messages have no wire path to it (v1);
  • the pool does not yet consume the system instruction (v1) — it is forwarded on the session start for when it does;
  • the session is duplex and turn detection is server-side: it responds to spoken audio, and the local VAD/aggregators mirror the turns into the context for bookkeeping.

Run the colocated example (needs a Daily room):

python -m urun_pipecat.examples.colocated

Environment variables

Variable Required Description
URUN_API_KEY yes (unless api_key is passed) A uRun organization API key.
URUN_BASE_URL no Base URL of the chat and speech lanes, overriding the hosted default.
URUN_STT_BASE_URL no WebSocket base URL of the realtime transcription lane, overriding the hosted default.
URUN_MODEL no Chat model id; any id from GET /v1/models.
URUN_TTS_MODEL no Speech model id.
URUN_STT_MODEL no Transcription model id.
DAILY_ROOM_URL for the foundational and colocated examples Daily room URL for the voice pipeline.
DAILY_TOKEN no Daily meeting token for the foundational example.

Running the examples

The foundational and recorded examples build the same voice pipeline: Silero VAD and the three uRun services — the LLM (UrunLLMService), streaming STT (UrunSTTService over uRun's realtime transcription session, nemotron-3.5-asr:fp16; the pipeline's local VAD drives the commits), and TTS (UrunTTSService: qwen3-tts-customvoice:bf16, voice "Ryan", 24 kHz). The colocated example builds the same graph with the colocatable trio pinned (Parakeet TDT 0.6B v3 → Qwen3.8-27B → Qwen3-TTS) and wraps it with UrunColocated — see the colocation section above.

git clone https://github.com/urun-sh/urun-pipecat
pip install -e "urun-pipecat[example]"    # from PyPI once the first release is published
export URUN_API_KEY="urun_sk_..."

# A live room conversation (needs a Daily room):
export DAILY_ROOM_URL="https://your-domain.daily.co/?room=..."
python -m urun_pipecat.examples.foundational

# Or a recorded one (no room, no microphone): speak a WAV into the
# pipeline and get the bot's reply back as a WAV. The input must be mono
# 16-bit 24 kHz PCM — convert with `ffmpeg -i input.wav -ar 24000 -ac 1
# -c:a pcm_s16le input-24k.wav`.
python -m urun_pipecat.examples.recorded input-24k.wav

# Or talk to the combined voice-agent with your microphone and speakers
# (real hardware, and the PipeWire/PortAudio prerequisites described in
# the [mic example's README](examples/voice-agent-mic/README.md)):
pip install urun-pipecat
python -m urun_pipecat.examples.mic --check-mic   # keyless two-second capture check
python -m urun_pipecat.examples.mic               # a 60-second voice session
python -m urun_pipecat.examples.mic --no-captions # the same, voice-only (no input transcription)

# Or serve the same voice-agent pipeline to a browser over RTVI: a
# single-client WebSocket bot any RTVI client can dial. The paired browser
# client — `@pipecat-ai/client-js` over the WebSocket transport — lives in
# the [examples repository](https://github.com/urun-sh/examples), app
# `rtvi-voice-client`.
python -m urun_pipecat.examples.rtvi_ws --port 8765

Models

uRun has no default model: GET /v1/models with your API key is the authoritative list. The service's default model constant is a convenience only; pass your own via settings=UrunLLMService.Settings(model=...). See the uRun inference API docs for the request/response contract, including how reasoning streams on reasoning_content.

Version compatibility

The package requires Python 3.11+ (CI tests 3.11, 3.12, and 3.13) and is tested with pipecat-ai 1.11.0 (the minimum) and 1.17.0 (current at the time of testing), via pipecat-ai[openai]; the example also needs the daily and silero extras. The dependency is pinned >=1.11.0,<2.0. A pipeline built on these services speaks RTVI when it is fronted by a Pipecat transport bot — the shipped WebSocket bot (urun_pipecat.examples.rtvi_ws, run by the rtvi-voice-client example in the uRun examples repository) is driven by the @pipecat-ai client SDKs; the same pipeline behind any other RTVI-capable transport is reachable the same way.

The test suite runs offline, against local fakes of uRun's lanes, and is run against both versions:

python -m venv .venv-min
.venv-min/bin/pip install "pipecat-ai[openai]==1.11.0" -e ".[dev,example]"
.venv-min/bin/python -m pytest tests -q

python -m venv .venv-current
.venv-current/bin/pip install "pipecat-ai[openai]==1.17.0" -e ".[dev,example]"
.venv-current/bin/python -m pytest tests -q

Troubleshooting

Missing API key. Every service requires a uRun API key at construction — the api_key argument or URUN_API_KEY — and fails there, loudly, not on the first request.

A model id is not accepted. GET /v1/models with your API key is the authoritative model list; the services' default models are conveniences only. Pass your own through each service's Settings.

TTS answers 400 naming voices. uRun validates voice strings server-side against the model's published list and the error names the accepted set — pass one of those.

No final transcripts. uRun's realtime transcription session has no server-side VAD: finals are commit-driven and arrive at utterance boundaries — each local-VAD stop, and input end — and interim text is not durable across boundaries. Keep turn detection off (the service default) and wire a VAD analyzer into the user context aggregator, as the shipped examples do.

The first request is slow. The first request against a model can take longer than warm ones while its serving stack becomes ready; subsequent requests are faster. If a client aborts early, retry the request.

Colocation refuses the pipeline (UrunColocationError). The wrapper never falls back on its own. Check that each lane's model is in the colocatable table above, all three services point at one uRun deployment, the pipeline matches the recognized voice shape (standard aggregator order, no custom processors between them), and the wrap happens before the PipelineWorker is constructed.

The recorded example rejects a WAV. The input must be mono 16-bit 24 kHz PCM WAV — convert with the ffmpeg command in the examples section.

Pipecat import errors. The package needs pipecat-ai[openai]>=1.11.0,<2.0; older Pipecat 0.x/1.x versions are not supported.

The mic example cannot capture. See the mic example's README for the PipeWire/PortAudio prerequisites per platform, and run python -m urun_pipecat.examples.mic --check-mic for a keyless capture check.

Release notes and license

Maintained by uRun. See the uRun docs for the inference API reference. Release notes live in CHANGELOG.md; the package is published to PyPI as urun-pipecat. BSD-2-Clause; see LICENSE.

Installation

The package needs Python 3.11+ (tested on 3.11, 3.12, and 3.13) and installs two runtime dependencies: pipecat-ai[openai]>=1.11,<2 and, on non-Linux, the sounddevice audio backend (on Linux, audio capture and playback go through the PipeWire command-line tools instead — a system package, not a pip one).

The first release is not on PyPI yet. Until it is published, install from a checkout:

git clone https://github.com/urun-sh/urun-pipecat
pip install "./urun-pipecat"

Once published, the same install works from the package name — with uv as usual:

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

Optional extras:

Extra Adds For
(none) the package, with the audio backend included: sounddevice on non-Linux (its wheels bundle PortAudio); Linux uses the PipeWire command-line tools instead — a system package, not a pip one — see the mic example using the services in your own pipeline, and the voice-agent microphone example (python -m urun_pipecat.examples.mic) — a terminal transcript UI with user captions on by default (--no-captions runs voice-only, --no-preview drops the live hypothesis preview)
[example] the daily and silero Pipecat extras the shipped examples need running urun_pipecat.examples.*
[mic] nothing: sounddevice is already in the base install; the name stays as an alias for readers of the old README the same pip install "urun-pipecat[mic]" commands from the previous README
[dev] pytest and the test doubles working on the package itself

Metadata

Release files for urun-pipecat 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 urun-pipecat 0.1.2
File Size Uploaded Provenance Actions
urun_pipecat-0.1.2.tar.gz 192.9 kB With provenance Details for urun_pipecat-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for urun-pipecat 0.1.2
File Interpreter ABI Platform Actions
urun_pipecat-0.1.2-py3-none-any.whl Python 3 none any Details for urun_pipecat-0.1.2-py3-none-any.whl

Total release size: 293.9 kB

Release files / urun_pipecat-0.1.2.tar.gz

Download URL urun_pipecat-0.1.2.tar.gz
Size 192.9 kB
Tags Source
SHA-256 checksum
How to use checksums
42ac25cf30aa8c7f0b3fb8ec2dfd0e4670b45660ee1ac5dfa1348386a3e6fb10
BLAKE2b-256 checksum
How to use checksums
68ba139906e8d72bc6857b7ce16ca3ee78cccf6136ea237274a83308f9c3e7fe
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 Dec 3, 2026.

Transparency log

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

Download URL urun_pipecat-0.1.2-py3-none-any.whl
Size 101.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b532748660a911f5a01a89f48b69a27703d70ee2337894e4e80fa5850e206093
BLAKE2b-256 checksum
How to use checksums
167f50371d12a2b5645d2c98f2be782993a76cee450259adf685d8e1f46d9bc5
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 Dec 3, 2026.

Transparency log

Security for urun-pipecat 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 urun_pipecat-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 Dec 3, 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