All Topics
All Topics
Technology
Technology
AI
AI
Business
Business
Entertainment
Entertainment
News
News
Programming
Programming
Security
Security
Science
Science
Design
Design
Environment
Environment
Finance
Finance
Crypto
Crypto
Politics
Politics
Sports
Sports
Education
Education
Gaming
Gaming
Art
Art
Music
Music
Health
Health
Books
Books
Food
Food
Travel
Travel
Personal
Personal
Bluesky
Twitter

pxpipe: An open-source proxy that cuts LLM token usage by rendering text context as images

By

dimitropoulos

3d ago· 9 min readenCode

Summary

pxpipe is a local proxy tool that reduces token usage in Claude Code (and similar LLM applications) by converting bulky text context — such as system prompts, tool documentation, code, JSON, and history — into compact PNG images before sending them to the API. Since image token costs are determined by pixel dimensions rather than text density, dense content achieves roughly 3.1 characters per image-token compared to ~1 character per text-token. The approach leverages the same vision channel Anthropic's computer use feature uses for screenshots. The tool is open-source and available on GitHub.

Source

Hacker Newspxpipe: An open-source proxy that cuts LLM token usage by rendering text context as imagesgithub.com

Key quotes

· 4 pulled
An image's token cost is fixed by its pixel dimensions, not by how much text is inside it.
Dense content (code, JSON, tool output) packs ~3.1 chars per image-token vs ~1 char per text-token on real Claude Code traffic.
The reader is the same vision channel that Anthropic's computer use already relies on for screenshots.
pxpipe is a local proxy that uses that channel for context: it rewrites the bulky parts of each request into compact PNGs
Snippet from the RSS feed
cut Fable 5 token usage by rendering text context as images - teamchong/pxpipe

You might also wanna read

Comments

Sign in to join the conversation.

No comments yet. Be the first.