cd /news/ai-tools/trim-local-proxy-that-compresses-cod… Β· home β€Ί topics β€Ί ai-tools β€Ί article
[ARTICLE Β· art-163048] src=github.com β†— pub= topic=ai-tools verified=true sentiment=↑ positive

Trim - local proxy that compresses coding prompts before they reach your LLM

Trim launched as an OpenAI-compatible local proxy at http://127.0.0.1:8888/v1 that compresses coding prompts before they reach upstream LLM providers, aimed at clients including Cursor, Continue, VS Code Chat and Claude Code. The tool offers Fast Mode, AST/heuristic compression on the hot path via `trim start`, and Deep Mode, which runs Microsoft's LLMLingua on-device only and compresses each last-user prose island in place while freezing tools and paths. An optional cloud control plane adds Google, GitHub and GitLab login, credits, Paddle billing, receipts and workspaces, and the CLI is distributed via install scripts, npm (@usetrim/trim) and Homebrew under an MIT license.

read6 min views2 publishedNov 3, 2026
Trim - local proxy that compresses coding prompts before they reach your LLM
Image: Michielbdejong (auto-discovered)

Local context optimization for AI coding tools, with an optional cloud control plane for auth, quotas, billing, and receipts.

Point Cursor, Continue, VS Code Chat, Claude Code, and similar clients at a local OpenAI-compatible proxy. Trim reduces prompt size before requests reach your upstream provider. Deep Mode runs on your machine only - never in Trim cloud.

