{"id":579,"date":"2026-09-12T21:16:51","date_gmt":"2026-09-12T12:16:51","guid":{"rendered":"https:\/\/localmodelwatch.tsuchitsuchi.com\/2026\/09\/12\/litelm-lightweight-llm-routing-library\/"},"modified":"2026-09-20T17:37:21","modified_gmt":"2026-09-20T08:37:21","slug":"litelm-lightweight-llm-routing-library","status":"publish","type":"post","link":"https:\/\/localmodelwatch.tsuchitsuchi.com\/en\/2026\/09\/12\/litelm-lightweight-llm-routing-library\/","title":{"rendered":"litelm: Lightweight LLM Routing Library Released"},"content":{"rendered":"<h2>Overview<\/h2>\n<p><code>litelm<\/code>, a lightweight LLM routing library, has been released. This library aims to extract only the core features\u2014model routing and message format translation\u2014from the existing <code>litellm<\/code>, minimizing code size and dependencies.<\/p>\n<h2>Claims and Rationale<\/h2>\n<p>According to the developer&#8217;s claims, by eliminating the proxy server, caching layer, cost tracking, and dozens of features that many users do not use from <code>litellm<\/code>, <code>litelm<\/code> is composed of only about 2,900 lines of code and two dependencies (<code>openai<\/code>, <code>httpx<\/code>).<\/p>\n<h3>Feature Comparison<\/h3>\n<p>Here is the comparison regarding the presence or absence of features between <code>litellm<\/code> and <code>litelm<\/code>.<\/p>\n<div class=\"lmw-table-scroll\" tabindex=\"0\" style=\"overflow-x:auto;-webkit-overflow-scrolling:touch;max-width:100%;\">\n<table style=\"width:max-content;min-width:100%;border-collapse:collapse;\">\n<thead>\n<tr>\n<th style=\"text-align: left;\">Feature<\/th>\n<th style=\"text-align: center;\">litellm<\/th>\n<th style=\"text-align: center;\">litelm<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\">Model routing (provider\/model \u2192 right endpoint)<\/td>\n<td style=\"text-align: center;\">\u2713<\/td>\n<td style=\"text-align: center;\">\u2713<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">Message translation (Anthropic, Bedrock, Cloudflare, Mistral)<\/td>\n<td style=\"text-align: center;\">\u2713<\/td>\n<td style=\"text-align: center;\">\u2713<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">Streaming + stream_chunk_builder<\/td>\n<td style=\"text-align: center;\">\u2713<\/td>\n<td style=\"text-align: center;\">\u2713<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">Tool use (function calling)<\/td>\n<td style=\"text-align: center;\">\u2713<\/td>\n<td style=\"text-align: center;\">\u2713<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">Embeddings<\/td>\n<td style=\"text-align: center;\">\u2713<\/td>\n<td style=\"text-align: center;\">\u2713<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">Text completions<\/td>\n<td style=\"text-align: center;\">\u2713<\/td>\n<td style=\"text-align: center;\">\u2713<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">OpenAI Responses API<\/td>\n<td style=\"text-align: center;\">\u2713<\/td>\n<td style=\"text-align: center;\">\u2713<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">Mock responses<\/td>\n<td style=\"text-align: center;\">\u2713<\/td>\n<td style=\"text-align: center;\">\u2713<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">Router (load balancing, fallbacks)<\/td>\n<td style=\"text-align: center;\">\u2713<\/td>\n<td style=\"text-align: center;\">\u2717<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">Proxy server<\/td>\n<td style=\"text-align: center;\">\u2713<\/td>\n<td style=\"text-align: center;\">\u2717<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">Caching \/ budgeting \/ cost tracking<\/td>\n<td style=\"text-align: center;\">\u2713<\/td>\n<td style=\"text-align: center;\">\u2717<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">Token counting<\/td>\n<td style=\"text-align: center;\">\u2713<\/td>\n<td style=\"text-align: center;\">\u2717<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">Image gen, audio, OCR, fine-tuning<\/td>\n<td style=\"text-align: center;\">\u2713<\/td>\n<td style=\"text-align: center;\">\u2717<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">Agents, guardrails, scheduler<\/td>\n<td style=\"text-align: center;\">\u2713<\/td>\n<td style=\"text-align: center;\">\u2717<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h3>Provider Support Status<\/h3>\n<p><code>litelm<\/code> supports routing to 19 providers using the syntax &#8220;provider\/model-name&#8221;. However, the documentation reports that operation is unverified (Verified: No) for the following providers:<\/p>\n<ul>\n<li>Bedrock, Cloudflare, Together, Fireworks, DeepSeek, Perplexity, DeepInfra, Gemini, Cohere, Ollama, vLLM, LM Studio<\/li>\n<\/ul>\n<p>On the other hand, operation is confirmed (Verified: Yes) for OpenAI, Anthropic, Groq, Mistral, xAI, OpenRouter, and Azure.<\/p>\n<h3>Development Status and Verification<\/h3>\n<p>This project is currently in Alpha status. According to reports from the developer, the following verifications have been conducted:<\/p>\n<ul>\n<li>Reviewed 360 core path commits and fixed compatibility gaps.<\/li>\n<li>Local scope tests: 262 passed, 55 skipped.<\/li>\n<li>All 45 available provider live tests passed.<\/li>\n<li>All 10 DSPy smoke tests passed.<\/li>\n<li>DSPy drop-in compatibility (Predict, CoT, typed signatures, streaming, embeddings, tool use, multi-output) has also been verified.<\/li>\n<\/ul>\n<h2>Hardware Requirements<\/h2>\n<ul>\n<li>Language: Python<\/li>\n<li>Dependencies: <code>openai<\/code>, <code>httpx<\/code> (standard installation)<\/li>\n<li>Additional SDKs as needed (<code>anthropic<\/code>, <code>boto3<\/code>, etc.)<\/li>\n<\/ul>\n<h2>How to Get It<\/h2>\n<p>It can be installed using <code>pip<\/code>.<\/p>\n<pre><code class=\"language-bash\">pip install litelm                # openai + httpx\npip install litelm[anthropic]     # + anthropic SDK\npip install litelm[bedrock]       # + boto3\npip install litelm[all]           # everything\n<\/code><\/pre>\n<h3>Basic Usage<\/h3>\n<p>The API mirrors <code>litellm<\/code>, sharing function names, arguments, and response types. Asynchronous versions (<code>acompletion<\/code>, <code>aembedding<\/code>, <code>aresponses<\/code>, <code>atext_completion<\/code>) are provided for all functions.<\/p>\n<pre><code class=\"language-python\">import litelm\n\n# Basic Completion\nresponse = litelm.completion(&quot;openai\/gpt-4o&quot;, messages=[{&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: &quot;Hello!&quot;}])\nprint(response.choices[0].message.content)\n\n# Streaming\nfor chunk in litelm.completion(&quot;groq\/llama-3.1-70b-versatile&quot;, messages=[...], stream=True):\n    print(chunk.choices[0].delta.content or &quot;&quot;, end=&quot;&quot;)\n\n# Embeddings\nresponse = litelm.embedding(&quot;openai\/text-embedding-3-small&quot;, input=[&quot;hello world&quot;])\n<\/code><\/pre>\n<h3>Error Handling<\/h3>\n<p>Provider errors are mapped to <code>litelm<\/code>&#8216;s exception hierarchy.<\/p>\n<pre><code class=\"language-python\">from litelm import ContextWindowExceededError, RateLimitError, AuthenticationError\n\ntry:\n    response = litelm.completion(&quot;openai\/gpt-4o&quot;, messages=messages)\nexcept ContextWindowExceededError:\n    # Handling when the prompt is too long\n    pass\nexcept RateLimitError:\n    # Handling rate limits\n    pass\nexcept AuthenticationError:\n    # Handling invalid API keys\n    pass\n<\/code><\/pre>\n<h3>Local and Custom Providers<\/h3>\n<p>By specifying <code>api_base<\/code>, any server with an OpenAI-compatible endpoint can be used.<\/p>\n<pre><code class=\"language-python\"># vLLM\nlitelm.completion(&quot;openai\/my-model&quot;, messages=[...], api_base=&quot;http:\/\/localhost:8000\/v1&quot;)\n\n# Ollama\nlitelm.completion(&quot;ollama\/llama3&quot;, messages=[...], api_base=&quot;http:\/\/localhost:11434\/v1&quot;)\n\n# LM Studio\nlitelm.completion(&quot;openai\/local-model&quot;, messages=[...], api_base=&quot;http:\/\/localhost:1234\/v1&quot;)\n<\/code><\/pre>\n<h3>Using Tool Calling<\/h3>\n<pre><code class=\"language-python\">tools = [{\n    &quot;type&quot;: &quot;function&quot;,\n    &quot;function&quot;: {\n        &quot;name&quot;: &quot;get_weather&quot;,\n        &quot;parameters&quot;: {&quot;type&quot;: &quot;object&quot;, &quot;properties&quot;: {&quot;city&quot;: {&quot;type&quot;: &quot;string&quot;}}},\n    }\n}]\n\nresponse = litelm.completion(\n    &quot;openai\/gpt-4o&quot;,\n    messages=[{&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: &quot;Weather in Paris?&quot;}],\n    tools=tools,\n    tool_choice=&quot;required&quot;,\n)\n\ntool_call = response.choices[0].message.tool_calls[0]\nprint(tool_call.function.name, tool_call.function.arguments)\n<\/code><\/pre>\n<h2>What the Sources Do Not Cover<\/h2>\n<ul>\n<li>Specific figures regarding improvements in latency or memory usage compared to <code>litellm<\/code>.<\/li>\n<li>Specific operational stability for providers reported as unverified (Verified: No).<\/li>\n<\/ul>\n<h2>Sources<\/h2>\n<ul>\n<li><a href=\"https:\/\/github.com\/kennethwolters\/litelm\">https:\/\/github.com\/kennethwolters\/litelm<\/a><\/li>\n<\/ul>\n<p><!-- lmw:updates --><\/p>\n<h2>Update History<\/h2>\n<ul>\n<li>2026-09-19: Rewrote the article from re-collected sources and restored it from draft to published.<\/li>\n<\/ul>\n<p><!-- \/lmw:updates --><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Discover litelm, a lightweight LLM routing library extracting core routing and message format translation features from litellm with minimal dependencies.<\/p>\n","protected":false},"author":1,"featured_media":578,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1528],"tags":[1652,1091,136,1093,590,1547,592],"class_list":["post-579","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technical-reports","tag-litellm-en","tag-litelm-en","tag-llm-en","tag-ollama-en","tag-python-en","tag-verified","tag-vllm-en"],"lang":"en","translations":{"en":579,"ja":577},"_links":{"self":[{"href":"https:\/\/localmodelwatch.tsuchitsuchi.com\/en\/wp-json\/wp\/v2\/posts\/579","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/localmodelwatch.tsuchitsuchi.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/localmodelwatch.tsuchitsuchi.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/localmodelwatch.tsuchitsuchi.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/localmodelwatch.tsuchitsuchi.com\/en\/wp-json\/wp\/v2\/comments?post=579"}],"version-history":[{"count":7,"href":"https:\/\/localmodelwatch.tsuchitsuchi.com\/en\/wp-json\/wp\/v2\/posts\/579\/revisions"}],"predecessor-version":[{"id":2305,"href":"https:\/\/localmodelwatch.tsuchitsuchi.com\/en\/wp-json\/wp\/v2\/posts\/579\/revisions\/2305"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/localmodelwatch.tsuchitsuchi.com\/en\/wp-json\/wp\/v2\/media\/578"}],"wp:attachment":[{"href":"https:\/\/localmodelwatch.tsuchitsuchi.com\/en\/wp-json\/wp\/v2\/media?parent=579"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/localmodelwatch.tsuchitsuchi.com\/en\/wp-json\/wp\/v2\/categories?post=579"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/localmodelwatch.tsuchitsuchi.com\/en\/wp-json\/wp\/v2\/tags?post=579"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}