liter-llm

Library Listed

Universal LLM API client — 174 providers, streaming, tool calling. Rust-powered, type-safe, compiled.

Checked · Sources

Downloads
13,151
Dependents
8
Stars
264
Forks
27
Contributors
13
Commits
2,187
Latest release
2.7.0 ·

About

From the project README ·

One API for every LLM — in your language, without the rewrites.

What and Why?

liter-llm gives you a single, consistent way to call any large language model. Reach 174 providers — OpenAI, Anthropic, Google, Bedrock, and more — through one client, and switch models by changing a name instead of your code. The same client ships to 14 languages, all built on one Rust core, so you get identical behavior everywhere. Need a gateway? Point your existing OpenAI SDK at the built-in, drop-in proxy — no rewrites, no separate service to run.

Read the full README
  • Work with any provider without rewrites — 174 providers behind one API; change the model name to switch, your code stays the same.
  • Use it from your language — Python, TypeScript, Go, Java, Kotlin, C#, Ruby, PHP, Elixir, Dart, Swift, Zig, and WebAssembly, all built on the same Rust core, plus a C/FFI surface for everything else.
  • Secure by default — API keys are wrapped, redacted from logs, and never serialized; cloud auth for Azure, AWS, and Vertex refreshes and rotates for you.
  • One small binary — the client, a drop-in OpenAI-compatible proxy, and an MCP server for AI agents ship in a single 35 MB binary with no interpreter and no dependency tree to compromise.
  • Stay up when a provider fails — route by cost, latency, or weight and fall back automatically, with built-in rate limiting, caching, and cost tracking.

Deeper details — observability, middleware, and the full endpoint list — live in the documentation.

We credit litellm for proving the category; our provider registry was bootstrapped from theirs. See ATTRIBUTIONS.md.

Features
FeatureDescription
174 providersOpenAI, Anthropic, Google, AWS Bedrock, Groq, Mistral, Together, Fireworks, DeepSeek, Cohere, and 130+ more — compiled at build time
14 native bindingsRust, Python, Node.js, Go, Java, Kotlin, C#, Ruby, PHP, Elixir, Dart, Swift, Zig, WebAssembly — plus a shared C/FFI surface
First-class streamingSSE and AWS EventStream binary protocol with zero-copy buffers
Proxy & MCP serverDrop-in OpenAI-compatible proxy (22 endpoints) and MCP tool server in a 35 MB Docker image
Tower middlewareRate limiting, caching (40+ OpenDAL backends), cost tracking, budget enforcement, health checks, and fallback — all composable
ObservabilityOpenTelemetry with GenAI semantic conventions, cost-tracking spans, and HTTP-level tracing
Tool callingParallel tools, structured outputs, and JSON-schema validation
Search & OCRWeb search across 12 providers, document OCR across 4
TOML configurationliter-llm.toml auto-discovery, custom providers, cache backends, and middleware config
Local LLM supportOllama through its native API; LM Studio, vLLM, llama.cpp, LocalAI, and llamafile through OpenAI-compatible APIs

⭐ Star this repo to show your support — it helps others discover liter-llm.

Quick Start

Language Packages

Python

pip install liter-llm

See Python README for full documentation.

Node.js

pnpm add @xberg-io/liter-llm

See Node.js README for full documentation.

Rust

cargo add liter-llm

See Rust crate for full documentation.

Go

go get github.com/xberg-io/liter-llm/packages/go/v2

See Go README for full documentation.

Java

Available on Maven Central as io.xberg.literllm:liter-llm. See Java README for the dependency snippet and current version.

Ruby

gem install liter_llm

See Ruby README for full documentation.

PHP

composer require xberg-io/liter-llm

See PHP README for full documentation.

C#

dotnet add package LiterLlm

See .NET README for full documentation.

Elixir

Add {:liter_llm, "~> 1.6"} to your mix.exs dependencies. See Elixir README for full documentation.

Dart / Flutter

dart pub add liter_llm

See Dart README for full documentation.

Swift

Add via Swift Package Manager. See Swift README for full documentation.

Kotlin (Android)

Available on Maven Central as io.xberg.literllm:liter-llm-android. See Kotlin README for the dependency snippet and current version.

Zig

See Zig README for installation and usage.

WebAssembly

