claudeers.

🔓 unclaimed — this page was auto-generated from GitHub. Are you the creator?

Claim this page →
// Developer Tools

llmio

Unified LLM gateway with weighted load balancing, observability & cost tracking. 统一的 LLM 网关,提供权重负载均衡、可观测性与费用追踪。

// Developer Tools[ cli ][ api ][ web ][ claude ]#claude#ai#ai-gateway#claude-ai#claude-code#codex#deepseek#doubao#devtoolsMIT$open-sourceupdated 15 days ago
Actively maintained
98/100
last commit about 1 month ago
last release about 1 month ago
releases 123
open issues 14
// install
git clone https://github.com/atopos31/llmio

LLMIO

English | 中文

LLMIO is a Go-based LLM load‑balancing gateway that provides a unified REST API, weighted scheduling, observability, and a modern admin UI for LLM clients (openclaw / claude code / codex / gemini cli / cherry studio / open webui). It helps you integrate OpenAI, Anthropic, Gemini, and other model capabilities in a single service.

QQ group: 1083599685

Architecture

LLMIO Architecture

Features

  • Unified API: Compatible with OpenAI Chat Completions, OpenAI Responses, Gemini Native, and Anthropic Messages. Supports both streaming and non‑streaming passthrough.
  • Weighted scheduling: balancers/ provides two strategies (random by weight / priority by weight). You can route based on tool calling, structured output, and multimodal capability.
  • Admin Web UI: React + TypeScript + Tailwind + Vite console for providers, models, associations, logs, and metrics.
  • Rate limiting & failure handling: Built‑in rate‑limit fallback and provider connectivity checks for fault isolation.
  • Local persistence: Pure Go SQLite (db/llmio.db) for config and request logs, ready to use out of the box.
  • Session tracking: Pass session_id in any request body (works with extra_body in OpenAI SDK) to tag logs with a session identifier. Filter and search by session_id in the admin UI or via GET /api/logs?session_id=.
  • Observability: Every request is recorded with TraceID, latency breakdown (proxy / first-chunk / completion time), TPS, token usage (input / cached / output), and optional full IO logging. Per-request cost is calculated from configurable per-million-token prices (CNY / USD) and shown in the log detail view alongside provider and model metadata.

Deployment

services:
  llmio:
    image: atopos31/llmio:latest
    ports:
      - 7070:7070
    volumes:
      - ./db:/app/db
    environment:
      - GIN_MODE=release
      - TOKEN=<YOUR_TOKEN>
      - TZ=Asia/Shanghai
docker compose up -d

Docker

docker run -d \
  --name llmio \
  -p 7070:7070 \
  -v $(pwd)/db:/app/db \
  -e GIN_MODE=release \
  -e TOKEN=<YOUR_TOKEN> \
  -e TZ=Asia/Shanghai \
  atopos31/llmio:latest

Local Run

Download the release package for your OS/arch from releases (version > 0.5.13). Example for linux amd64:

wget https://github.com/atopos31/llmio/releases/download/v0.5.13/llmio_0.5.13_linux_amd64.tar.gz

Extract:

tar -xzf ./llmio_0.5.13_linux_amd64.tar.gz

Start:

GIN_MODE=release TOKEN=<YOUR_TOKEN> ./llmio

The service will create ./db/llmio.db in the current directory as the SQLite persistence file.

Environment Variables

VariableDescriptionDefaultNotes
TOKENConsole login and API auth for /openai /anthropic /gemini /v1NoneRequired for public access
GIN_MODEGin runtime modedebugUse release in production
LLMIO_SERVER_PORTServer listen port7070Service listen port
TZTimezone for logs and schedulingHost defaultRecommend explicit setting in containers (e.g. Asia/Shanghai)
DB_VACUUMRun SQLite VACUUM on startupDisabledSet to true to reclaim space

Development

Clone:

git clone https://github.com/atopos31/llmio.git
cd llmio

Build frontend (pnpm required):

make webui

Run backend (Go >= 1.26.1):

TOKEN=<YOUR_TOKEN> make run

Web UI: http://localhost:7070/

API Endpoints

LLMIO provides a multi‑provider REST API with the following endpoints:

