{"id":35271405,"url":"https://github.com/atopos31/llmio","last_synced_at":"2026-04-14T05:02:26.383Z","repository":{"id":308481759,"uuid":"1032927082","full_name":"atopos31/llmio","owner":"atopos31","description":"LLM API load-balancing gateway. LLM API 负载均衡网关.","archived":false,"fork":false,"pushed_at":"2026-04-02T12:39:37.000Z","size":2200,"stargazers_count":259,"open_issues_count":14,"forks_count":31,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-04-03T02:23:13.285Z","etag":null,"topics":["ai","ai-gateway","claude","claude-ai","claude-code","codex","deepseek","doubao","gemini","gemini-cli","go","golang","kimi","newapi","openai","openclaw","qwen","transformer"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/atopos31.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-08-06T03:43:36.000Z","updated_at":"2026-04-02T12:39:43.000Z","dependencies_parsed_at":"2026-02-06T11:03:25.034Z","dependency_job_id":null,"html_url":"https://github.com/atopos31/llmio","commit_stats":null,"previous_names":["atopos31/llmio"],"tags_count":116,"template":false,"template_full_name":null,"purl":"pkg:github/atopos31/llmio","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atopos31%2Fllmio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atopos31%2Fllmio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atopos31%2Fllmio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atopos31%2Fllmio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atopos31","download_url":"https://codeload.github.com/atopos31/llmio/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atopos31%2Fllmio/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31782740,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T02:24:21.117Z","status":"ssl_error","status_checked_at":"2026-04-14T02:24:20.627Z","response_time":153,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","ai-gateway","claude","claude-ai","claude-code","codex","deepseek","doubao","gemini","gemini-cli","go","golang","kimi","newapi","openai","openclaw","qwen","transformer"],"created_at":"2025-12-30T12:18:58.761Z","updated_at":"2026-04-14T05:02:26.328Z","avatar_url":"https://github.com/atopos31.png","language":"TypeScript","funding_links":[],"categories":["*Ops for AI"],"sub_categories":["LLMOps"],"readme":"# LLMIO\n\nEnglish | [中文](README_cn.md)\n\nLLMIO is a Go-based LLM load‑balancing gateway that provides a unified REST API, weighted scheduling, logging, 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.\n\n**QQ group: 1083599685**\n\n## Architecture\n\n![LLMIO Architecture](./docs/llmio.svg)\n\n## Features\n- **Unified API**: Compatible with OpenAI Chat Completions, OpenAI Responses, Gemini Native, and Anthropic Messages. Supports both streaming and non‑streaming passthrough.\n- **Weighted scheduling**: `balancers/` provides two strategies (random by weight / priority by weight). You can route based on tool calling, structured output, and multimodal capability.\n- **Admin Web UI**: React + TypeScript + Tailwind + Vite console for providers, models, associations, logs, and metrics.\n- **Rate limiting \u0026 failure handling**: Built‑in rate‑limit fallback and provider connectivity checks for fault isolation.\n- **Local persistence**: Pure Go SQLite (`db/llmio.db`) for config and request logs, ready to use out of the box.\n\n## Deployment\n\n### Docker Compose (Recommended)\n```yaml\nservices:\n  llmio:\n    image: atopos31/llmio:latest\n    ports:\n      - 7070:7070\n    volumes:\n      - ./db:/app/db\n    environment:\n      - GIN_MODE=release\n      - TOKEN=\u003cYOUR_TOKEN\u003e\n      - TZ=Asia/Shanghai\n```\n```bash\ndocker compose up -d\n```\n\n### Docker\n```bash\ndocker run -d \\\n  --name llmio \\\n  -p 7070:7070 \\\n  -v $(pwd)/db:/app/db \\\n  -e GIN_MODE=release \\\n  -e TOKEN=\u003cYOUR_TOKEN\u003e \\\n  -e TZ=Asia/Shanghai \\\n  atopos31/llmio:latest\n```\n\n### Local Run\nDownload the release package for your OS/arch from [releases](https://github.com/atopos31/llmio/releases) (version \u003e 0.5.13). Example for linux amd64:\n```bash\nwget https://github.com/atopos31/llmio/releases/download/v0.5.13/llmio_0.5.13_linux_amd64.tar.gz\n```\nExtract:\n```bash\ntar -xzf ./llmio_0.5.13_linux_amd64.tar.gz\n```\nStart:\n```bash\nGIN_MODE=release TOKEN=\u003cYOUR_TOKEN\u003e ./llmio\n```\nThe service will create `./db/llmio.db` in the current directory as the SQLite persistence file.\n\n## Environment Variables\n\n| Variable | Description | Default | Notes |\n|---|---|---|---|\n| `TOKEN` | Console login and API auth for `/openai` `/anthropic` `/gemini` `/v1` | None | Required for public access |\n| `GIN_MODE` | Gin runtime mode | `debug` | Use `release` in production |\n| `LLMIO_SERVER_PORT` | Server listen port | `7070` | Service listen port |\n| `TZ` | Timezone for logs and scheduling | Host default | Recommend explicit setting in containers (e.g. `Asia/Shanghai`) |\n| `DB_VACUUM` | Run SQLite VACUUM on startup | Disabled | Set to `true` to reclaim space |\n\n## Development\n\nClone:\n```bash\ngit clone https://github.com/atopos31/llmio.git\ncd llmio\n```\nBuild frontend (pnpm required):\n```bash\nmake webui\n```\nRun backend (Go \u003e= 1.26.1):\n```bash\nTOKEN=\u003cYOUR_TOKEN\u003e make run\n```\nWeb UI: `http://localhost:7070/`\n\n## API Endpoints\n\nLLMIO provides a multi‑provider REST API with the following endpoints:\n\n| Provider | Path | Method | Description | Auth |\n|---|---|---|---|---|\n| OpenAI | `/openai/v1/models` | GET | List available models | Bearer Token |\n| OpenAI | `/openai/v1/chat/completions` | POST | Create chat completion | Bearer Token |\n| OpenAI | `/openai/v1/responses` | POST | Create response | Bearer Token |\n| Anthropic | `/anthropic/v1/models` | GET | List available models | x-api-key |\n| Anthropic | `/anthropic/v1/messages` | POST | Create message | x-api-key |\n| Anthropic | `/anthropic/v1/messages/count_tokens` | POST | Count tokens | x-api-key |\n| Gemini | `/gemini/v1beta/models` | GET | List available models | x-goog-api-key |\n| Gemini | `/gemini/v1beta/models/{model}:generateContent` | POST | Generate content | x-goog-api-key |\n| Gemini | `/gemini/v1beta/models/{model}:streamGenerateContent` | POST | Stream content | x-goog-api-key |\n| Generic | `/v1/models` | GET | List models (compat) | Bearer Token |\n| Generic | `/v1/chat/completions` | POST | Create chat completion (compat) | Bearer Token |\n| Generic | `/v1/responses` | POST | Create response (compat) | Bearer Token |\n| Generic | `/v1/messages` | POST | Create message (compat) | x-api-key |\n| Generic | `/v1/messages/count_tokens` | POST | Count tokens (compat) | x-api-key |\n\n### Authentication\n\nLLMIO uses different auth headers depending on the endpoint:\n\n#### 1. OpenAI‑style endpoints (Bearer Token)\nApplies to `/openai/v1/*` and OpenAI‑compatible endpoints under `/v1/*`.\n```bash\ncurl -H \"Authorization: Bearer YOUR_TOKEN\" http://localhost:7070/openai/v1/models\n```\n\n#### 2. Anthropic‑style endpoints (x-api-key)\nApplies to `/anthropic/v1/*` and Anthropic‑compatible endpoints under `/v1/*`.\n```bash\ncurl -H \"x-api-key: YOUR_TOKEN\" http://localhost:7070/anthropic/v1/messages\n```\n\n#### 3. Gemini Native endpoints (x-goog-api-key)\nApplies to `/gemini/v1beta/*` endpoints.\n```bash\ncurl -H \"x-goog-api-key: YOUR_TOKEN\" http://localhost:7070/gemini/v1beta/models\n```\n\nFor claude code or codex, use these environment variables:\n```bash\nexport OPENAI_API_KEY=\u003cYOUR_TOKEN\u003e\nexport ANTHROPIC_API_KEY=\u003cYOUR_TOKEN\u003e\nexport GEMINI_API_KEY=\u003cYOUR_TOKEN\u003e\n```\n\u003e **Note**: `/v1/*` paths are kept for compatibility. Prefer the provider‑specific routes.\n\n## Project Structure\n\n```\n.\n├─ main.go              # HTTP server entry and routes\n├─ handler/             # REST handlers\n├─ service/             # Business logic and load‑balancing\n├─ middleware/          # Auth, rate limit, streaming middleware\n├─ providers/           # Provider adapters\n├─ balancers/           # Weight and scheduling strategies\n├─ models/              # GORM models and DB init\n├─ common/              # Shared helpers\n├─ webui/               # React + TypeScript admin UI\n└─ docs/                # Ops \u0026 usage docs\n```\n\n## Screenshots\n\n![Dashboard](./docs/home.jpeg)\n\n![Associations](./docs/with.jpeg)\n\n![Logs](./docs/log.jpeg)\n\n## License\n\nThis project is released under the MIT License.\n\n## Star History\n\n[![Stargazers over time](https://starchart.cc/atopos31/llmio.svg?variant=adaptive)](https://starchart.cc/atopos31/llmio)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatopos31%2Fllmio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatopos31%2Fllmio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatopos31%2Fllmio/lists"}