A local HTTPS intercepting proxy that cuts Devin input context cost by rendering bulky text as dense PNG attachments.
Inspired by pxpipe.
Devin sessions can send large system prompts, tool documentation, and chat history on every request. Those long text blocks are billed as input tokens / ACU.
devinpipe sits between the Devin CLI and api.devin.ai. It rewrites large message / prompt fields into compact PNG pages, uploads them as Devin attachments, and replaces the original text with references to the uploaded images. The model still sees the same context, but you pay for image tokens instead of text tokens — typically much cheaper for dense code, JSON, and transcript history.
From npm (recommended):
npm install -g devinpipeOr run without installing:
npx devinpipe --helpFrom source (one-liner):
curl -fsSL https://raw.githubusercontent.com/VaiYav/devinpipe/main/scripts/install-global.sh | bashThis clones the repo to ~/.local/share/devinpipe, builds it, and symlinks devinpipe into ~/.local/bin.
From source (manual):
git clone https://github.com/VaiYav/devinpipe.git
cd devinpipe
pnpm install
pnpm run build
pnpm install:cli # symlinks devinpipe into ~/.local/bindevinpipe is opt-in. Start it before devin by wrapping the command:
# One-shot: starts the proxy, runs devin, stops the proxy
devinpipe run devin
# With custom port/host
devinpipe run --port 47822 -- devin --print "hello"
# Or start the proxy as a daemon and use HTTPS_PROXY manually
devinpipe start --port 47822
export HTTPS_PROXY=http://127.0.0.1:47822
devin --print "hello"
devinpipe stopOpen the savings dashboard at http://127.0.0.1:47822/ (or the port you chose) to see tokens saved and every text→image conversion side by side.
devinpipe terminates TLS locally, so it needs a trusted root CA on your machine. Install it once:
devinpipe install-caYou can remove it later with devinpipe uninstall-ca.
start [--port <n>] [--host <ip>]— start the HTTPS intercepting proxy.stop— stop a running proxy.status [--port <n>] [--host <ip>]— check whether the proxy is running.run [opts] [--] <command> [args...]— start the proxy, run a command withHTTPS_PROXY, then stop the proxy.install-ca— install the generated root CA into the OS trust store.uninstall-ca— remove the root CA.export <file>— render a text file to PNG pages (page-0.png, ...).dashboard— open the local savings dashboard in a browser.--version, -v— print version.--help, -h— print help.
You can render text or files to PNG pages without running the proxy:
devinpipe export src/
cat prompt.txt | devinpipe export --stdin
devinpipe export --gitEach run creates a fresh devinpipe-export-XXXXXX/ folder containing page-*.png, factsheet.txt, manifest.json, and prompt.txt.
devinpipe rewrites POST requests to:
POST /v3/organizations/{org_id}/sessionsPOST /v3/organizations/{org_id}/sessions/{devin_id}/messagesPOST /v1/sessionsPOST /v1/sessions/{id}/message
Other traffic is forwarded unchanged.
The Devin CLI currently talks to https://server.codeium.com using gRPC-Web (protobuf) framing. devinpipe tunnels that traffic unchanged so the CLI still works, but it does not yet transform gRPC-Web payloads.
- You route HTTPS traffic through
devinpipe(HTTPS_PROXYor~/.config/devin/config.jsonproxysetting). devinpipeterminates TLS using a local root CA and inspects POST requests to the configured upstream.- Large
message/prompttext blocks are rendered to compact PNG pages using the same renderer that powers pxpipe. - PNGs are uploaded via the Devin attachments endpoint and the request body is rewritten to reference them.
- Savings and conversion events are logged to
~/.devinpipe/events.jsonland shown on the local dashboard.
Place a ~/.devinpipe/config.json file:
{
"port": 47822,
"host": "127.0.0.1",
"upstream": "https://api.devin.ai",
"minCompressChars": 6000
}pnpm install
pnpm typecheck
pnpm test
pnpm run buildSee ROADMAP.md for planned features.
MIT. Inspired by pxpipe by teamchong.
More about Valentyn Yakovliev: https://vaiyav.online/