mirror of
https://github.com/teamchong/pxpipe.git
synced 2026-07-22 02:02:51 +02:00
9fddbeb28a
Token-saving HTTP proxy for Claude Code that renders system prompt + tools as 5pt Menlo monospace images. Achieves 65-73% token reduction with 100% reasoning quality preserved on Opus 4.7. Production state at this commit: - src/proxy.py: 972 lines, battle-tested with 46+ real Claude Code sessions observed (~551k tokens saved, ~$8.27 in stats.json as of commit time) - bin/cli.js: Node wrapper that spawns Python proxy on port 47821 - scripts/gen_atlas.py: generates the bundled Menlo 5pt glyph atlas - scripts/install.js: postinstall — verifies Python + Pillow + httpx - src/zig/: earlier Zig 0.16 renderer (kept for reference, not built) - CLAUDE.md, HANDOFF.md: contributor notes - package.json: npm entry point, version 0.1.0 Known issue (deferred for separate fix): src/proxy.py:125 — `tallest = max(lines_per_col, last_col_lines) if c_needed == 1 else lines_per_col` pads every single-column image to full MAX_EDGE=1568 height regardless of content, wasting image-token budget for small inputs. Tight bounding would improve savings further. This is the rollback point. Any subsequent changes (Rust port, Python fixes, etc.) build on this proven baseline.
22 lines
1.1 KiB
Plaintext
22 lines
1.1 KiB
Plaintext
MIT License
|
|
|
|
Copyright (c) 2026 claude-image-proxy contributors
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
in the Software without restriction, including without limitation the rights
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
The above copyright notice and this permission notice shall be included in all
|
|
copies or substantial portions of the Software.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
SOFTWARE.
|