teamchong/pxpipe
A request proxy that turns bulky coding-agent context into PNGs to cut input tokens
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
pxpipe is a TypeScript request proxy, not an MCP server. It transforms tool documentation and history once the coding client has assembled the model request. The pipeline resolves the model ID to a render profile, reflows eligible blocks into dense PNG pages, adds a bounded text factsheet, and forwards the rewritten payload. Recent turns remain text, sparse prose can stay unconverted, and the proxy does not compress the response stream.
It handles Anthropic Messages, OpenAI Responses and Chat Completions, and Google generateContent. Requests can retain their provider-native format, or Anthropic Messages can be bridged to a configured OpenAI-compatible upstream. The Anthropic path preserves the static prefix and prompt-cache boundary. The runtime is JavaScript on Node and Cloudflare Workers, with gpt-tokenizer as the sole declared runtime dependency and @napi-rs/canvas used only at build time. src/core/index.ts exposes rendering and transformation without requiring a running proxy.
Key Capabilities & Differentiators
The savings depend on how much text fits into pixels each model can still read. One example converts roughly 48,000 characters of system prompt and tool docs from about 25,000 text tokens to 2,700 image tokens. On a separate 454,045-character dense fixture, the Claude 5×8 profile estimated 80.6% savings versus 46.7% for Sol's 14px profile, using the same text-token estimate and each provider's image-token formula. These are profile costs on specific inputs, not bill forecasts.
Paired pilots on the original claude-fable-5 offer a task-level check: SWE-bench Lite finished 10/10 in both modes at 65% lower request size, while Pro finished 14/19 with pxpipe versus 15/19 with text at 60% lower request size. The dashboard shows conversions side by side and provides a kill switch. pxpipe stats reads ~/.pxpipe/events.jsonl after shutdown, while pxpipe export creates PNGs and companion text files without connecting to an upstream.
Trade-offs & Limitations
Direct text requests make exact strings available without a visual decoding step. Native prompt caching reduces the cost of repeated prefixes; pxpipe tackles a different problem by changing the representation of eligible context, not just reusing it. Model choice is the main constraint: Gemini 4 Argon scored 15/15 on pure-image dense hex, while the tested Opus, Sonnet, and Haiku 5.5 variants scored 0–3/15. Fable 5.1 and 5.2 improved with two extra pixels between rows, at about 25% more image tokens than the unspaced layout. Test exact identifiers and task completion, not just gist recall or nominal context capacity.
The proxy needs the full context in the outgoing request. Claude Code 2.1.281 and later can send only deltas for server-side threads, so warp defaults the child process to CLAUDE_CODE_TETHER_LIVE=0, an undocumented setting that may change. For matched Codex WebSocket upgrades, the proxy returns HTTP 426 to trigger full-context HTTP SSE. These compatibility changes matter if you rely on native stateful transport. Compare actual provider spend and latency with a direct, cache-enabled baseline before rolling it out.
Hardware & Deployment Guide
Start locally with npx pxpipe-proxy, then run pxpipe warp -- claude with the CLI available. The package requires Node 20.19 or later; decoding Codex's zstd-compressed request bodies requires Node 22.15 or later. Docker Compose publishes 127.0.0.1:${PXPIPE_PORT:-47821} to container port 47821, makes the root filesystem read-only, drops all capabilities, sets no-new-privileges, and mounts pxpipe-data at /data.
wrangler.toml and deploy:worker provide a Cloudflare Workers deployment path. No local inference accelerator is required; size CPU and memory against payload size, rendered page count, and concurrent requests rather than model VRAM. Treat the proxy and any enabled request dumps as sensitive because the proxy handles prompt and tool content. v0.18.2 addressed history trimming and request-size accounting, v0.18.3 fixed cache liveness, gzip retry blacklisting, and carry-over anchor handling, and v0.18.4 fixed Anthropic input-usage accounting across SSE deltas.
pxpipe warp -- claude launches Claude Code through the request proxy without an ANTHROPIC_BASE_URL override.generateContent, plus bridging from Anthropic Messages to an OpenAI-compatible upstream.keepSharp hook pins selected blocks as text.pxpipe stats --json aggregates the local event log; Anthropic token savings are measured against a count_tokens counterfactual.pxpipe export accepts files, stdin, or a Git diff and produces PNG pages, a factsheet, a manifest, and a companion prompt.Teams running long coding-agent sessions with dense logs, JSON, or tool output, on a vision model that passes their own exact-read and task tests.
Your model misreads dense glyphs, exact text is essential, native thread or WebSocket behavior must stay intact, or provider terms prohibit the integration.
Quick Start & Installation
npx pxpipe-proxy # proxy on 127.0.0.1:47821 pxpipe warp -- claude # Claude Code (or: codex, omp, opencode)
Comparison vs. Top Coding, Skills & MCP Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| pxpipe ★ | 8.1k | +28 | TypeScript | MIT | A request proxy that turns bulky coding-agent context into PNGs to cut input tok |
| ECC | 316.1k | +4.2k | JavaScript | MIT | Plugins and CLI workflows for planning, reviewing, and verifying agent-written c |
| ponytail | 204.4k | +4.1k | JavaScript | MIT | A prompt-driven coding-agent plugin for smaller changes and focused tests. |
| spec-kit | 153.8k | +1.3k | Python | MIT | A Python CLI for spec-driven coding-agent workflows and reviewable handoffs |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/teamchong/pxpipe.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about pxpipe
Do I need to install an MCP server or modify my tools?
pxpipe warp -- claude for Claude Code, or call renderTextToImages and transformAnthropicMessages from pxpipe-proxy when integrating at the application layer.Does PNG rendering require a GPU, and how should I size the service?
Can I self-host pxpipe for commercial use?
Why use this instead of direct text requests with prompt caching?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy