SIP and audio streaming transport for AI voice agents (pure Rust)
Project description
Agent Transport
Transport library (SIP/RTP & Audio Streaming) for voice AI agents to be used with frameworks like LiveKit Agents and Pipecat.
Agent Transport provides signaling and media primitives that AI agent frameworks need to make and receive voice calls. The core is written in Rust for efficient, low-jitter packet processing — audio pacing, RTP handling, and jitter buffering. Framework adapters for LiveKit Agents and Pipecat are provided as drop-in plugins. Bindings in Python and TypeScript/Node.js are also available for other use cases.
Transports
SIP/RTP — Register with any SIP provider, make and receive calls over RTP. G.711 codecs (PCMU/PCMA), DTMF (RFC 2833), NAT traversal (TCP signaling with Via alias, STUN for RTP), hold/unhold, call transfer. No server required, directly connect with telephony providers over SIP like Plivo.
Audio Streaming — Websocket based audio streaming that works with cloud telephony providers like Plivo that support bidirectional audio streaming.
Both transports produce and consume the same AudioFrame format (int16 PCM, 16kHz mono), so agent code works identically regardless of transport.
Framework Adapters
LiveKit Agents
Same AgentSession pipeline -- add ctx.session = session to wire SIP/audio stream transport:
SIP/RTP:
# LiveKit WebRTC # Agent Transport SIP/RTP
from livekit.agents import AgentServer, from agent_transport.sip.livekit import
JobProcess AgentServer, JobProcess
server = AgentServer() server = AgentServer(sip_username=..., sip_password=...)
def prewarm(proc: JobProcess): def prewarm(proc: JobProcess):
proc.userdata["vad"] = silero.VAD.load() proc.userdata["vad"] = silero.VAD.load()
server.setup_fnc = prewarm server.setup_fnc = prewarm
@server.rtc_session() @server.sip_session()
async def entrypoint(ctx): async def entrypoint(ctx):
session = AgentSession( session = AgentSession(
vad=ctx.proc.userdata["vad"], ...) vad=ctx.proc.userdata["vad"], ...)
await session.start( ctx.session = session
agent=Assistant(), await session.start(
room=ctx.room) agent=Assistant(), room=ctx.room)
cli.run_app(server) server.run()
Audio Streaming:
# LiveKit WebRTC # Agent Transport AudioStream
from livekit.agents import AgentServer, from agent_transport.audio_stream.livekit import
JobProcess AudioStreamServer, JobProcess
server = AgentServer() server = AudioStreamServer(listen_addr="0.0.0.0:8765")
def prewarm(proc: JobProcess): def prewarm(proc: JobProcess):
proc.userdata["vad"] = silero.VAD.load() proc.userdata["vad"] = silero.VAD.load()
server.setup_fnc = prewarm server.setup_fnc = prewarm
@server.rtc_session() @server.audio_stream_session()
async def entrypoint(ctx): async def entrypoint(ctx):
session = AgentSession( session = AgentSession(
vad=ctx.proc.userdata["vad"], ...) vad=ctx.proc.userdata["vad"], ...)
await session.start( ctx.session = session
agent=Assistant(), await session.start(
room=ctx.room) agent=Assistant(), room=ctx.room)
cli.run_app(server) server.run()
Full examples: sip_agent.py · sip_multi_agent.py · audio_stream_agent.py · audio_stream_multi_agent.py
See LiveKit SIP Transport docs for recording, Prometheus metrics, outbound API, and full reference.
Pipecat
Same Pipeline — swap transport, everything else stays identical. Audio pacing moves from Python to Rust:
# Pipecat + Plivo (Python audio pacing) # Agent Transport (Rust audio pacing)
from pipecat.serializers.plivo import from agent_transport.audio_stream.pipecat \
PlivoFrameSerializer .serializers.plivo import PlivoFrameSerializer
from pipecat.transports.websocket.fastapi import from agent_transport.audio_stream.pipecat \
FastAPIWebsocketTransport .transports.websocket import WebsocketServerTransport
serializer = PlivoFrameSerializer( serializer = PlivoFrameSerializer(
stream_id=..., call_id=..., auth_id=..., auth_token=...)
auth_id=..., auth_token=...) server = WebsocketServerTransport(
transport = FastAPIWebsocketTransport( serializer=serializer)
websocket=ws, params=Params(
serializer=serializer)) @server.handler()
async def run_bot(transport):
pipeline = Pipeline([ pipeline = Pipeline([
transport.input(), stt, llm, tts, transport.input(), stt, llm, tts,
transport.output()]) transport.output()])
task = PipelineTask(pipeline) task = PipelineTask(pipeline)
@transport.event_handler("on_client_connected") @transport.event_handler("on_client_connected")
async def on_connected(transport, client): async def on_connected(transport):
await task.queue_frames([LLMRunFrame()]) await task.queue_frames([LLMRunFrame()])
await PipelineRunner().run(task) await PipelineRunner().run(task)
server.run()
Also available for SIP/RTP: from agent_transport.sip.pipecat import SipTransport
Full examples: audio_stream_agent.py · sip_agent.py
Installation
Python
For LiveKit Agents
pip install "agent-transport[livekit]"
For Pipecat
pip install "agent-transport[pipecat]"
Minimum versions: livekit-agents>=1.5, pipecat-ai>=0.0.108
Node.js
For LiveKit Agents
npm install agent-transport @livekit/agents @livekit/rtc-node
Examples
| Example | Description |
|---|---|
livekit/sip_agent.py |
SIP voice agent with tool calling, turn detection, preemptive generation |
livekit/sip_agent.ts |
TypeScript SIP agent with tool calling, turn detection, metrics |
livekit/sip_multi_agent.py |
Multi-agent with greeter -> sales/support handoff and tool calling |
livekit/sip_multi_agent.ts |
TypeScript multi-agent with class inheritance and llm.handoff() |
livekit/audio_stream_agent.py |
LiveKit agent over Plivo audio streaming |
livekit/audio_stream_agent.ts |
TypeScript agent over Plivo audio streaming |
livekit/audio_stream_multi_agent.py |
Audio streaming multi-agent with handoff and tool calling |
livekit/audio_stream_multi_agent.ts |
TypeScript audio streaming multi-agent |
pipecat/sip_agent.py |
Pipecat pipeline over SIP/RTP with VAD |
pipecat/sip_multi_agent.py |
Pipecat multi-agent with greeter → sales/support handoff |
pipecat/audio_stream_agent.py |
Pipecat over Plivo audio streaming with Rust recorder + mixer |
pipecat/audio_stream_multi_agent.py |
Pipecat audio streaming multi-agent with handoff |
cli/phone.py |
Interactive CLI softphone with mic/speaker, DTMF, mute, hold/unhold |
See also: Feature Flags & CLI Phone docs
Releasing
Publishing is label-driven. Bump the version, add release-python-sdk or release-node-sdk label to your PR, and merge — CI handles the rest. Python and Node releases are independent.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agent_transport-0.1.9-cp39-abi3-win_arm64.whl.
File metadata
- Download URL: agent_transport-0.1.9-cp39-abi3-win_arm64.whl
- Upload date:
- Size: 5.7 MB
- Tags: CPython 3.9+, Windows ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2601fff65414bcfec4d422dade215ad3fd46b2a007ce2c9853f188264071d65b
|
|
| MD5 |
0ebc977fdb6bf6f5044d2bb6fc14ed2d
|
|
| BLAKE2b-256 |
d041732cc14c8a25815efa10494c84e64ea89fc674b8743ab448978472a27722
|
Provenance
The following attestation bundles were made for agent_transport-0.1.9-cp39-abi3-win_arm64.whl:
Publisher:
publish-python.yml on plivo-labs/agent-transport
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agent_transport-0.1.9-cp39-abi3-win_arm64.whl -
Subject digest:
2601fff65414bcfec4d422dade215ad3fd46b2a007ce2c9853f188264071d65b - Sigstore transparency entry: 1256248644
- Sigstore integration time:
-
Permalink:
plivo-labs/agent-transport@58a1126bc1dc954c5e1a3ea6c22307e86f36f4b4 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/plivo-labs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@58a1126bc1dc954c5e1a3ea6c22307e86f36f4b4 -
Trigger Event:
workflow_run
-
Statement type:
File details
Details for the file agent_transport-0.1.9-cp39-abi3-win_amd64.whl.
File metadata
- Download URL: agent_transport-0.1.9-cp39-abi3-win_amd64.whl
- Upload date:
- Size: 5.8 MB
- Tags: CPython 3.9+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c97374f754f8b5e469364d403a5bcd54a9fac842a0e22a612f971adad82d957d
|
|
| MD5 |
684e461187e546062e6eca1e34971358
|
|
| BLAKE2b-256 |
d02098eb3838542e189493bc4fb797722817ef39573349e9dd9a8d1da71585e5
|
Provenance
The following attestation bundles were made for agent_transport-0.1.9-cp39-abi3-win_amd64.whl:
Publisher:
publish-python.yml on plivo-labs/agent-transport
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agent_transport-0.1.9-cp39-abi3-win_amd64.whl -
Subject digest:
c97374f754f8b5e469364d403a5bcd54a9fac842a0e22a612f971adad82d957d - Sigstore transparency entry: 1256248394
- Sigstore integration time:
-
Permalink:
plivo-labs/agent-transport@58a1126bc1dc954c5e1a3ea6c22307e86f36f4b4 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/plivo-labs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@58a1126bc1dc954c5e1a3ea6c22307e86f36f4b4 -
Trigger Event:
workflow_run
-
Statement type:
File details
Details for the file agent_transport-0.1.9-cp39-abi3-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: agent_transport-0.1.9-cp39-abi3-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 5.9 MB
- Tags: CPython 3.9+, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2cfc0945b142696b961538c4ae0229b03c197e8524c270091e76cb0bfca70876
|
|
| MD5 |
26532e281b041baa2698c16858de37dc
|
|
| BLAKE2b-256 |
98e4195889fa57f9515746a9ad9b757ed478619679ffc9600a09547626649f11
|
Provenance
The following attestation bundles were made for agent_transport-0.1.9-cp39-abi3-manylinux_2_28_x86_64.whl:
Publisher:
publish-python.yml on plivo-labs/agent-transport
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agent_transport-0.1.9-cp39-abi3-manylinux_2_28_x86_64.whl -
Subject digest:
2cfc0945b142696b961538c4ae0229b03c197e8524c270091e76cb0bfca70876 - Sigstore transparency entry: 1256248981
- Sigstore integration time:
-
Permalink:
plivo-labs/agent-transport@58a1126bc1dc954c5e1a3ea6c22307e86f36f4b4 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/plivo-labs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@58a1126bc1dc954c5e1a3ea6c22307e86f36f4b4 -
Trigger Event:
workflow_run
-
Statement type:
File details
Details for the file agent_transport-0.1.9-cp39-abi3-manylinux_2_28_aarch64.whl.
File metadata
- Download URL: agent_transport-0.1.9-cp39-abi3-manylinux_2_28_aarch64.whl
- Upload date:
- Size: 6.0 MB
- Tags: CPython 3.9+, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4dd19213737de88a8fbffa72a811dbc5b8b50cf561c10aca174e16212131b5e2
|
|
| MD5 |
2b5e08a128ad2953f87239816ff56ad7
|
|
| BLAKE2b-256 |
465147fecdfd9635af4cd7caa6f5e8657ce6bfdedf6294c6a1e9c603003082de
|
Provenance
The following attestation bundles were made for agent_transport-0.1.9-cp39-abi3-manylinux_2_28_aarch64.whl:
Publisher:
publish-python.yml on plivo-labs/agent-transport
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agent_transport-0.1.9-cp39-abi3-manylinux_2_28_aarch64.whl -
Subject digest:
4dd19213737de88a8fbffa72a811dbc5b8b50cf561c10aca174e16212131b5e2 - Sigstore transparency entry: 1256248518
- Sigstore integration time:
-
Permalink:
plivo-labs/agent-transport@58a1126bc1dc954c5e1a3ea6c22307e86f36f4b4 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/plivo-labs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@58a1126bc1dc954c5e1a3ea6c22307e86f36f4b4 -
Trigger Event:
workflow_run
-
Statement type:
File details
Details for the file agent_transport-0.1.9-cp39-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: agent_transport-0.1.9-cp39-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 5.7 MB
- Tags: CPython 3.9+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af8b91a26a359fdb7c66e02d3ce57ea9fd906a063b551bbd9db50eb8a2f370ce
|
|
| MD5 |
d2c33adea25311aa8614edc9324a9291
|
|
| BLAKE2b-256 |
8254309042da7a2e34d85408696c98fa017a6d781b0b303e597a534e8b7cba84
|
Provenance
The following attestation bundles were made for agent_transport-0.1.9-cp39-abi3-macosx_11_0_arm64.whl:
Publisher:
publish-python.yml on plivo-labs/agent-transport
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agent_transport-0.1.9-cp39-abi3-macosx_11_0_arm64.whl -
Subject digest:
af8b91a26a359fdb7c66e02d3ce57ea9fd906a063b551bbd9db50eb8a2f370ce - Sigstore transparency entry: 1256248859
- Sigstore integration time:
-
Permalink:
plivo-labs/agent-transport@58a1126bc1dc954c5e1a3ea6c22307e86f36f4b4 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/plivo-labs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@58a1126bc1dc954c5e1a3ea6c22307e86f36f4b4 -
Trigger Event:
workflow_run
-
Statement type:
File details
Details for the file agent_transport-0.1.9-cp39-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: agent_transport-0.1.9-cp39-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 5.9 MB
- Tags: CPython 3.9+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0126aa483364bbb9efbbacb52ebdfc37ad9d22d6fce8b7896991d1ba8432aeaa
|
|
| MD5 |
69759e6bed170bdc06dd2173f90ff7c0
|
|
| BLAKE2b-256 |
94f43e7bdb6a8c193d16063c41cc3d5d16c07c6233636a2fbfba15240c715e8f
|
Provenance
The following attestation bundles were made for agent_transport-0.1.9-cp39-abi3-macosx_10_12_x86_64.whl:
Publisher:
publish-python.yml on plivo-labs/agent-transport
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agent_transport-0.1.9-cp39-abi3-macosx_10_12_x86_64.whl -
Subject digest:
0126aa483364bbb9efbbacb52ebdfc37ad9d22d6fce8b7896991d1ba8432aeaa - Sigstore transparency entry: 1256248748
- Sigstore integration time:
-
Permalink:
plivo-labs/agent-transport@58a1126bc1dc954c5e1a3ea6c22307e86f36f4b4 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/plivo-labs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@58a1126bc1dc954c5e1a3ea6c22307e86f36f4b4 -
Trigger Event:
workflow_run
-
Statement type: