Skip to content

edgee-ai/edgee

Edgee

Open-source LLM gateway written in Rust. Route, observe, and compress your AI traffic.

License Edgee Docs Twitter


Edgee is a lightweight LLM gateway that sits between your application and AI providers. It gives you a single control point for routing, observability, and cost optimization, without changing your existing code.

Think of it as an open-source alternative to LiteLLM or OpenRouter, written in Rust for speed and low resource usage, with a built-in token compression engine that reduces your AI costs automatically.

ai-gateway-horizontal-light

Why Edgee

  • One gateway, any provider — Unified API for Anthropic, OpenAI, and other LLM providers. Switch models without touching your app code.
  • Token compression — Edgee analyzes request context and strips redundancy before it reaches the model. Same output, fewer tokens, lower bill.
  • Real-time observability — See exactly how many tokens you're sending, how many you're saving, and what it costs.
  • Rust-native — Fast startup, minimal memory footprint, no runtime dependencies. Runs anywhere Docker runs.

Install

macOS / Linux (curl)

curl -fsSL https://edgee.ai/install.sh | bash

Homebrew (macOS)

brew install edgee-ai/tap/edgee

Windows (PowerShell)

irm https://edgee.ai/install.ps1 | iex

Installs to %LOCALAPPDATA%\Programs\edgee\. You can override the directory with $env:INSTALL_DIR before running.


Quickstart

Use with AI coding assistants

Edgee can wrap your coding assistant and compress traffic automatically:

# Claude Code
edgee launch claude

# Codex
edgee launch codex

# Opencode
edgee launch opencode

Any extra flags you pass after the subcommand are forwarded straight to the underlying agent. For example, to resume the most recent session:

edgee launch claude --resume abcd # continue the last Claude Code session
edgee launch codex resume         # resume the last Codex session
edgee launch opencode -c          # continue the last OpenCode session

Use as a standalone gateway

Point any OpenAI-compatible client at Edgee:

# Start the gateway
edgee serve

# Your app talks to Edgee instead of the provider directly
export OPENAI_BASE_URL=http://localhost:1207/v1

Features

Token compression

Edgee's compression engine analyzes tool outputs (file listings, git logs, build output, test results) and removes noise before they enter the LLM context. The compression is lossless from the model's perspective — responses are identical, but prompts are leaner.

Multi-provider routing

Route requests across Anthropic, OpenAI, and other providers through a single endpoint. Switch models, load-balance, or failover without code changes.

Usage tracking

Real-time visibility into token consumption, compression savings, and cost per request.


Statusline

When you run edgee launch claude, Claude Code shows a live statusline with the current session's token usage and compression savings. No setup required — the first launch auto-installs the integration into ~/.claude/settings.json, and subsequent launches reuse it.

Manage it

edgee statusline claude install   # run the install manually (idempotent)
edgee statusline claude disable   # turn it off
edgee statusline claude enable    # turn it back on
edgee statusline claude doctor    # diagnose project-level conflicts
edgee statusline claude fix       # overlay Edgee on a conflicting project

The install writes two things to ~/.claude/settings.json:

  • statusLine.command = "edgee statusline render" — only if you don't already have a statusLine; we never overwrite yours. (Older Edgee versions wrote edgee statusline without the explicit subcommand; that form now prints help, and is auto-migrated to edgee statusline render on next launch.)
  • A SessionStart hook running edgee statusline claude doctor --warn-only, which prints a one-line warning when you open a project that shadows Edgee.

State is tracked with two empty marker files in ~/.config/edgee/:

  • statusline-claude.installed — set after the first auto-install; gates repeats.
  • statusline-claude.disabled — set by disable; tells the launch flow to skip auto-install too.

Coexistence with project-level statuslines

Claude Code only renders one statusLine, picked by strict precedence: enterprise > project .claude/settings.local.json > project .claude/settings.json > user ~/.claude/settings.json. Any project that defines its own statusLine (via project hooks, in-house scripts, or third-party statusline tools) will completely shadow Edgee's user-level statusline.

Edgee ships a generic merge wrapper so the two can coexist:

# In any project where Edgee is shadowed by a project-level statusLine:
edgee statusline claude doctor   # report: NONE / WRAPPED / SHADOWED
edgee statusline claude fix      # write .claude/settings.local.json with an Edgee overlay

edgee statusline claude fix writes a statusLine.command of the form edgee statusline wrap '<original>' into .claude/settings.local.json (per-user, gitignored). The shared .claude/settings.json is never touched. Each Claude Code refresh then runs Edgee's renderer and the wrapped command in parallel and merges their outputs into a single line.

Precedence guarantee: Edgee's segment is always emitted and is never the one that gets truncated. The wrapped command's output is truncated with to fit the remaining COLUMNS budget, ANSI- and Unicode-aware (CJK and emoji are correctly counted as wide). If the wrapped command times out, errors, or returns nothing, only Edgee's segment renders.

The SessionStart hook installed by edgee statusline claude install (or by the auto-install on first launch) prints a single warning line whenever the current project's statusLine shadows Edgee, and stays silent otherwise.

Environment variables

Variable Default Purpose
EDGEE_STATUSLINE_TIMEOUT_MS 2000 Total timeout for the wrap merge (Edgee + wrapped command).
EDGEE_STATUSLINE_SEPARATOR " │ " String inserted between Edgee's segment and the wrapped output.
EDGEE_STATUSLINE_POSITION left Either left (Edgee on the left, wrapped truncated on the right — recommended) or right.
EDGEE_STATUSLINE_PASS_STDERR unset Set to 1 to forward the wrapped command's stderr to the terminal (off by default).
EDGEE_STATUSLINE_MIN_WRAPPED_WIDTH 10 When the wrapped budget falls below this many cells, drop the wrapped output rather than show a stub.
EDGEE_NO_AUTO_OVERLAY unset Set to 1 to make edgee statusline claude fix print the suggested overlay instead of writing it (for users who manage .claude via dotfiles).
EDGEE_SILENCE_CONFLICT_WARNING unset Set to 1 to silence the SessionStart warning. Per-user via shell env, or per-project via .claude/settings.local.json's env block.

Supported setups

Tool Setup command Status
Claude Code edgee launch claude ✅ Supported
Codex edgee launch codex ✅ Supported
Opencode edgee launch opencode ✅ Supported
Cursor edgee launch cursor 🔜 Coming soon
Any OpenAI-compatible client edgee serve ✅ Supported

Acknowledgments

The token compression engine in Edgee is derived from RTK, created by Patrick Szymkowiak and contributors at rtk-ai Labs. RTK pioneered local tool-output compression for AI coding assistants, and we built on their work to bring the same optimizations to a gateway architecture.

RTK is licensed under the Apache License 2.0. All derived files retain the original copyright notice and are individually marked with a modification history. See LICENSE-APACHE and NOTICE for full details.

If you're looking for a local-first compression tool, check out RTK directly, it's excellent for individual developer workflows.


Contributing

Edgee is Apache 2.0 licensed and we genuinely want your contributions.

git clone https://github.com/edgee-ai/edgee
cd edgee
cargo build

See CONTRIBUTING.md for the full guide. For bigger changes, open an issue first so we can align before you build.


Community

About

Open-source AI gateway written in Rust, with token compression for Claude Code, Codex... and any other LLM client.

Topics

Resources

License

Apache-2.0, Unknown licenses found

Licenses found

Apache-2.0
LICENSE
Unknown
LICENSE-APACHE

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors