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/adminfor 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).
- Install the CLI (above).
- One-time Deep deps on this PC (local Microsoft LLMLingua - not Trim cloud; package managers never pip-install it):
trim compress --bootstrap
- Sign in and create an API key:
trim login
- Start the local proxy (one-shot), or enable Always-on:
trim start
trim autostart enable
- In your IDE, set the OpenAI-compatible Base URL to:
http://127.0.0.1:8888/v1
- Optional: install Trim IDE (publisher
usetrim) 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 |
- DNS - point apex/www,
api, andadminat your hosts (Cloudflare DNS is fine on the Free plan). - Supabase - apply SQL in
supabase/migrations/in filename order . Enable Google, GitHub, and GitLab Auth; set redirect URLs for web, admin, and localhost. Set APIJWT_SECRETto the Supabase JWT secret. - Redis - set
REDIS_URL(rediss://β¦for Upstash). - Env - copy and fill:
server/.env.exampleβ APIapps/web/.env.exampleβ webapps/admin/.env.exampleβ admin
- 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. - Deploy - API from
server/; web fromapps/web; admin fromapps/admin. - 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:
- Hosted: use-trim.com/docs
- Source:
apps/web/src/lib/docs/
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_SECRETand 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.