# teamchong/pxpipe

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/teamchong-pxpipe).**

_How this analysis was created: the description and tags below were written by an AI model that read this project's README and public documentation pages; stars, license and language come straight from the GitHub API. The model does not read the source code._

7,583 stars · 654 forks · TypeScript · MIT

## Links

- GitHub: https://github.com/teamchong/pxpipe
- awesome-repositories: https://awesome-repositories.com/repository/teamchong-pxpipe.md

## Description

pxpipe is a local proxy that sits between coding agents and model APIs and cuts input token cost by rewriting bulky request context into dense PNG images. System prompts, tool documentation and older conversation history are rendered as images, while recent turns stay as plain text and the streamed output is left unchanged. It handles Anthropic, OpenAI, Google and Cloudflare requests, and can run as a local Node process or as a Cloudflare Worker.

What sets it apart is how it applies compression selectively. Blocks that carry exact identifiers, hashes, secrets or precise numbers stay as text, and compression is enabled only for models measured to read dense renders reliably, with per-model profiles for image geometry, factsheets and history retention. A cost check transforms a request only when imaging is cheaper than text, and the rewrite keeps provider prompt-cache prefixes stable across turns. Agents can be launched through a transparent wrapper or a CONNECT-based route that works even when a CLI ignores base-URL settings, and requests can be routed to different upstream providers with Anthropic calls bridged to chat-completion backends.

The repository also includes tooling for judging whether compression pays off. A live dashboard, request telemetry and an offline summary report token savings against an uncompressed baseline. A benchmark suite measures how accurately models read image-rendered text, covering exact-string recall, gist recall, state tracking and confabulation on unstated facts. Paired task-resolution runs on SWE-bench Lite compare outcomes with compression on and off. The rendering pipeline is also available as a JavaScript library and a command-line exporter that turns text, files or diffs into image pages.

Project housekeeping includes a hardened container setup with a read-only filesystem and loopback-only port, plus dependency safeguards that delay newly published packages and force patched transitive versions.

## Tags

### Artificial Intelligence & ML

