Lean Relay banner
mkhalid-s mkhalid-s

Lean Relay

Development community

Description

LeanRelay: local context-efficiency platform for LLMs. One stable Claude Code gateway for Headroom, pxpipe, and Squeezr chains, with metrics and atomic releases. CLI: apx.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

LeanRelay

**Local context-efficiency platform for LLMs — operated through the `apx` CLI.**

LeanRelay is a cross-platform orchestration and observability layer for local AI proxies and context optimizers. It gives Claude Code one durable base URL while allowing you to switch between Headroom, pxpipe, Squeezr, direct provider access, or an ordered custom chain. The proxy runtime can also run inside Linux/devcontainers without macOS LaunchAgent management.

Claude Code -> apx Gateway :8787 -> optional local optimizers -> upstream API

Claude Code always talks to the Gateway. Modes and chains change what happens after the Gateway, so the client base URL remains stable.

**LeanRelay** is the project name. The CLI, gateway, and Squeezr helper are `apx`, `apx-gateway`, and `apx-squeezr`.

Why LeanRelay Exists

Local context and token-optimization proxies are useful, but operating several of them independently creates recurring problems:

  • every tool wants a different port, process lifecycle, configuration, and dashboard
  • changing tools often requires editing and restarting Claude Code
  • chained proxies can silently point at the wrong next hop
  • comparing savings, latency, cache behavior, and errors across tools is difficult
  • experimental installs leave caches, processes, settings, and binaries behind
  • upgrades can break a working setup without a simple rollback path

LeanRelay was created to make those experiments repeatable. It centralizes routing, service supervision, health checks, configuration, metrics, upgrades, rollbacks, and uninstall safety while leaving each optimizer responsible for its own transformation logic.

What LeanRelay Does

  • exposes a stable Anthropic-compatible Gateway on 127.0.0.1:8787
  • starts and supervises enabled local proxy services
  • compiles named modes and freeform chains into explicit per-hop target URLs
  • switches chains without changing Claude Code's base URL
  • records local request metadata, latency, token