본문으로 건너뛰기
cccskills
무료GitHub에 공개

liter-llm

Universal LLM API client for 174 providers with native bindings for 14 languages. Use when writing code that calls LLM APIs via liter-llm in Python, TypeScript, Rust, Go, Java, C#, Ruby, PHP, Elixir, WASM, or C, when running the OpenAI-compatible proxy, or when calling LLMs through the MCP server. Covers chat, streaming, tool calling, embeddings, image generation, speech, transcription, moderation, web search, OCR, reranking, provider routing, middleware, and configuration.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

xberg-io/liter-llm스타 263(GitHub 263 + cccskills 0)
연동 도구AWSOpenAIGemini

실행 점수 미검증

설치 방법 보기

포함된 파일(2)

  • SKILL.md8.5 KB
  • index.md760 B

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

<!-- AI-RULEZ :: GENERATED FILE — DO NOT EDIT Content-Hash: blake3:3e0dcb446dcc37cd4709da048b254902f8d7f825b553308c5d25074419895562 Source-Hash: blake3:e9a3504d653cf1d11dce92e35c7dc252403c7cac2ca0cae3c0b8c8addd45159e Schema-Version: v1 -->

Liter-LLM Universal LLM Client

Liter-LLM is a universal LLM API client with a Rust core and native bindings for Python, TypeScript/Node.js, Go, Java, C#, Ruby, PHP, Elixir, WebAssembly, and C (FFI). One unified interface reaches 174 providers (OpenAI, Anthropic, Google Gemini, Groq, Mistral, Cohere, AWS Bedrock, Azure, and many more).