Website: use-trim.com Β· Docs: use-trim.com/docs Β· Security: SECURITY.md

  • OpenAI-compatible local proxy - one Base URL (http://127.0.0.1:8888/v1 ) for coding IDEs and CLIs
  • Fast Mode - AST / heuristic compression on the hot path (trim start )
  • Deep Mode - Segmented Allowlist Deep on the live proxy when Preferences Deep is on (freeze tools/paths; compress each last-user prose island in place, order preserved); LLMLingua stays on-device
  • Cloud control plane (optional) - Google / GitHub / GitLab login, credits, Paddle billing, receipts, workspaces
  • Operator console -apps/admin for plans, billing settings, provider adapters, compliance

macOS / Linux

curl -fsSL https://use-trim.com/install.sh | sh

Windows (PowerShell)

irm https://use-trim.com/install.ps1 | iex

npm

npm install -g @usetrim/trim

Homebrew

brew install usetrim/tap/trim

From source (Go)

git clone https://github.com/usetrim/trim.git
cd trim/cli && go install ./cmd/trim

go install github.com/usetrim/trim/cli/cmd/trim@v… is not supported while cli/go.mod contains a local replace for the server module. Use a clone, Release binaries, npm, or Homebrew instead.

Optional flags (Unix installer): TRIM_WITH_TREESITTER=1, TRIM_WITH_ZIG_TREESITTER=1, TRIM_WITH_DEEP=1.

Telemetry from installers is privacy-light and soft-fail. Opt out with DO_NOT_TRACK=1 or TRIM_TELEMETRY_DISABLED=1.

Package-manager ops (tokens, taps): packaging/README.md. #

No environment variables required for Trim Cloud (official npm / Homebrew / installers).

  1. Install the CLI (above).
  2. One-time Deep deps on this PC (local Microsoft LLMLingua - not Trim cloud; package managers never pip-install it):
trim compress --bootstrap
  1. Sign in and create an API key:
trim login
  1. Start the local proxy (one-shot), or enable Always-on:
trim start
trim autostart enable
  1. In your IDE, set the OpenAI-compatible Base URL to:
http://127.0.0.1:8888/v1
  1. Optional: install Trim IDE (publisherusetrim ) from the VS Code Marketplace or Open VSX for Always-on proxy + dashboard metrics. Seeextensions/trim-ide/README.md .

Always-on: leave Start Trim with your IDE checked in the dashboard (or trim autostart enable). OS logon uses launchd / systemd user / Windows Startup Run β†’ %LOCALAPPDATA%\Trim\bin - preference stays on even if OS registration is blocked; then use trim start or the IDE extension. Docs: Always-on, trim autostart.

Everyday vs advanced commands: trim help. Always-on details: trim help autostart Β· trim help daemon.

Uninstall:

trim uninstall
trim uninstall --keep-data
Path Role License
cli/ Local proxy, compress, setup, daemon, TUI MIT
server/ Go API (auth, quotas, webhooks, admin) AGPL-3.0
apps/web/ Next.js product site + dashboard MIT
apps/admin/ Operator console MIT
apps/docs/ Docs packaging notes (content lives in web /docs ) MIT
extensions/trim-ide/ VS Code / Open VSX extension MIT
supabase/migrations/ Postgres schema and seeds -
packaging/ Homebrew / Scoop / winget runbooks -

Prerequisites: Go 1.22+, Node.js 20+, Docker (Postgres + Redis), Git.

docker compose up -d

cd server
cp .env.example .env
go run ./cmd/api

cd apps/web
cp .env.example .env.local
npm install
npm run dev

cd cli
cp .env.example .env   # local builds: set TRIM_CLI_HMAC_SECRET (official releases bake it)
go run ./cmd/trim start
  • API default: http://localhost:8080
  • Web default: http://localhost:3000
  • Local proxy dashboard: http://localhost:8888/dashboard

Full contributor setup: CONTRIBUTING.md.

trim start                          # local OpenAI-compatible proxy
trim compress path/to/file.go --mode fast
trim compress docs.txt --deep --engine v2
trim compress --bootstrap           # first-time Deep deps (green success banner)
trim config sync                    # pull cloud preferences
trim setup                          # print IDE / shell wiring
trim tui                            # local stats (+ cloud quota when logged in)

Copy .trimrc.example β†’ .trimrc for compression modes (mild | balanced | aggressive | custom).

Trim’s hosted product uses:

Piece Typical host Hostname
Web Vercel / Cloudflare Pages use-trim.com ,www.use-trim.com
API Render (Docker: server/Dockerfile ) api.use-trim.com
Admin Vercel (second project) admin.use-trim.com
Database + Auth Supabase -
Redis Upstash -
Billing Paddle Billing (MoR) webhook β†’ /webhooks/paddle
  1. DNS - point apex/www,api , andadmin at your hosts (Cloudflare DNS is fine on the Free plan).
  2. Supabase - apply SQL insupabase/migrations/in filename order . Enable Google, GitHub, and GitLab Auth; set redirect URLs for web, admin, and localhost. Set APIJWT_SECRET to the Supabase JWT secret.
  3. Redis - setREDIS_URL (rediss://… for Upstash).
  4. Env - copy and fill:
  • server/.env.example β†’ API
  • apps/web/.env.example β†’ web
  • apps/admin/.env.example β†’ admin
  1. Paddle - configure plans and sync fromAdmin β†’ Plans (preferred). Webhook:https://api.use-trim.com/webhooks/paddle . Prices live in the database (plan_catalog +billing_settings ), not in.env .
  2. Deploy - API fromserver/ ; web fromapps/web ; admin fromapps/admin .
  3. Smoke test - OAuth login β†’ API key β†’trim start β†’ checkout / upgrade β†’ receipt.

Admin console details: apps/admin/README.md.

Release / taps / signing: packaging/README.md.

Situation Behavior
Free or expired New checkout for a paid plan
Active paid β†’ higher plan Upgrade with Paddle proration (mode from billing_settings )
Active paid β†’ lower plan Blocked while the period is unexpired (no self-serve downgrade)
Monthly β†’ annual (same plan) Treated as upgrade when enabled in settings
Annual β†’ monthly (same plan) Blocked while unexpired
Top-up packs Always a new checkout (tier unchanged)

Plan order is plan_catalog.plan_rank. Optional Unlimited metering is a per-plan operator dial (plan_catalog.unlimited, default off) - not a client-side flag.

Product docs ship with the web app:

Topics include IDE setup (Cursor, Continue, VS Code, Claude Code, and others), metering, security (device binding, fraud layers), CLI reference, and dashboard / admin guides.

  • Report vulnerabilities privately - see SECURITY.md
  • Never put the Supabase service role key in browser env
  • Lock CORS_ORIGINS / admin origins to real hosts
  • Rotate JWT_SECRET and Paddle secrets if leaked

See CONTRIBUTING.md and GOVERNANCE.md.

Please open a pull request against main. Keep UI copy and public strings backend-driven where the product already expects site_messages / API chrome (no hardcoded marketing or error invention in clients).

Dual license - see LICENSE:

Components License
cli/ ,apps/web/ ,apps/docs/ ,extensions/ MIT
server/ (hosted control plane) AGPL-3.0

If you modify and host the backend as a network service, AGPL-3.0 source disclosure obligations apply.

── more in #ai-tools 4 stories Β· sorted by recency
── more on @trim 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain β€” perfect for shipping the agent you just read about.

$git push zahid main
β†’ Live at https://your-agent.zahid.host βœ“
Get free account β†’ Pricing
from €0/mo Β· no card required
LIVE [news/trim-local-proxy-tha…] indexed:0 read:6min 2026-11-03 Β· β€”