On a developer laptop the `lite` CLI only needs `lite login` and running coding agents through a proxy, but the sole install path was `litellm[proxy]`, which drags in the whole server tree (fastapi, uvicorn, boto3, polars, cryptography, litellm-enterprise). The CLI's heavy imports are all guarded, so it runs on the base SDK plus just rich, pyyaml and requests. Add a `cli` extra carrying exactly those three, a `scripts/install-cli.sh` curl one-liner that installs `litellm[cli]`, and a `BerriAI/homebrew-litellm` tap formula with a release runbook under `packaging/homebrew/`. The installer passes no `--python`, so uv honours litellm's requires-python and provisions a managed interpreter, skipping a too-old (3.9) or too-new (3.14+) system Python instead of failing to resolve. A pyproject thin-contract test asserts the `cli` extra keeps the deps the CLI imports and never leaks a server-only dependency from `proxy`, so the laptop install cannot silently re-bloat |
||
|---|---|---|
| .. | ||
| lite.rb | ||
| README.md | ||
Homebrew formula for the lite CLI
lite.rb is the canonical source for the Homebrew formula that installs the thin LiteLLM CLI (litellm[cli]). It lives here so it is versioned with the code, but Homebrew serves formulae from a tap, so it has to be published to the BerriAI/homebrew-litellm tap to be installable.
Once published, end users install with
brew install BerriAI/litellm/lite
which gives them the lite command (lite login, lite claude, lite models list, ...) without the proxy server runtime. For the full proxy server, they keep using pip/uv with litellm[proxy] or the Docker image.
Why a tap and not homebrew-core
The formula builds the published litellm sdist with the cli extra and resolves that extra's dependencies from PyPI at build time. homebrew-core forbids network access during install and would require every transitive dependency declared as a pinned resource, regenerated on each release. For a fast-moving CLI that tradeoff is not worth it, so this stays a tap formula.
Release runbook
The formula can only point at a published artifact, so it activates with the first litellm release that ships the cli extra (added in pyproject.toml).
- Cut a
litellmrelease whosepyproject.tomlincludes thecliextra and confirm it is on PyPI. - Fetch the sdist URL and checksum for that version:
curl -fsSL https://pypi.org/pypi/litellm/<version>/json | jq -r '.urls[] | select(.packagetype=="sdist") | "\(.url)\n\(.digests.sha256)"' - Set
urlandsha256inlite.rbto those values;versionis parsed fromurl. - Copy
lite.rbinto the tap repo underFormula/lite.rb, then runbrew install --build-from-source ./Formula/lite.rbandbrew test liteto verify a clean build and thatlite --helpworks. - Commit and push to
BerriAI/homebrew-litellm.
Keep lite.rb here in sync with the tap copy so the in-repo formula stays the source of truth.