- [Compression Proxies](https://awesome-repositories.com/f/artificial-intelligence-ml/context-compression/compression-proxies.md) — Runs a local proxy between coding agents and model APIs that rewrites bulky request context into images so the model receives fewer input tokens.
- [Token Reduction Pipelines](https://awesome-repositories.com/f/artificial-intelligence-ml/token-reduction-pipelines.md) — Cuts the input token cost of long coding-agent sessions by rendering bulky context into compact images while keeping the work done.
- [Conversation History Compression](https://awesome-repositories.com/f/artificial-intelligence-ml/conversation-history-compression.md) — Packs completed tool-call rounds and long Gemini and OpenAI history into dense images while keeping open calls and recent turns as native text. ([source](https://github.com/teamchong/pxpipe/blob/main/CHANGELOG.md))
- [Exact String Preservation](https://awesome-repositories.com/f/artificial-intelligence-ml/exact-string-preservation.md) — Adds identifier rows and a text factsheet alongside rendered images, and keeps recent protocol state as text, to reduce errors on exact strings. ([source](https://github.com/teamchong/pxpipe/blob/main/docs/MODEL_RENDER_PROFILES.md))
- [Image Context Compatibility Tiers](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/infrastructure/model-evaluation-and-validation/model-capability-assessment/image-context-compatibility-tiers.md) — Classifies which models read compressed image context at full fidelity, gist-only or not at all, using benchmark recall scores. ([source](https://github.com/teamchong/pxpipe/blob/main/CHANGELOG.md))
- [Model-Gated Image Compression](https://awesome-repositories.com/f/artificial-intelligence-ml/model-gated-image-compression.md) — Enables image compression only for models measured to read dense renders reliably, leaving other models as explicit opt-ins. ([source](https://github.com/teamchong/pxpipe/blob/main/FINDINGS.md))
- [Model-Specific Render Profiles](https://awesome-repositories.com/f/artificial-intelligence-ml/model-specific-render-profiles.md) — Chooses image font size, column count and maximum height automatically from the model id so each model reads renders at a suitable geometry. ([source](https://github.com/teamchong/pxpipe/blob/main/docs/MODEL_RENDER_PROFILES.md))
- [Multi-Provider LLM Gateways](https://awesome-repositories.com/f/artificial-intelligence-ml/multi-provider-llm-gateways.md) — Routes model ids to different upstream providers, bridging Anthropic requests to chat-completion backends while preserving streaming behaviour behind one client interface.
- [Per-Model Compression Profiles](https://awesome-repositories.com/f/artificial-intelligence-ml/per-model-compression-profiles.md) — Applies model-specific profiles for image geometry, factsheets, history retention, and profitability so sparse prose stays text and dense content becomes images. ([source](https://github.com/teamchong/pxpipe#readme))
- [Prompt Caching](https://awesome-repositories.com/f/artificial-intelligence-ml/prompt-caching.md) — Keeps provider prompt-cache prefixes stable across turns while rewriting context, so compressed sessions avoid cache flips and cold restarts.
- [Prefix Caching](https://awesome-repositories.com/f/artificial-intelligence-ml/prompt-caching/prefix-caching.md) — Rewrites only bulky stable content into images and moves the cache marker to the last image block so provider prefix caching still works. ([source](https://github.com/teamchong/pxpipe/blob/main/docs/CACHING_AND_SAVINGS.md))
- [Provider-Specific Routing Policies](https://awesome-repositories.com/f/artificial-intelligence-ml/provider-response-routing/provider-specific-routing-policies.md) — Sends requests for specific model ids to different upstream providers such as OpenAI, Google, Cloudflare and Novita using reversible aliases and provider-aware token accounting. ([source](https://github.com/teamchong/pxpipe/blob/main/CHANGELOG.md))
- [Verbatim-Critical Block Preservation](https://awesome-repositories.com/f/artificial-intelligence-ml/verbatim-critical-block-preservation.md) — Leaves blocks carrying exact identifiers, hashes, secrets, or precise numbers as text because imaged content can be silently misread. ([source](https://github.com/teamchong/pxpipe/blob/main/FINDINGS.md))

### Networking & Communication

- [Model Request Proxies](https://awesome-repositories.com/f/networking-communication/model-request-proxies.md) — Runs a local proxy that intercepts coding-agent requests to several providers, rewrites bulk into images, and forwards native requests without altering streamed output. ([source](https://github.com/teamchong/pxpipe#readme))
- [Agent Traffic Diverters](https://awesome-repositories.com/f/networking-communication/agent-traffic-diverters.md) — Launches coding agents behind a transparent wrapper or CONNECT route so their traffic reaches the compressor even when the CLI ignores base-URL settings.
- [CONNECT Proxy Agent Routing](https://awesome-repositories.com/f/networking-communication/connect-proxy-agent-routing.md) — Launches coding agents behind a CONNECT proxy matching routes by host and port so agents ignoring base-URL settings still pass through the compressor. ([source](https://github.com/teamchong/pxpipe/blob/main/CHANGELOG.md))

### Development Tools & Productivity

- [Context Compression](https://awesome-repositories.com/f/development-tools-productivity/developer-utilities-libraries/workflow-productivity-enhancers/developer-productivity-utilities/developer-utilities/file-resource-management/file-compression-utilities/token-aware-log-compression/context-compression.md) — Renders older conversation history, system prompts, and tool output as dense PNG images while recent turns stay text, cutting input tokens substantially. ([source](https://github.com/teamchong/pxpipe/blob/main/FINDINGS.md))
- [Transparent Agent Wrappers](https://awesome-repositories.com/f/development-tools-productivity/transparent-agent-wrappers.md) — Launches a coding agent under a diverting wrapper that routes provider traffic through the proxy without overriding base URLs, keeping OAuth and first-party features working. ([source](https://github.com/teamchong/pxpipe/blob/main/README.md))

### Graphics & Multimedia

- [Text-to-Image Context Compressors](https://awesome-repositories.com/f/graphics-multimedia/text-to-image-context-compressors.md) — Renders system prompts, tool docs and older history as dense PNG pages that vision models read for far fewer tokens than plain text.
- [Text Rendering](https://awesome-repositories.com/f/graphics-multimedia/graphics-engines-rendering/text-rendering.md) — Turns text or message bodies into PNG pages through library functions, with options to pin blocks as text and recover originals of imaged blocks. ([source](https://github.com/teamchong/pxpipe/blob/main/README.md))
- [Text-to-Image Page Exporters](https://awesome-repositories.com/f/graphics-multimedia/text-to-image-page-exporters.md) — Converts text, files, stdin, or git diffs into PNG pages plus a factsheet, manifest, and prompt, usable without running the proxy. ([source](https://github.com/teamchong/pxpipe/blob/main/README.md))

### System Administration & Monitoring

- [Token Cost Optimizations](https://awesome-repositories.com/f/system-administration-monitoring/usage-monitoring/token-usage-analytics/token-consumption-trackers/token-cost-optimizations.md) — Renders system prompts, tool docs and older history into compact images so the model reads the same content with far fewer tokens. ([source](https://github.com/teamchong/pxpipe#readme))
- [Token Savings Trackers](https://awesome-repositories.com/f/system-administration-monitoring/token-savings-trackers.md) — Logs per-request savings against a counterfactual token count and summarizes them on a live dashboard and offline with compression ratios and cache-hit rates. ([source](https://github.com/teamchong/pxpipe#readme))
- [Cost and Token Trackers](https://awesome-repositories.com/f/system-administration-monitoring/usage-monitoring/token-usage-analytics/cost-and-token-trackers.md) — Reports API calls, input, cache and output token totals plus estimated dollar cost per run to compare compressed runs against an uncompressed baseline. ([source](https://github.com/teamchong/pxpipe/blob/main/eval/swe-bench))
- [Pre-Request Cost Estimation](https://awesome-repositories.com/f/system-administration-monitoring/usage-monitoring/token-usage-analytics/token-cost-calculators/token-cost-calculators/pre-request-cost-estimation.md) — Compares estimated image token cost against text cost, including cache-write penalties, and rewrites a request only when imaging is cheaper. ([source](https://github.com/teamchong/pxpipe/blob/main/docs/CACHING_AND_SAVINGS.md))

### Testing & Quality Assurance

- [Image-Rendered Context Benchmarks](https://awesome-repositories.com/f/testing-quality-assurance/image-rendered-context-benchmarks.md) — Ships a benchmark suite measuring how accurately models read image-rendered text versus plain text across arithmetic, gist recall, state tracking, unstated-fact guards and hex strings. ([source](https://github.com/teamchong/pxpipe/blob/main/eval/sol-profile/README.md))
- [Image-Rendered Context Evaluations](https://awesome-repositories.com/f/testing-quality-assurance/image-rendered-context-evaluations.md) — Measures how accurately models read image-rendered text versus plain text, with exact-string recall, confabulation checks and paired SWE-bench task-resolution runs.
- [Paired Agent Task Resolution Tests](https://awesome-repositories.com/f/testing-quality-assurance/paired-agent-task-resolution-tests.md) — Runs paired compression-on and compression-off agent sessions on SWE-bench Lite graded by the official Docker harness to compare resolution and cost. ([source](https://github.com/teamchong/pxpipe/blob/main/FINDINGS.md))
- [Context Recall Evaluators](https://awesome-repositories.com/f/testing-quality-assurance/performance-testing-analysis/performance-diagnostics/performance-measurement/context-recall-evaluators.md) — Measures how accurately a model answers arithmetic, gist, state-tracking, never-stated and exact hex recall questions from image-rendered context. ([source](https://github.com/teamchong/pxpipe/blob/main/eval/sol-profile/KIMI_K3_QUALITY_RESULTS.md))
- [Vision-Context Recall Benchmarks](https://awesome-repositories.com/f/testing-quality-assurance/vision-context-recall-benchmarks.md) — Ships a benchmark suite scoring exact-string recall, gist recall, state tracking and confabulation when models read text rendered as images.

### DevOps & Infrastructure

- [Image Token Cost Predictors](https://awesome-repositories.com/f/devops-infrastructure/resource-cost-management/cost-estimators/image-token-cost-predictors.md) — Checks whether imaging a request is cheaper than text using the renderer's own resolved profile, so overrides never leave stale cost estimates. ([source](https://github.com/teamchong/pxpipe/blob/main/docs/MODEL_RENDER_PROFILES.md))

### User Interface & Experience

- [Bitmap Font Rendering](https://awesome-repositories.com/f/user-interface-experience/font-renderers/bitmap-font-rendering.md) — Draws long text context as dense bitmap images with a fixed-width pixel font and column and height limits. ([source](https://github.com/teamchong/pxpipe/blob/main/eval/sol-profile/KIMI_K3_QUALITY_RESULTS.md))