ProviderPathMethodDescriptionAuth
OpenAI/openai/v1/modelsGETList available modelsBearer Token
OpenAI/openai/v1/chat/completionsPOSTCreate chat completionBearer Token
OpenAI/openai/v1/responsesPOSTCreate responseBearer Token
Anthropic/anthropic/v1/modelsGETList available modelsx-api-key
Anthropic/anthropic/v1/messagesPOSTCreate messagex-api-key
Anthropic/anthropic/v1/messages/count_tokensPOSTCount tokensx-api-key
Gemini/gemini/v1beta/modelsGETList available modelsx-goog-api-key
Gemini/gemini/v1beta/models/{model}:generateContentPOSTGenerate contentx-goog-api-key
Gemini/gemini/v1beta/models/{model}:streamGenerateContentPOSTStream contentx-goog-api-key
Generic/v1/modelsGETList models (compat)Bearer Token
Generic/v1/chat/completionsPOSTCreate chat completion (compat)Bearer Token
Generic/v1/responsesPOSTCreate response (compat)Bearer Token
Generic/v1/messagesPOSTCreate message (compat)x-api-key
Generic/v1/messages/count_tokensPOSTCount tokens (compat)x-api-key

Authentication

LLMIO uses different auth headers depending on the endpoint:

1. OpenAI‑style endpoints (Bearer Token)

Applies to /openai/v1/* and OpenAI‑compatible endpoints under /v1/*.

curl -H "Authorization: Bearer YOUR_TOKEN" http://localhost:7070/openai/v1/models

2. Anthropic‑style endpoints (x-api-key)

Applies to /anthropic/v1/* and Anthropic‑compatible endpoints under /v1/*.

curl -H "x-api-key: YOUR_TOKEN" http://localhost:7070/anthropic/v1/messages

3. Gemini Native endpoints (x-goog-api-key)

Applies to /gemini/v1beta/* endpoints.

curl -H "x-goog-api-key: YOUR_TOKEN" http://localhost:7070/gemini/v1beta/models

For claude code or codex, use these environment variables:

export OPENAI_API_KEY=<YOUR_TOKEN>
export ANTHROPIC_API_KEY=<YOUR_TOKEN>
export GEMINI_API_KEY=<YOUR_TOKEN>

Note: /v1/* paths are kept for compatibility. Prefer the provider‑specific routes.

Project Structure

.
├─ main.go              # HTTP server entry and routes
├─ handler/             # REST handlers
├─ service/             # Business logic and load‑balancing
├─ middleware/          # Auth, rate limit, streaming middleware
├─ providers/           # Provider adapters
├─ balancers/           # Weight and scheduling strategies
├─ models/              # GORM models and DB init
├─ common/              # Shared helpers
├─ webui/               # React + TypeScript admin UI
└─ docs/                # Ops & usage docs

Screenshots

Dashboard
Dashboard — Overview of request volume, token usage and provider metrics
Associations
Model Associations — Configure multiple providers per model with weight, capability filters and per-token pricing
Logs
Request Logs — Multi-dimensional search and filtering by model, status, TraceID, Session ID and more
Chat IO
Session IO — Inspect full request / response, latency breakdown and per-token billing detail for any log entry

License

This project is released under the MIT License.

Star History

// compatibility

Platformscli, api, web
Operating systems
AI compatibilityclaude
LicenseMIT
Pricingopen-source
LanguageTypeScript

// faq

What is llmio?

Unified LLM gateway with weighted load balancing, observability & cost tracking. 统一的 LLM 网关,提供权重负载均衡、可观测性与费用追踪。. It is open-source on GitHub.

Is llmio free to use?

llmio is open-source under the MIT license, so it is free to use.

What category does llmio belong to?

llmio is listed under devtools in the Claudeers registry of Claude-compatible tools.

0 views
312 stars
unclaimed
updated 15 days ago

// embed badge

llmio on Claudeers
[![Claudeers](https://claudeers.com/api/badge/llmio.svg)](https://claudeers.com/llmio)

// retro hit counter

llmio hit counter
[![Hits](https://claudeers.com/api/counter/llmio.svg)](https://claudeers.com/llmio)

// reviews

// guestbook

0/500

// related in Developer Tools

🔓

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Curs…

// devtoolsaffaan-m/JavaScript225,699MIT[ claude ]
🔓

Use Garry Tan's exact Claude Code setup: 23 opinionated tools that serve as CEO, Designer, Eng Manager, Release Manager, Doc Engineer, and QA

// devtoolsgarrytan/TypeScript119,234MIT[ claude ]
🔓

AI coding assistant skill (Claude Code, Codex, OpenCode, Cursor, Gemini CLI, and more). Turn any folder of code, SQL schemas, R scripts, shell scripts, docs,…

// devtoolssafishamsi/Python80,484MIT[ claude ]
🔓

🙌 OpenHands: AI-Driven Development

// devtoolsOpenHands/Python79,324NOASSERTION[ claude ]
→ see how llmio connects across the ecosystem