PHPackages                             kreuzberg-dev/liter-llm - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. kreuzberg-dev/liter-llm

Active[API Development](/categories/api)

kreuzberg-dev/liter-llm
=======================

238017RustCI failing

Pushed 1w ago2 watchersCompare

[ Source](https://github.com/kreuzberg-dev/liter-llm)[ Packagist](https://packagist.org/packages/kreuzberg-dev/liter-llm)[ RSS](/packages/kreuzberg-dev-liter-llm/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)DependenciesVersionsUsed By (0)

   ![Xberg](https://camo.githubusercontent.com/634e91576caf8f36ad27ce2180030b6dcd54a71dc87f7be493855aebfc430d5b/68747470733a2f2f63646e2e6a7364656c6976722e6e65742f67682f78626572672d696f2f6173736574734076312f62616e6e65722f726561646d652d62616e6e65722d6c696768742e737667)

liter-llm
=========

[](#liter-llm)

 [ ![Built with alef](https://camo.githubusercontent.com/c9e1dfcbc5066304dc7bd3d619f0bea998c7cb09c2301107c1b867345d5c6d2a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6275696c74253230776974682d616c65662532302544372539302d303037656336) ](https://github.com/xberg-io/alef) [ ![Rust](https://camo.githubusercontent.com/5e0e1e81af4e148d2fe6e84ea6baa20203dffd1614c2b3dd0a385765f2f94627/68747470733a2f2f696d672e736869656c64732e696f2f6372617465732f762f6c697465722d6c6c6d3f6c6162656c3d5275737426636f6c6f723d303037656336) ](https://crates.io/crates/liter-llm) [ ![Python](https://camo.githubusercontent.com/be6d36408f87ce8c92a07f44e5abac12b8ef0450ff30d20b90d03faf6124c729/68747470733a2f2f696d672e736869656c64732e696f2f707970692f762f6c697465722d6c6c6d3f6c6162656c3d507974686f6e26636f6c6f723d303037656336) ](https://pypi.org/project/liter-llm/) [ ![Node.js](https://camo.githubusercontent.com/2b8624188222c416cc8ad2492433b5b7c845790dea4faeae3fd1191dcf0be551/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f762f4078626572672d696f2f6c697465722d6c6c6d3f6c6162656c3d4e6f64652e6a7326636f6c6f723d303037656336) ](https://www.npmjs.com/package/@xberg-io/liter-llm) [ ![WASM](https://camo.githubusercontent.com/b6c56c876bd6307697539f6667e757f91819c06be9ace9e27b7fac7764aed379/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f762f4078626572672d696f2f6c697465722d6c6c6d2d7761736d3f6c6162656c3d5741534d26636f6c6f723d303037656336) ](https://www.npmjs.com/package/@xberg-io/liter-llm-wasm) [ ![Java](https://camo.githubusercontent.com/09e89b96b04e26ca64a25f1e893d696af97c48bc0493f0a4f2d85f4fc8ce9f7b/68747470733a2f2f696d672e736869656c64732e696f2f6d6176656e2d63656e7472616c2f762f696f2e78626572672e6c697465726c6c6d2f6c697465722d6c6c6d3f6c6162656c3d4a61766126636f6c6f723d303037656336) ](https://central.sonatype.com/artifact/io.xberg.literllm/liter-llm) [ ![Go](https://camo.githubusercontent.com/b7fa8b83b20147fd88097a9df4d222595741ce5eaea7498b9f2ca9961987e9a4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f7461672f78626572672d696f2f6c697465722d6c6c6d3f6c6162656c3d476f26636f6c6f723d303037656336) ](https://github.com/xberg-io/liter-llm/tree/main/packages/go) [ ![C#](https://camo.githubusercontent.com/913d82218ab797d4b7d971fd9a312f7199f664cd87942d20efe3e4337b4eba58/68747470733a2f2f696d672e736869656c64732e696f2f6e756765742f762f4c697465724c6c6d3f6c6162656c3d4325323326636f6c6f723d303037656336) ](https://www.nuget.org/packages/LiterLlm) [ ![PHP](https://camo.githubusercontent.com/e4559ad9b17e8c43eba2aeec7c5c4dde0a3e31e40092dc0652305f50eb382b08/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f78626572672d696f2f6c697465722d6c6c6d3f6c6162656c3d50485026636f6c6f723d303037656336) ](https://packagist.org/packages/xberg-io/liter-llm) [ ![Ruby](https://camo.githubusercontent.com/3330365b40db2e36aa119aff0895d65d1528145a77278f9e9805dbcefe606a5d/68747470733a2f2f696d672e736869656c64732e696f2f67656d2f762f6c697465725f6c6c6d3f6c6162656c3d5275627926636f6c6f723d303037656336) ](https://rubygems.org/gems/liter_llm) [ ![Elixir](https://camo.githubusercontent.com/d1a8f034af793514d50387310a93f989a23a3b4f5500ac6b46141b62878fe970/68747470733a2f2f696d672e736869656c64732e696f2f686578706d2f762f6c697465725f6c6c6d3f6c6162656c3d456c6978697226636f6c6f723d303037656336) ](https://hex.pm/packages/liter_llm) [ ![Docker](https://camo.githubusercontent.com/32cec0d80520c2e9872e7c80e7f3d5d6b916c41998b25dddb1289399cbc8ba0c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446f636b65722d3030376563363f6c6f676f3d646f636b6572266c6f676f436f6c6f723d7768697465) ](https://github.com/xberg-io/liter-llm/pkgs/container/liter-llm) [ ![Homebrew](https://camo.githubusercontent.com/89adc3bced935477f7a304616be593e795f30dafef2d47ab950f5d1c4f0cd387/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f486f6d65627265772d3030376563363f6c6f676f3d686f6d6562726577266c6f676f436f6c6f723d7768697465) ](https://github.com/xberg-io/homebrew-tap/blob/main/Formula/liter-llm.rb) [ ![C FFI](https://camo.githubusercontent.com/41b9c58c3810775402965a3a7652da9832ea83391c1ff255081e5551900db8f2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f432d4646492d303037656336) ](https://github.com/xberg-io/liter-llm/tree/main/crates/liter-llm-ffi) [ ![License](https://camo.githubusercontent.com/0cd4d42d83d2124c29737dd1519425c87c4b465016ef0cee20cbcb8ef420c0e0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d303037656336) ](https://github.com/xberg-io/liter-llm/blob/main/LICENSE) [ ![Docs](https://camo.githubusercontent.com/69a64c0e16180d52e993ac387ebb1928b2c6b0b70065b61af114942f787a188a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446f63732d6c697465722d2d6c6c6d2d303037656336) ](https://docs.liter-llm.xberg.io)

 [ ![Join Discord](https://camo.githubusercontent.com/c3d59355bb5f7fc8224936ba897a06b87e5ba6f52bd08dfd2f7f78bf669c550d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446973636f72642d436861742d3030376563363f6c6f676f3d646973636f7264266c6f676f436f6c6f723d7768697465) ](https://discord.gg/xt9WY3GnKR)

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

What and Why?
-------------

[](#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](https://docs.liter-llm.xberg.io).

We credit [litellm](https://github.com/BerriAI/litellm) for proving the category; our provider registry was bootstrapped from theirs. See [ATTRIBUTIONS.md](ATTRIBUTIONS.md).

### Features

[](#features)

FeatureDescription**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 &amp; 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 &amp; 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](https://github.com/xberg-io/liter-llm/stargazers) to show your support — it helps others discover liter-llm.**

Quick Start
-----------

[](#quick-start)

### Language Packages

[](#language-packages)

**Python**```
pip install liter-llm
```

See [Python README](packages/python/README.md) for full documentation.

**Node.js**```
pnpm add @xberg-io/liter-llm
```

See [Node.js README](crates/liter-llm-node/README.md) for full documentation.

**Rust**```
cargo add liter-llm
```

See [Rust crate](crates/liter-llm) for full documentation.

**Go**```
go get github.com/xberg-io/liter-llm/packages/go
```

See [Go README](packages/go/README.md) for full documentation.

**Java**Available on Maven Central as `io.xberg.literllm:liter-llm`. See [Java README](packages/java/README.md) for the dependency snippet and current version.

**Ruby**```
gem install liter_llm
```

See [Ruby README](packages/ruby/README.md) for full documentation.

**PHP**```
composer require xberg-io/liter-llm
```

See [PHP README](packages/php/README.md) for full documentation.

**C#**```
dotnet add package LiterLlm
```

See [.NET README](packages/csharp/README.md) for full documentation.

**Elixir**Add `{:liter_llm, "~> 1.6"}` to your `mix.exs` dependencies. See [Elixir README](packages/elixir/README.md) for full documentation.

**Dart / Flutter**```
dart pub add liter_llm
```

See [Dart README](packages/dart/README.md) for full documentation.

**Swift**Add via Swift Package Manager. See [Swift README](packages/swift/README.md) for full documentation.

**Kotlin (Android)**Available on Maven Central as `io.xberg.literllm:liter-llm-android`. See [Kotlin README](packages/kotlin-android/README.md) for the dependency snippet and current version.

**Zig**See [Zig README](packages/zig/README.md) for installation and usage.

**WebAssembly**```
pnpm add @xberg-io/liter-llm-wasm
```

See [WebAssembly README](crates/liter-llm-wasm/README.md) for full documentation.

**C/C++ (FFI)**Build from source as part of this workspace. See [FFI crate](crates/liter-llm-ffi) for full documentation.

**CLI, Proxy &amp; 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
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
```

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](https://docs.liter-llm.xberg.io/server/mcp-server/) and the [proxy guide](https://docs.liter-llm.xberg.io/server/proxy-server/) 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

[](#ai-coding-assistants)

Install the liter-llm plugin from the [`xberg-io/plugins`](https://github.com/xberg-io/plugins) marketplace. 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/plugins
/plugin install liter-llm@xberg

```

**Codex CLI**```
/plugins add https://github.com/xberg-io/plugins

```

Then search for `liter-llm` and select **Install Plugin**.

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

**Gemini CLI**```
gemini extensions install https://github.com/xberg-io/plugins

```

**Factory Droid**```
droid plugin marketplace add https://github.com/xberg-io/plugins
droid plugin install liter-llm@xberg

```

**GitHub Copilot CLI**```
copilot plugin marketplace add https://github.com/xberg-io/plugins
copilot plugin install liter-llm@xberg

```

**opencode**Not yet published as an opencode package. Install via any harness above (self-hosted marketplace); opencode support is tracked in [`xberg-io/plugins`](https://github.com/xberg-io/plugins).

Documentation
-------------

[](#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](https://docs.liter-llm.xberg.io)**.

Contributing
------------

[](#contributing)

Contributions are welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.

Join our [Discord community](https://discord.gg/xt9WY3GnKR) for questions and discussion.

Part of Xberg.io
----------------

[](#part-of-xbergio)

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

License
-------

[](#license)

MIT — see [LICENSE](LICENSE) for details.

###  Health Score

27

—

LowBetter than 46% of packages

Maintenance64

Regular maintenance activity

Popularity19

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity8

Early-stage or recently created project

 Bus Factor1

Top contributor holds 83.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/30733348?v=4)[Na'aman Hirschfeld](/maintainers/Goldziher)[@Goldziher](https://github.com/Goldziher)

---

Top Contributors

[![Goldziher](https://avatars.githubusercontent.com/u/30733348?v=4)](https://github.com/Goldziher "Goldziher (1118 commits)")[![xberg-dev-publisher[bot]](https://avatars.githubusercontent.com/in/4004384?v=4)](https://github.com/xberg-dev-publisher[bot] "xberg-dev-publisher[bot] (68 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (66 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (51 commits)")[![kreuzberg-dev-publisher[bot]](https://avatars.githubusercontent.com/u/241328462?v=4)](https://github.com/kreuzberg-dev-publisher[bot] "kreuzberg-dev-publisher[bot] (31 commits)")[![v-tan](https://avatars.githubusercontent.com/u/22367932?v=4)](https://github.com/v-tan "v-tan (3 commits)")[![kh3rld](https://avatars.githubusercontent.com/u/171191586?v=4)](https://github.com/kh3rld "kh3rld (3 commits)")[![pratik-mahalle](https://avatars.githubusercontent.com/u/124587957?v=4)](https://github.com/pratik-mahalle "pratik-mahalle (2 commits)")[![oschick](https://avatars.githubusercontent.com/u/12664356?v=4)](https://github.com/oschick "oschick (1 commits)")

---

Tags

anthropicapi-clientllmmachine-learningopenaipolyglotpythonruststreamingtypescript

### Embed Badge

![Health badge](/badges/kreuzberg-dev-liter-llm/health.svg)

```
[![Health](https://phpackages.com/badges/kreuzberg-dev-liter-llm/health.svg)](https://phpackages.com/packages/kreuzberg-dev-liter-llm)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35916.5M7](/packages/exsyst-swagger)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172451.7k19](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

94467.0k6](/packages/botman-driver-telegram)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
