Skip to main content

Named Pipes as Agentic Tools

Low-latency IPC for persistent AI tool servers — LLM inference, TTS, STT, vector search, and more — all on one machine, no network stack required.


✨ Highlights

  • Persistent servers — model weights and state stay loaded between calls; no per-request startup cost
  • Kernel-speed IPC — named pipes route through kernel memory, not a network stack; lower latency than local HTTP
  • Multi-client fanout — one server handles many concurrent clients; each gets its own downstream pipe
  • Decorator API — register command handlers with a single @ch.handler("CMD") line
  • cpipe CLI — send ad-hoc commands to any running server from the terminal, like curl for pipes
  • Claude Code skill — an included skill teaches the assistant to discover and query live servers without leaving the session
  • Ready-made servers — drop-in pipes for LLM chat, text-to-speech, and speech-to-text

Overview

This library uses named pipes as the transport layer for agentic tool servers — persistent background processes that expose capabilities such as LLM inference, text-to-speech, vector search, or browser automation to a Python orchestrator running on the same machine.

Because named pipes route data through kernel memory rather than a network stack, they offer lower latency than local HTTP and far less complexity than shared memory — a practical sweet spot for real-time applications like voice agents.

The same servers can be driven directly from Claude Code. An included agent skill teaches the assistant how to discover running pipe servers with cpipe --list, inspect their capabilities, and send commands.

For a deeper look at the design decisions and API reference, see DOCS.md.

Installation

# Core library only
pip install -e .

# With LLM inference support
pip install -e ".[llm]"

# With TTS support (macOS: mlx-audio + sounddevice)
pip install -e ".[tts]"

# With STT support (sounddevice; Voxtral weights vendored)
pip install -e ".[stt]"

Requires Python 3.11+. See DOCS.md for platform-specific dependency details.

Quick start

1. Start a server (Terminal 1):

conda activate named-pipes
cpipe --serve chat   # LLM server on /tmp/tool-chat

2. Query it from the CLI (Terminal 2):

cpipe /tmp/tool-chat chat --data '{"messages": [{"role":"user","content":"Hello!"}]}'

3. Or write a client in Python:

from named_pipes.tool_client import ToolClient
import threading

class _ChatClient(ToolClient):
    def on_message(self, msg):
        if msg.get("done") is not True:
            print(msg.get("result", ""), end="", flush=True)

done = threading.Event()
with _ChatClient("chat") as ch:
    ch.send_command("chat", messages=[{"role": "user", "content": "Hello!"}])
    done.wait(timeout=30)

Examples

Start order matters — server first, then client (server creates the FIFOs).

# LLM chat
cpipe --serve chat                      # Terminal 1
python src/examples/chat_client.py     # Terminal 2

# LLM → TTS pipeline (spoken output)
cpipe --serve chat                      # Terminal 1: LLM  (/tmp/tool-chat)
cpipe --serve tts                       # Terminal 2: TTS  (/tmp/tool-tts)
python src/examples/tts_client.py      # Terminal 3: pipeline client

# Speech-to-text
cpipe --serve stt                       # Terminal 1: STT  (/tmp/tool-stt)
python src/examples/stt_client.py      # Terminal 2: subscriber

cpipe — CLI tool

cpipe /tmp/tool-chat chat --data '{"messages": [{"role":"user","content":"Hello"}]}'

cpipe --version  # show installed version
cpipe --list     # discover running ToolServer instances (tool-* pipes)
cpipe --pid      # same, plus PIDs that have each pipe open
cpipe --clear    # delete orphaned tool pipes

See DOCS.md for all options and the full protocol reference.

Claude Code skill

An included skill at .claude/skills/cpipe/SKILL.md teaches Claude Code how to use cpipe to discover, inspect, and interact with live servers — so the LLM can query a local inference server or trigger TTS playback without leaving the coding session.

Resources

Metadata

Release files for named-pipes 0.8.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 named-pipes 0.8.0
File Size Uploaded Provenance Actions
named_pipes-0.8.0.tar.gz 218.9 kB With provenance Details for named_pipes-0.8.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for named-pipes 0.8.0
File Interpreter ABI Platform Actions
named_pipes-0.8.0-py3-none-any.whl Python 3 none any Details for named_pipes-0.8.0-py3-none-any.whl

Total release size: 460.1 kB

Release files / named_pipes-0.8.0.tar.gz

Download URL named_pipes-0.8.0.tar.gz
Size 218.9 kB
Tags Source
SHA-256 checksum
How to use checksums
c3f46ba009f9f33ad7aed313e8e7a6fc8e5a9532ef93d53a9a0ceb372510ab7f
BLAKE2b-256 checksum
How to use checksums
a6597353fc07c3b2f853bd5c32e0320b7e2532a81d6fe33ccdf92b8e3aa13719
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 Nov 30, 2026.

Transparency log

Release files / named_pipes-0.8.0-py3-none-any.whl

Download URL named_pipes-0.8.0-py3-none-any.whl
Size 241.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3eeb74c5df0a23fc2568ed5e0a6425053bc7e8dd746b42d43fe5bfa4fed634ab
BLAKE2b-256 checksum
How to use checksums
11cef304894f9008bd5e5f7304c8c9ca43a7efab2e244e5f168082b98ca9cc08
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 Nov 30, 2026.

Transparency log

Security for named-pipes 0.8.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for named_pipes-0.8.0.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 Nov 30, 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