pnpm add @xberg-io/liter-llm-wasm

See WebAssembly README for full documentation.

C/C++ (FFI)

Build from source as part of this workspace. See FFI crate for full documentation.

CLI, Proxy & MCP Server

The liter-llm CLI ships both the OpenAI-compatible proxy and the MCP tool server. Install it any of these ways:

brew install xberg-io/tap/liter-llm
cargo install liter-llm-cli                 # from crates.io
cargo binstall liter-llm-cli               # prebuilt binary from GitHub Releases
pnpm dlx @xberg-io/liter-llm-cli --help         # npm (self-installs the binary)
docker run -p 4000:4000 -e LITER_LLM_MASTER_KEY=sk-your-key ghcr.io/xberg-io/liter-llm

Windows users can install the same binary through Scoop:

scoop bucket add xberg https://github.com/xberg-io/scoop-bucket
scoop install liter-llm

Then run the proxy or the MCP server:

liter-llm api --config liter-llm-proxy.toml   # OpenAI-compatible proxy (22 endpoints)
liter-llm mcp --transport stdio               # MCP tool server (stdio)
liter-llm mcp --transport http --port 3001    # MCP tool server (Streamable HTTP)

See the MCP server guide and the proxy guide for transports, routing, virtual keys, and budgets. To use the MCP server inside a coding agent, install the liter-llm plugin (below) — it registers the server for your MCP client. The CLI release compatibility requirements below also apply to auto-installed binaries.

AI Coding Assistants

Install the liter-llm plugin from xberg-io/liter-llm. It ships the liter-llm agent skills (chat, streaming, tools, embeddings across 174 providers) — select your runtime below.

The bundle targets Claude Code, Codex, Cursor, Gemini CLI, Kimi, OpenCode, Factory Droid, Hermes, Pi, Agent Plugins and GitHub Copilot CLI. Read the plugin guide for runtime resources, CLI prerequisites and configuration. MCP-capable adapters expose the product's tools; Hermes uses a local stdio bridge and explicitly selected skills. Pi loads skills and prompt templates and requires the product CLI for executable operations.

Install only the public Agent Skills, without a plugin or MCP registration, using the skills CLI:

npx skills add xberg-io/liter-llm --list
npx skills add xberg-io/liter-llm

Choose the skills and target agents interactively. Installing instructions does not install the product CLI or configure provider credentials.

Published CLI 2.2.3 predates the local-stdio trust and deferred-provider-credential fixes. Until a CLI release includes them, use a source build for startup without an extra auth config:

cargo install --git https://github.com/xberg-io/liter-llm \
  --rev f14fb8862f9cc73e2c4ab38a2876efe77fab8bf4 --locked liter-llm-cli

Put the installed binary on the assistant's PATH. If a plugin has already cached an older binary, remove that plugin's bin/liter-llm (or bin/liter-llm.exe) before retrying so it selects the source build. The released 2.2.3 binary requires mcp.stdio_trust_local = true or a configured mcp.stdio_key_id; configured providers may also require credentials at startup. The source build defers missing provider credentials until a request uses that provider. HTTP authentication remains configured separately.

The source-built stdio MCP server trusts its local host by default and starts without a provider key. Set provider credentials such as OPENAI_API_KEY or ANTHROPIC_API_KEY before sending requests to that provider; missing credentials fail the request. HTTP MCP access retains its configured authentication. Use liter-llm api for the proxy and liter-llm mcp for MCP; chat and streaming are SDK, proxy or MCP operations rather than CLI subcommands.

Claude Code

/plugin marketplace add xberg-io/liter-llm
/plugin install liter-llm@liter-llm

Codex CLI

/plugins add https://github.com/xberg-io/liter-llm

Then search for liter-llm and select Install Plugin.

Cursor

Settings → Plugins → Add from URL → https://github.com/xberg-io/liter-llm, then select liter-llm.

Gemini CLI

From a checkout of this repository:

gemini extensions install ./plugin

The manifest is inside plugin/. See the Gemini extension reference for local installation and updates.

Factory Droid

droid plugin marketplace add https://github.com/xberg-io/liter-llm
droid plugin install liter-llm@liter-llm

GitHub Copilot CLI

copilot plugin marketplace add https://github.com/xberg-io/liter-llm
copilot plugin install liter-llm@liter-llm

