{"id":51287080,"url":"https://github.com/xk1ko/aigloo","last_synced_at":"2026-07-01T08:00:41.446Z","repository":{"id":367966937,"uuid":"1279442888","full_name":"xk1ko/aigloo","owner":"xk1ko","description":"Self-hosted AI gateway. Route, translate and track requests across providers, with access keys, budgets, and a built-in dashboard.","archived":false,"fork":false,"pushed_at":"2026-06-30T05:47:52.000Z","size":3342,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-30T07:22:19.976Z","etag":null,"topics":["ai-gateway","anthropic","claude","claude-code","cline","codex","cursor","dashboard","deepseek","fallback","gemini","llm","llm-gateway","llm-proxy","openai","openai-proxy","opencode","qwen","token-saver"],"latest_commit_sha":null,"homepage":null,"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/xk1ko.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":null,"dco":null,"cla":null}},"created_at":"2026-06-24T17:35:01.000Z","updated_at":"2026-06-30T05:47:56.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/xk1ko/aigloo","commit_stats":null,"previous_names":["xk1ko/aigloo"],"tags_count":27,"template":false,"template_full_name":null,"purl":"pkg:github/xk1ko/aigloo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xk1ko%2Faigloo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xk1ko%2Faigloo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xk1ko%2Faigloo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xk1ko%2Faigloo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xk1ko","download_url":"https://codeload.github.com/xk1ko/aigloo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xk1ko%2Faigloo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34997947,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-01T02:00:05.325Z","response_time":130,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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-gateway","anthropic","claude","claude-code","cline","codex","cursor","dashboard","deepseek","fallback","gemini","llm","llm-gateway","llm-proxy","openai","openai-proxy","opencode","qwen","token-saver"],"created_at":"2026-06-30T07:00:14.216Z","updated_at":"2026-07-01T08:00:41.425Z","avatar_url":"https://github.com/xk1ko.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./assets/wordmark.svg\" width=\"420\" alt=\"aigloo\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eSelf-hosted AI gateway\u003c/strong\u003e\u003cbr\u003e\n  One endpoint · format translation · fallback routing · token saving · spend control · access keys\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.npmjs.com/package/aigloo\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/aigloo.svg\" alt=\"npm\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/aigloo\"\u003e\u003cimg src=\"https://img.shields.io/npm/dm/aigloo.svg\" alt=\"npm downloads\"\u003e\u003c/a\u003e\n  \u003ca href=\"./LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" alt=\"MIT\"\u003e\u003c/a\u003e\n  \u003cimg src=\"https://img.shields.io/badge/node-%3E%3D22-brightgreen.svg\" alt=\"Node ≥22\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#features\"\u003eFeatures\u003c/a\u003e · \u003ca href=\"#getting-started\"\u003eQuick Start\u003c/a\u003e · \u003ca href=\"#token-savers\"\u003eToken Savers\u003c/a\u003e · \u003ca href=\"#configuration\"\u003eConfig\u003c/a\u003e · \u003ca href=\"#supported-cli-tools\"\u003eCLI Tools\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n## Why aigloo?\n\nEvery AI app speaks a different API format. Every provider has different keys, models, and rate limits. You juggle configs, hit quota walls mid-session, and lose track of spend.\n\n**aigloo fixes this.** One local endpoint, one key. Point any app at it — Claude Code, opencode, Cursor, Codex, or anything that supports a custom base URL. It translates formats, routes across providers with automatic fallback, compresses token-heavy context, and tracks every cent.\n\n```bash\nnpm install -g aigloo \u0026\u0026 aigloo\n```\n\nFirst run bootstraps everything. Subsequent runs start instantly.\n\n---\n\n## How it works\n\n```\n  Your tools              aigloo                      Providers\n  ──────────        ────────────────────         ──────────────\n  Claude Code  ──┐                           ┌──► Anthropic\n  opencode     ──┤  format translation       ├──► OpenAI\n  Cursor       ──┼─► routing \u0026 fallback ─────┼──► OpenRouter\n  Codex        ──┤  token compression        ├──► Gemini\n  any app*     ──┘  spend tracking            └──► Ollama / custom\n                     ▲\n                     │\n                one endpoint\n                one API key\n\n  * any app that supports a custom base URL + API key\n```\n\n1. **Add providers** — paste your API keys, pick models. Use `provider/model` directly (key round-robin) or define combo aliases for multi-provider fallback chains\n2. **Point your tools** at `http://localhost:18080` with a gateway key\n3. **Track everything** — per-request cost, token usage, budgets, alerts\n\n---\n\n## Features\n\n- **Format translation** — OpenAI ↔ Anthropic on the fly, streaming included\n- **Routing \u0026 fallback** — use `provider/model` directly (key round-robin) or define combo aliases for multi-provider fallback chains; auto-rotates keys on 429/5xx/timeout\n- **Token savers** — RTK compresses tool results, caveman trims prose, ponytail nudges minimal code, headroom compresses context\n- **Access keys** — share gateway keys with model allowlist, rate limit, spend cap, and expiry\n- **Budgets** — rolling spend caps (global/provider/model/key) with live countdown and per-token-type cost tracking\n- **Alert notifications** — webhook, Telegram, or Discord alerts when budgets hit their threshold or run out. Deduped per budget window\n- **Dashboard** — glassmorphic aigloo design: providers, combos, usage, budgets, CLI tools, live console, settings — all drag-to-reorder\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./assets/screenshot-endpoint.png\" width=\"860\" alt=\"Endpoint page\"\u003e\n  \u003cbr\u003e\u003csub\u003eEndpoint page — token saver toggles \u0026 endpoint config\u003c/sub\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./assets/screenshot-accesskey.png\" width=\"860\" alt=\"Access Keys page\"\u003e\n  \u003cbr\u003e\u003csub\u003eAccess Keys — model allowlist, rate limit, spend cap per key\u003c/sub\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./assets/screenshot-budgets.png\" width=\"860\" alt=\"Budgets page\"\u003e\n  \u003cbr\u003e\u003csub\u003eBudgets — rolling spend caps with live countdown\u003c/sub\u003e\n\u003c/p\u003e\n\n---\n\n## Getting started\n\n### Quick start\n\n```bash\nnpm install -g aigloo\naigloo\n```\n\nThe CLI seeds `config.yaml`, builds the dashboard, opens your browser. One URL serves everything — dashboard, API, and admin: `http://localhost:18080`.\n\nA terminal menu offers: **Web UI** / **Terminal** (logs) / **Hide to Tray** (macOS · Linux · Windows) / **Exit**.\nFlags: `-p/--port`, `-n/--no-browser`, `-y/--yes`, `-t/--tray`.\n\n### From source\n\n```bash\ngit clone https://github.com/xk1ko/aigloo.git\ncd aigloo \u0026\u0026 npm install\ncp config.example.yaml config.yaml   # add providers + a server key\nnpm install --prefix dashboard\n./run.sh                              # Ctrl-C stops both\n```\n\n### Connect your tools\n\n```bash\n# Claude Code (Anthropic format)\nexport ANTHROPIC_BASE_URL=http://localhost:18080\nexport ANTHROPIC_API_KEY=my-key\n\n# opencode / Cursor / Cline / Codex (OpenAI format)\nexport OPENAI_BASE_URL=http://localhost:18080/v1\nexport OPENAI_API_KEY=my-key\n```\n\nThe dashboard's **CLI Tools** page detects installed tools and writes configs for you.\n\n**Model resolution** (in order): combo alias → `provider/model`.\n\nAny app that supports a custom base URL + API key can use aigloo — just set the model to `provider/model`.\n\n---\n\n## Supported CLI tools\n\nClaude Code · opencode · Cursor · Codex · Cline · Continue · Roo · Aider · Gemini CLI · Qwen Code · Kilo Code · Crush · Droid · Copilot\n\nAny app that supports a custom base URL + API key works — just set the model to `provider/model`.\n\n---\n\n## Configuration\n\n**Everything is configurable from the dashboard** — providers, combos, budgets, token savers, access keys, and settings. No need to edit files manually.\n\nUnder the hood, `config.yaml` is the source of truth and **hot-reloads** — any change made in the dashboard writes to this file instantly. You can also edit it by hand if you prefer; changes apply without restart.\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003econfig.yaml reference (click to expand)\u003c/strong\u003e\u003c/summary\u003e\n\n```yaml\nserver:\n  host: 0.0.0.0\n  port: 18080\n  api_keys: [my-key]        # empty = auth OFF (localhost only)\n\nendpoint:\n  rtk: true                 # compress tool_result blocks\n  caveman: full             # off | lite | full | ultra\n  ponytail: lite            # off | lite | full | ultra\n  headroom: off             # off | on — requires external headroom proxy\n\nproviders:\n  - id: anthropic\n    format: anthropic\n    base_url: https://api.anthropic.com/v1\n    api_keys: [sk-ant-xxx]\n  - id: opencode-free\n    format: openai\n    base_url: https://opencode.ai/zen/v1\n    free: true\n    # auto_models: false    # fetch provider's /v1/models catalog (manual)\n\nmodels:\n  - alias: claude-sonnet-4-6\n    target: [anthropic, opencode-free]   # fallback order\n    model: [claude-sonnet-4-6, claude-sonnet-4-5]\n    price_in: 3             # USD per 1M tokens\n    price_out: 15\n\nbudgets:\n  - scope: { type: global }\n    unit: usd\n    limit: 50\n    window: 30day\n```\n\n\u003c/details\u003e\n\nA **combo** is a `models` entry — an alias routed to a provider chain. Strategies: `fallback` (default, sequential) or `round-robin` (spread load).\n\n---\n\n## Token savers\n\n| Saver | What it does | Source | Install |\n|-------|-------------|--------|---------|\n| **RTK** | Compresses bulky `tool_result` blocks (git/grep/ls) | [rtk-ai/rtk](https://github.com/rtk-ai/rtk) | built-in |\n| **Caveman** | Terse system prompt — cuts output prose | [JuliusBrussee/caveman](https://github.com/JuliusBrussee/caveman) | built-in |\n| **Ponytail** | Nudges minimal code (YAGNI, deletion) | [DietrichGebert/ponytail](https://github.com/DietrichGebert/ponytail) | built-in |\n| **Headroom** | Pipes context through `/v1/compress` | [chopratejas/headroom](https://github.com/chopratejas/headroom) | **external** |\n\nHeadroom is the only external dependency — install from [chopratejas/headroom](https://github.com/chopratejas/headroom) (Python ≥ 3.10), run `headroom proxy`. Without it the toggle stays off; everything else works.\n\n---\n\n## Environment variables\n\n| Variable | Purpose |\n|----------|---------|\n| `AIGLOO_CONFIG` | Config file path |\n| `AIGLOO_DATA_DIR` | Usage DB directory |\n| `AIGLOO_ADMIN_PASSWORD` | Admin password — seeds on first boot, then stored as scrypt hash in `auth.json`. Default `123456` |\n| `AIGLOO_PORT` | Listen port (default 18080) |\n| `SESSION_SECRET` | Dashboard session cookie signing key. Auto-generated and persisted if unset |\n\nAdmin password and provider keys never reach the browser — the dashboard proxies `/admin/*` server-side.\n\n---\n\n## Data location\n\n| OS | Path |\n|----|------|\n| macOS / Linux | `~/.aigloo/` |\n| Windows | `%APPDATA%\\aigloo\\` |\n\nContains `config.yaml` and `usage.sqlite`. Delete the folder to reset everything.\n\n---\n\n## Development\n\n```bash\nnpm run typecheck       # tsc, no emit\nnpm test                # vitest (unit + synthetic E2E)\nnpm run build           # compile to dist/\n```\n\n---\n\n## ⭐ Star this repo\n\nIf aigloo helps you, consider giving it a star — it helps others discover it.\n\n---\n\n## Acknowledgements\n\nInspired by [9router](https://github.com/decolua/9router) — its feature set and dashboard shaped much of this project's direction.\n\n## License\n\n[MIT](./LICENSE) © xk1ko\n\n## Contributing\n\nIssues and ideas welcome: \u003chttps://github.com/xk1ko/aigloo/issues\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxk1ko%2Faigloo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxk1ko%2Faigloo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxk1ko%2Faigloo/lists"}