pxpipe (teamchong/pxpipe)

Searching Database…

What is this?pxpipe is a local proxy that cuts Claude Code's (and other LLM clients') input token usage by rendering bulky context — system prompts, tool docs, and conversation history — as compact PNG images instead of raw text, since an image's token cost depends on its pixel size, not the amount of text packed into it.
Is this a cloud service or something that runs on my machine?It's a local proxy you run yourself, not a hosted service: it sits between your coding agent and the Anthropic/OpenAI/Google APIs and rewrites eligible request content into images before anything leaves your machine.
How do I start using it with Claude Code?You run the pxpipe proxy locally and point your client at it; a live dashboard shows savings while it's running, and the 'pxpipe stats' CLI can summarize the same event log offline from ~/.pxpipe/events.jsonl.
Which models and APIs does it support?By default it covers claude-fable-5 and every Gemini model; Opus 5, Sol (GPT), and Grok are opt-in via the PXPIPEMODELS env var or dashboard chips. The proxy speaks Anthropic Messages, OpenAI Responses/Chat Completions, and Google generateContent.
Does every model read the imaged context equally well?No — quality varies sharply by model: claude-fable-5 and Gemini 3.6/3.7 Flash score near-perfect, while weaker models like glm-5.3-flash drop to 36/100 on arithmetic and can't read dense hex content at all.
Does it run on Windows as well as macOS and Linux?It runs on Windows too, but that support is community-maintained; primary development targets macOS and Linux, and Windows fixes rely on contributor PRs.
How much can it actually cut token costs by?At current list prices it lands around a 59-70% lower end-to-end bill; on a dense 454k-character test corpus, Claude's profile cut an estimated 122,715 text tokens down to just 23,856 image tokens, an 80.6% reduction.
Can I use it as a library without running the proxy?Yes — there's a pure-JS core API (src/core/index.ts) usable in Node or edge/Workers, with options like keepSharp() to pin blocks as text and emitRecoverable() to get back the originals of imaged blocks.
Does it image everything, or just the bulky parts?Only bulky content like system prompts, tool docs, and old closed history pairs get imaged; sparse prose, open tool calls, and malformed/orphan state always stay as native text.
Why does rendering text as an image save tokens at all?Because a vision model charges tokens based on an image's pixel dimensions, not how much text it contains, so dense content like code or JSON packs roughly 3.1 characters per image-token versus about 1 character per text-token.
Creator
teamchong
Size
257.6 MB
Stars
8K
Age
6mo
Commits · 90 Days