Capability map

  • Modalities — chat completions, streaming, tool/function calling, structured outputs, embeddings, image generation, audio (speech, transcription), moderation, web search, OCR, reranking, batch, and file operations.
  • Provider routing — provider/model prefix selects the backend (openai/gpt-4o, anthropic/claude-sonnet-4-20250514, gemini/gemini-2.0-flash). Set a full provider/model as model_hint to choose the client provider.
  • Middleware — response caching, rate limiting (RPM/TPM), cost tracking, budget enforcement (hard / soft), fallback chains, circuit-breaker cooldown, and background health checks.
  • Search providers (12) and OCR providers (4) — first-class search and ocr methods routed by the same prefix convention.
  • Proxy server — liter-llm api exposes an OpenAI-compatible gateway with 22 REST endpoints, virtual API keys, budgets, and SSE streaming.
  • MCP server — liter-llm mcp exposes 22 tools mirroring the proxy endpoints, for MCP-compatible clients (Claude Code, Claude Desktop).
  • 14 language bindings — same surface, language-native naming (snake_case for Python/Rust/Ruby/Go/Elixir/PHP, camelCase for TS/Node/WASM/C#/Java).

When to use the MCP server vs the SDK vs the proxy

Use the …When you want to …Entry point
MCP serverLet the agent call LLM APIs directly as tools, with no glue codeliter-llm mcp --transport stdio (this plugin auto-registers it)
SDK / bindingWrite application code that calls LLMs in a specific languagepip install liter-llm, cargo add liter-llm, etc.
ProxyGive many apps/teams a shared OpenAI-compatible endpoint with keys, budgets, and rate limitsliter-llm api --config liter-llm-proxy.toml

Rule of thumb: reach for the MCP server inside an agent session; the SDK when building software; the proxy when centralizing access for multiple consumers.

Installation

CLI (proxy + MCP server)

# Homebrew (macOS / Linux)
brew install xberg-io/tap/liter-llm

# or run it without a persistent install (the CLI proxy package self-installs the binary)
pnpm dlx @xberg-io/liter-llm-cli@2.2.3 --help

# or download a prebuilt binary from the latest GitHub release:
#   https://github.com/xberg-io/liter-llm/releases/latest

# or build from source
cargo install liter-llm-cli

# or Docker (35MB image)
docker pull ghcr.io/xberg-io/liter-llm

Language bindings

LanguageInstall
Pythonpip install liter-llm
Node.jspnpm add @xberg-io/liter-llm
Rustcargo add liter-llm
Gogo get github.com/xberg-io/liter-llm/packages/go/v2
Rubygem install liter_llm
PHPcomposer require xberg-io/liter-llm
C#dotnet add package XbergIo.LiterLlm
WASMpnpm add @xberg-io/liter-llm-wasm

Quick start (Python, async)

import asyncio
import os
from liter_llm import create_client
from liter_llm._internal_bindings import ChatCompletionRequest

async def main() -> None:
    client = create_client(api_key=os.environ["OPENAI_API_KEY"])
    request = ChatCompletionRequest.from_json(
        '{"model":"openai/gpt-4o","messages":[{"role":"user","content":"Hello!"}]}'
    )
    response = await client.chat(request)
    print(response.choices[0].message.content)

asyncio.run(main())

Provider routing

The prefix before / in the request's model selects the provider:

ChatCompletionRequest.from_json('{"model":"openai/gpt-4o","messages":[...]}')
ChatCompletionRequest.from_json('{"model":"anthropic/claude-sonnet-4-20250514","messages":[...]}')
ChatCompletionRequest.from_json('{"model":"gemini/gemini-2.0-flash","messages":[...]}')
ChatCompletionRequest.from_json('{"model":"groq/llama3-70b","messages":[...]}')

Client construction resolves credentials for its selected provider from environment variables: OPENAI_API_KEY, ANTHROPIC_API_KEY, GEMINI_API_KEY, GROQ_API_KEY, MISTRAL_API_KEY, COHERE_API_KEY, and AWS credentials for Bedrock. Create a separate client for each provider with matching model_hint and credentials. Request prefixes change routing but reuse the client API key; they do not select a new environment key per request.

Configuration

Pass basic options to create_client(...) (api_key, base_url, timeout_secs, connect_timeout_secs, max_retries, model_hint), or set the full surface in a liter-llm.toml (SDK) / liter-llm-proxy.toml (proxy) — both auto-discover from the cwd upward.

# liter-llm.toml
api_key = "${OPENAI_API_KEY}"
model_hint = "openai/gpt-4o"
timeout_secs = 120
max_retries = 5

[cache]
max_entries = 512
ttl_seconds = 600

[budget]
global_limit = 50.0
enforcement = "hard"

[rate_limit]
rpm = 60
tpm = 100000
OptionDefaultDescription
api_keyrequiredProvider key, wrapped in SecretString (never logged).
base_urlfrom registryOverride the provider base URL.
model_hintnoneFull provider/model used to select the client provider and credentials.
timeout_secs60Request timeout in seconds.
connect_timeout_secs10Connect timeout in seconds. A connection that does not open in time is retried up to max_retries times. Zero is an error on every target. wasm32 ignores any other value.
max_retries3Retries on 429/5xx with exponential backoff.
cachenonemax_entries, ttl_seconds.
budgetnoneglobal_limit, model_limits, enforcement.
rate_limitnonerpm, tpm.
cost_trackingfalsePer-request cost tracking.
tracingfalseOpenTelemetry spans.

Proxy server

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

22 OpenAI-compatible endpoints, model routing by prefix, virtual API keys, per-key RPM/TPM limits, cost tracking, budget enforcement, response caching, SSE streaming, and an OpenAPI 3.1 spec at /openapi.json.

MCP server

liter-llm mcp --transport stdio   # for Claude Code / Claude Desktop
liter-llm mcp --transport http --port 3001

This plugin auto-registers the stdio server via scripts/mcp-launch.sh. The 22 tools mirror the proxy endpoints: chat, embed, generate_image, speech, transcribe, moderate, rerank, search, ocr, list_models; file ops (create_file, list_files, retrieve_file, delete_file, file_content); batch ops (create_batch, list_batches, retrieve_batch, cancel_batch); and Responses API (create_response, retrieve_response, cancel_response).

Common pitfalls

  1. Provider routing — use "provider/model" to select a request backend. Bare model names fall back to the configured client provider (OpenAI by default).
  2. API keys are SecretString — never logged or serialized. Read from env vars; never hardcode.
  3. Python methods are async — await inside an async context.
  4. Naming conventions differ — camelCase for TS/Node/WASM/C#/Java, snake_case elsewhere.
  5. Streaming chunks may have null content — null-check chunk.choices[0].delta.content before use.
  6. Budget modes — hard rejects over-budget requests; soft logs and allows.

Additional resources

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

api

무료

Use liter-llm api reference documentation.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

xberg-io/liter-llm2632026년 10월 26일 업데이트

cli

무료

Use liter-llm cli reference documentation.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

xberg-io/liter-llm2632026년 10월 26일 업데이트

Use when sending chat completions through liter-llm and routing to a specific provider via the `provider/model` prefix. Covers the chat call shape, provider routing, model_hint, message roles, and error categories.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

xberg-io/liter-llm2632026년 10월 26일 업데이트

Use when generating embeddings, calling the 12 web-search providers, or running OCR over documents with the 4 OCR providers through liter-llm. Covers embed, search, and ocr methods plus reranking.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

xberg-io/liter-llm2632026년 10월 26일 업데이트

Use when running the `liter-llm api` OpenAI-compatible gateway — virtual keys, per-key rate limits, budgets, cost tracking, and model routing. Covers the TOML config and the 22 REST endpoints.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

xberg-io/liter-llm2632026년 10월 26일 업데이트

Use when streaming tokens incrementally from an LLM via liter-llm over SSE or async iterators. Covers chat_stream, delta handling, and null-content chunks.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

xberg-io/liter-llm2632026년 10월 26일 업데이트

xberg-io의 스킬 모두 보기

이 스킬의 문제 신고