litelm strips LiteLLM to 2,900 lines: just routing and translation
A developer has released litelm, a pared-down reimplementation of the popular litellm library that keeps only the piece most people actually use: the call path that routes requests across LLM providers and translates between their message formats. The original litellm bundles proxy servers, caching, cost tracking and dozens of other features across more than 100,000 lines of code; litelm reduces that to roughly 2,900 lines with just two base dependencies (openai and httpx), pulling in provider SDKs like anthropic or boto3 only as optional extras. It supports 19 providers plus any OpenAI-compatible endpoint (vLLM, Ollama, LM Studio) via an api_base override, and covers completions, streaming, embeddings, tool calls and a mapped exception hierarchy.
The project’s main selling point is that it deliberately mirrors litellm’s public API — same function names, arguments and response types — so migrating is described as a find-and-replace of the import name. That drop-in promise is scoped, however. The maintainer explicitly attests only to the routing, formatting and DSPy surface, not full litellm compatibility, and the software is labeled alpha. Compatibility was established by auditing 360 core-path upstream commits, porting tests, and fixing gaps test-first, with 262 local tests passing alongside live provider and DSPy smoke tests.
The release is also a notable data point on AI-assisted development practices. The maintainer documents that much of the code was written with Claude Code (Opus 4.6/4.7) and later GPT-5.5, while stressing that compatibility claims rest on tests and human review rather than on the fact that an AI wrote the code. For teams weary of dependency bloat, litelm is a bet that a small, auditable core beats a feature-complete framework — provided you only need the call path and can tolerate alpha-stage maturity.
Read the full article
Continue reading at Hacker News →This is an AI-generated summary. Read the original for the full story.