Pi

Install from a local checkout now:

pi install ./plugin

After the next plugin release, install the same package used by OpenCode:

pi install npm:@xberg-io/opencode-liter-llm

Pi loads the bundled skills and prompt templates. Use /liter-llm-chat and /liter-llm-stream to start a task. Install the CLI separately as shown in the plugin README. This package does not register MCP servers, hooks, or executable extensions in Pi.

opencode

Add the package to opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["@xberg-io/opencode-liter-llm"]
}

Documentation

Full guides, the unified chat() API for every binding, multimodal I/O, the proxy/gateway, and the complete provider list live at docs.liter-llm.xberg.io.

Contributing

Contributions are welcome! See CONTRIBUTING.md for guidelines.

Join our Discord community for questions and discussion.

Part of Xberg.io

  • Xberg — document intelligence: text, tables, metadata from 101 formats with optional OCR.
  • Xberg Enterprise — managed extraction API with SDKs, dashboards, and observability.
  • crawlberg — web crawling and scraping with HTML→Markdown and headless-Chrome fallback.
  • html-to-markdown — fast, lossless HTML→Markdown engine.
  • liter-llm — universal LLM API client with native bindings for 14 languages and 174 providers.
  • tree-sitter-language-pack — tree-sitter grammars and code-intelligence primitives.
  • alef — the polyglot binding generator that produces every per-language binding across the 5 polyglot repos.

License

MIT — see LICENSE for details.

Runs on
GPU support unknown
What shows it
  • no dependency or feature matches a backend row
Native code
Optional
  • Binds native code: libmimalloc-sys (feature mimalloc), tikv-jemalloc-sys (feature jemalloc)
Python bindings
No Python binding crate found
License
MIT

Compare with similar projects

Order: strongest tier first, then most downloads, then name, with unmeasured values last. A library counts downloads over 30 days. An app counts binary downloads per release. An app with none counts its crate downloads over 30 days. ML Rust runs this catalogue, so its closest project always gets a row.

liter-llm beside the projects that share a topic with it
ProjectDownloadsDependentsStarsLatest releaseRuns on (GPU)Native codeLicense
liter-llm This page Listed

Universal LLM API client — 174 providers, streaming, tool calling. Rust-powered, type-safe, compiled.

13,151 downloads over 30 days 8 264 2.7.0 GPU support unknown Binds native code: libmimalloc-sys (feature mimalloc), tikv-jemalloc-sys (feature jemalloc) MIT

OpenAI API client library for Rust (unofficial)

46,400 downloads over 30 days 33 485 10.0.2 GPU support unknown No native code found MIT
aisdk Listed

An open-source Rust library for building AI-powered applications, inspired by the Vercel AI SDK. It provides a robust, type-safe, and easy-to-use interface for interacting with various Large Language Models (LLMs).

36,877 downloads over 30 days 4 263 0.6.1 GPU support unknown No native code found MIT

A type-safe OpenRouter Rust SDK

8,599 downloads over 30 days 3 98 0.24.0 GPU support unknown No native code found MIT

Rust client for Google Gemini API

6,041 downloads over 30 days 5 79 2.1.0 GPU support unknown No native code found MIT
mistralai-client-rs Listed Dormant

Mistral AI API client library for Rust (unofficial).

518 downloads over 30 days 4 48 0.14.0 GPU support unknown No native code found Apache-2.0
blazr App Listed

Inference server for LLMs, speech and embeddings: OpenAI-compatible routes with streaming, plus speech synthesis (TTS) and transcription (ASR). Serves Llama, Mistral, Qwen, Mamba2, MLA+MoE and hybrid models from SafeTensors, AWQ, GPTQ and GGUF.

8 binary downloads per release Not applicable 7 0.7.1 CUDA, WebGPU Binds native code: ring (feature distributed) Apache-2.0
Why ListedNo archive, New or Featured rule places it, so it is Listed.

What it lacks for Featured

  • It has 1 active dependents and 1 new dependents in 365 days. Featured needs 11 active dependents or 9 new dependents in 365 days. The repository route reads 264 stars, 27 forks and 13 contributors. It needs 4,539 stars, 434 forks and 79 contributors together.

What else the check found

  • The last activity is on 7 Nov 2026, 2 days ago. The rules expect an update within 365 days. Dormancy rule

