litellm without the 100k lines

A stripped-down rewrite keeps the multi-provider call path and throws out the proxy, cache, and cost tracking.

8 cards · 1m 40s · tap to begin

From · · 1m 40s

litellm without the 100k lines

A stripped-down rewrite keeps the multi-provider call path and throws out the proxy, cache, and cost tracking.

In brief

A stripped-down rewrite keeps the multi-provider call path and throws out the proxy, cache, and cost tracking. If you only use litellm to call models across providers, litelm gives you that same API in ~2,900 lines and two dependencies. Originally reported by GitHub.

The core, unburied

The core, unburied

litellm's actual job is routing calls across providers and translating message formats. That sits under 100k+ lines of proxy servers, caching, and cost tracking most people never touch.

“litellm's routing + translation in ~2,900 lines and 2 dependencies”

Two dependencies, full stop

The base install pulls only openai and httpx. Anthropic SDK and boto3 are optional extras you add when you actually need Anthropic or Bedrock.

Switching is a find and replace

Same function names, same arguments, same response types. Migrating from litellm is literally s/litellm/litelm/ across your imports, and every function has an async twin.

“switching is s/litellm/litelm/ in your imports”

What stayed in

Model routing, message translation, streaming, tool calling, embeddings, text completions, the OpenAI Responses API, and mock responses. The whole call path survives intact.

What got cut

No Router class, so no load balancing or fallbacks. No proxy server, no caching, no budgeting or cost tracking, no token counting, no image gen or audio, no agents or guardrails.

“No Router class, no proxy, no caching.”

Nineteen providers, one syntax

Call anything as "provider/model-name", from OpenAI and Anthropic to Groq, Mistral, xAI, and Bedrock. Any OpenAI-compatible server, including Ollama and vLLM, works by passing api_base.

Errors you can catch

Provider errors map to one hierarchy: ContextWindowExceededError, RateLimitError, AuthenticationError. You handle a rate limit the same way no matter who threw it.

Alpha, but receipts included

262 tests passing, 45 live provider tests green, and DSPy verified across all seven execution paths. The maintainer audited 360 upstream commits and fixed the gaps test-first.

“This attests litelm's declared routing/formatting/DSPy surface only, not full litellm compatibility.”

In short

If you only use litellm to call models across providers, litelm gives you that same API in ~2,900 lines and two dependencies.

Read the original on GitHub

React

Sign in to react and comment.

Comments (0)

Life is short. Keep it sweet. Respect others' opinions and be kind!

    Recommended next

    More decks on llm tooling and related topics.