xberg-io / liter-llm
Universal LLM API client with Rust-powered polyglot bindings.
Package info
Language:Rust
Type:php-ext
Ext name:ext-liter_llm
pkg:composer/xberg-io/liter-llm
Requires
- php: >=8.2
Requires (Dev)
- phpunit/phpunit: ^11.5 || ^12.0 || ^13.1
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- dev-main
- v2.0.2
- v2.0.1
- v2.0.0
- v1.19.2
- v1.19.1
- v1.19.0
- v1.18.4
- v1.18.3
- v1.18.2
- v1.18.1
- v1.18.0
- v1.17.3
- v1.17.2
- v1.17.1
- v1.16.0
- v1.15.0
- v1.14.0
- v1.13.0
- v1.12.2
- v1.12.1
- v1.12.0
- v1.11.5
- v1.11.4
- v1.11.3
- v1.11.2
- v1.11.1
- v1.11.0
- v1.10.1
- v1.10.0
- v1.9.3
- v1.9.2
- v1.9.1
- v1.9.0
- v1.9.0-rc.2
- v1.9.0-rc.1
- v1.8.2
- v1.8.1
- v1.8.0
- v1.7.6
- v1.7.5
- v1.7.4
- v1.7.3
- v1.7.2
- v1.7.1
- v1.7.0
- v1.6.4
- v1.6.3
- v1.6.2
- v1.6.1
- v1.6.0
- v1.5.1
- v1.5.0
- v1.4.1
- v1.4.0
- v1.4.0-rc.61
- v1.4.0-rc.60
- v1.4.0-rc.59
- v1.4.0-rc.58
- v1.4.0-rc.57
- v1.4.0-rc.56
- v1.4.0-rc.55
- v1.4.0-rc.54
- v1.4.0-rc.53
- v1.4.0-rc.52
- v1.4.0-rc.50
- v1.4.0-rc.49
- v1.4.0-rc.48
- v1.4.0-rc.47
- v1.4.0-rc.46
- v1.4.0-rc.45
- v1.4.0-rc.44
- v1.4.0-rc.43
- v1.4.0-rc.42
- v1.4.0-rc.41
- v1.4.0-rc.40
- v1.4.0-rc.39
- v1.4.0-rc.38
- v1.4.0-rc.37
- v1.4.0-rc.36
- v1.4.0-rc.35
- v1.4.0-rc.34
- v1.4.0-rc.33
- v1.4.0-rc.32
- v1.4.0-rc.31
- 1.4.0-rc.30
- 1.4.0-rc.29
- 1.4.0-rc.27
- 1.4.0-rc.26
- 1.4.0-rc.25
- 1.4.0-rc.24
- 1.4.0-rc.23
- 1.4.0-rc.22
- 1.4.0-rc.21
- 1.4.0-rc.20
- 1.4.0-rc.19
- 1.4.0-rc.18
- 1.4.0-rc.17
- 1.4.0-rc.16
- 1.4.0-rc.15
- 1.4.0-rc.14
- 1.4.0-rc.13
- 1.4.0-rc.12
- 1.4.0-rc.11
- 1.4.0-rc.10
- 1.4.0-rc.9
- 1.4.0-rc.8
- 1.4.0-rc.7
- 1.4.0-rc.6
- 1.4.0-rc.5
- 1.4.0-rc.4
- 1.4.0-rc.3
- 1.4.0-rc.2
- 1.4.0-rc.1
- 1.3.0
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.1
- 1.1.0
- 1.0.0
- 1.0.0-rc.9
- 1.0.0-rc.8
- 1.0.0-rc.7
- 1.0.0-rc.6
- 1.0.0-rc.5
- 1.0.0-rc.4
- 1.0.0-rc.3
- 1.0.0-rc.2
- dev-catalog-sync
- dev-release/swift/2.0.1
- dev-release/swift/2.0.0
- dev-codex/redact-transport-retry-urls
- dev-release/swift/1.19.2
- dev-release/swift/1.19.1
- dev-release/swift/1.19.0
- dev-release/swift/1.18.4
- dev-release/swift/1.18.3
- dev-release/swift/1.18.2
- dev-release/swift/1.18.1
- dev-release/swift/1.18.0
- dev-release/swift/1.17.3
This package is auto-updated.
Last update: 2026-09-14 11:32:24 UTC
README
liter-llm
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 165 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.
- Work with any provider without rewrites — 165 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
| Feature | Description |
|---|---|
| 165 providers | OpenAI, Anthropic, Google, AWS Bedrock, Groq, Mistral, Together, Fireworks, DeepSeek, Cohere, and 130+ more — compiled at build time |
| 14 native bindings | Rust, Python, Node.js, Go, Java, Kotlin, C#, Ruby, PHP, Elixir, Dart, Swift, Zig, WebAssembly — plus a shared C/FFI surface |
| First-class streaming | SSE and AWS EventStream binary protocol with zero-copy buffers |
| Proxy & MCP server | Drop-in OpenAI-compatible proxy (22 endpoints) and MCP tool server in a 35 MB Docker image |
| Tower middleware | Rate limiting, caching (40+ OpenDAL backends), cost tracking, budget enforcement, health checks, and fallback — all composable |
| Observability | OpenTelemetry with GenAI semantic conventions, cost-tracking spans, and HTTP-level tracing |
| Tool calling | Parallel tools, structured outputs, and JSON-schema validation |
| Search & OCR | Web search across 12 providers, document OCR across 4 |
| TOML configuration | liter-llm.toml auto-discovery, custom providers, cache backends, and middleware config |
| Local LLM support | Ollama, LM Studio, vLLM, llama.cpp, LocalAI, and llamafile via OpenAI-compatible APIs |
⭐ Star this repo to show your support — it helps others discover liter-llm.
Quick Start
Language Packages
Java
Available on Maven Central as io.xberg.literllm:liter-llm. See Java README for the dependency snippet and current version.
Elixir
Add {:liter_llm, "~> 1.6"} to your mix.exs dependencies. See Elixir 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.
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 npx @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 auto-registers the server, no manual config required.
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 165 providers) and works with every major coding agent — expand your harness below.
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
gemini extensions install https://github.com/xberg-io/liter-llm
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
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 165 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.