Exact rules: Listed, Featured library. The check on applied thresholds version 9.

Every rule outcome, as the check records it
  • expected-interval: version 2.7.0 base 200, raised to the 365-day floor: E = 365 days
  • dormancy: last activity 2026-11-07, 2 days ago, E = 365: active
  • featured: not featured: active_users 1 < 11 and new_adopters 1 < 9 and repository route stars 264 (needs 4539), forks 27 (needs 434), contributors 13 (needs 79)
  • listed: listed: no archive, new or featured rule applies
Crates4 crates

Measurements and sources

Each signal row shows the raw value, its source and the fetch date. The Sources list gathers every distinct source on this page. Movement needs more history.

Sources6 sources
Adoption1 active dependents, 1 new dependents in 365 days1 not measured
Adoption measurements
SignalValueSourceFetchedCounts
Active dependents1crates.io database dumpYes
New dependents (365 days)1crates.io database dumpYes
Peak active dependents1crates.io database dumpYes
Active dependents as a share of the peak1crates.io database dumpYes
Binary downloads per releaseNot measuredYes
MaintenanceLatest human commit: 2 days ago3 not measured
Maintenance measurements
SignalValueSourceFetchedCounts
Latest human commit2026-11-07GitHub repositoryYes
Latest release2026-11-06crates.io database dumpYes
First release2026-03-27crates.io database dumpYes
Latest version2.7.0crates.io database dumpYes
Days the oldest outside issue waits for a reply0GitHub repositoryYes
Maintainer replies over 365 days29GitHub repositoryYes
Repository archivedfalseGitHub repositoryYes
Repository gonefalseGitHub repositoryYes
Release commit or manifest in the repotruecrates.io packageYes
Published docstruecrates.io database dumpYes
Latest release fails cargo checkNot measuredYes
Build check dateNot measuredYes
Build check toolchainNot measuredYes
SecurityUnpatched vulnerabilities: none
Security measurements
SignalValueSourceFetchedCounts
Unpatched vulnerabilities past the grace windownoneRustSec advisory databaseYes
RustSec unmaintained advisorynoneRustSec advisory databaseYes
Deprecation noticenonecrates.io database dumpYes
Deprecated requirementnonecrates.io database dumpYes
Distribution130 releases, 13,151 downloads over 30 days5 not measured
Distribution measurements
SignalValueSourceFetchedCounts
Releases130crates.io database dumpYes
Downloads over 30 days13151crates.io database dumpYes
Binary downloads over the last 3 releasesNot measuredYes
Homebrew installs on request over 365 daysNot measuredYes
Repology repository familiesNot measuredYes
Docker pull growth over 90 daysNot measuredYes
Docker pulls at the growth baselineNot measuredYes
Every version a prereleasefalsecrates.io database dumpYes
Every version 0.0.xfalsecrates.io database dumpYes
Every version yankedfalsecrates.io database dumpYes
Crate deleted from crates.iofalsecrates.io database dumpYes
Repository264 stars, 27 forks, 13 contributors, 2,187 commits. Stars alone never qualify a project.
Repository measurements
SignalValueSourceFetchedCounts
GitHub stars264GitHub repositoryYes — one part of the repository route
GitHub forks27GitHub repositoryYes — one part of the repository route
Contributors with a GitHub account13GitHub contributorsYes — one part of the repository route
Commits on the default branch2187GitHub repositoryNo
Repository's main crate left out of the entrynonecrates.io database dumpYes
Facts that never count
Facts that never count measurements
SignalValueSourceFetchedCounts
LicenseMITcrates.io database dumpNo
Runs on, from listed crates and their direct dependenciesGPU support unknowncrates.io database dumpNo
What shows each backendno dependency or feature matches a backend rowcrates.io database dumpNo
Native code, from listed crates and their dependenciesBinds native code: libmimalloc-sys (feature mimalloc), tikv-jemalloc-sys (feature jemalloc)crates.io database dumpNo
Python bindings, from direct dependencies of listed cratesNo Python binding crate foundcrates.io database dumpNo
Crates that depend on a listed crate directly8crates.io database dumpNo

Corrections and review history

Report a correction

No correction applies to this entry.

Judgments

A judgment enters only through an approved issue and a merged pull request.

No judgment applies to this entry.