Skip to content

Installation

Liter-llm ships prebuilt packages for every supported language plus a CLI and Docker image for the proxy + MCP server. Pick your stack, run one command, and start calling models.

Prebuilt binaries cover Linux (x86_64 / aarch64), macOS (Apple Silicon), and Windows. The Rust toolchain is only needed when building from source.

CLI / Docker

The CLI runs the proxy server and the MCP tool server. You don't need it if you only use a language binding.

brew trust xberg-io/tap
brew install xberg-io/tap/liter-llm
cargo install liter-llm-cli
docker pull ghcr.io/xberg-io/liter-llm:latest
docker run -p 4000:4000 \
  -e LITER_LLM_MASTER_KEY=sk-your-key \
  ghcr.io/xberg-io/liter-llm

Start the proxy:

liter-llm api --config liter-llm-proxy.toml

Or the MCP server:

liter-llm mcp --transport stdio

Proxy Server docs   MCP Server docs


Choose your language

Requires Python 3.10+.

pip install liter-llm

Or with uv:

uv add liter-llm

Requires Node.js 18+.

pnpm add @xberg-io/liter-llm

Or with npm / yarn:

npm install @xberg-io/liter-llm
yarn add @xberg-io/liter-llm

Requires Rust stable, edition 2024.

cargo add liter-llm

Requires Go 1.26+.

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

Requires Java 25+ (Panama FFM).

Maven:

<dependency>
    <groupId>io.xberg.literllm</groupId>
    <artifactId>liter-llm</artifactId>
    <version>1.9.0-rc.1</version>
</dependency>

Gradle:

implementation("io.xberg.literllm:liter-llm:1.9.0-rc.1")

The generated Kotlin target is Android. JVM Kotlin applications should use the Java binding from Kotlin.

implementation("io.xberg:liter-llm-android:1.9.0-rc.1")

Requires .NET 10+.

dotnet add package LiterLlm

Requires Ruby 3.2+.

gem install liter_llm

Or add to your Gemfile:

gem "liter_llm"

Requires PHP 8.2+.

composer require xberg-io/liter-llm

Requires Elixir 1.14+ / OTP 25+. Add to mix.exs:

defp deps do
  [
    {:liter_llm, "~> 1.7"}
  ]
end

Then run mix deps.get.

Requires Dart SDK 3.3+.

dart pub add liter_llm

Requires macOS 13+ and Swift 6.0+. Add the release artifact bundle to Package.swift:

.binaryTarget(
    name: "LiterLlm",
    url: "https://github.com/xberg-io/liter-llm/releases/download/v1.9.0-rc.1/LiterLlm-rs.artifactbundle.zip",
    checksum: "<CHECKSUM-FROM-RELEASE-NOTES>"
)

Requires Zig 0.16+.

zig fetch --save https://github.com/xberg-io/liter-llm/archive/refs/tags/v1.9.0-rc.1.tar.gz
pnpm add @xberg-io/liter-llm-wasm

Build the shared library and C header from source:

git clone https://github.com/xberg-io/liter-llm.git
cd liter-llm
cargo build --release -p liter-llm-ffi

Outputs land in target/release/. The C header is generated by cbindgen.


API key setup

Set the environment variable matching the provider you call:

export OPENAI_API_KEY="sk-..."
export ANTHROPIC_API_KEY="sk-ant-..."
export GOOGLE_API_KEY="..."
export GROQ_API_KEY="gsk_..."
export MISTRAL_API_KEY="..."
export AWS_ACCESS_KEY_ID="..."
export AWS_SECRET_ACCESS_KEY="..."

You only need one key

liter-llm resolves the provider from the model prefix (openai/gpt-4o, anthropic/claude-...) and picks the matching environment variable automatically.

Or pass the key at client construction:

from liter_llm import create_client

client = create_client(api_key="sk-...")
import { createClient } from "@xberg-io/liter-llm";

const client = createClient("sk-...");
use liter_llm::{ClientConfigBuilder, DefaultClient};

let config = ClientConfigBuilder::new("sk-...").build();
let client = DefaultClient::new(config, None)?;

Don't hard-code keys in source files

Use environment variables or a secret manager. The Rust core wraps keys in secrecy::SecretString so they never appear in Debug output or logs.


Verify it works

python -c "from liter_llm import create_client; print('ok')"
node -e "import('@xberg-io/liter-llm').then(m => { m.createClient('test'); console.log('ok') })"
cargo build
go build ./...

Building from source

If a prebuilt binary is not available for your platform, build from source with stable Rust (edition 2024):

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
git clone https://github.com/xberg-io/liter-llm.git
cd liter-llm
task build

Next steps

Edit this page on GitHub