Sign inSign up

yachiiiiyo/xlyra

By yachiiiiyo

•Updated 1 day ago

Image
0

10K+

yachiiiiyo/xlyra repository overview

⁠xLyra

Multi-site AI gateway and control plane — unified routing across OpenAI, Anthropic, Codex, Grok, Gemini and more, with protocol conversion, OAuth orchestration, cost tracking, and real-time traffic observability.

⁠Quick Start

services:
  postgres:
    image: postgres:17-alpine
    container_name: xlyra-postgres
    restart: unless-stopped
    environment:
      POSTGRES_DB: xlyra
      POSTGRES_USER: xlyra
      POSTGRES_PASSWORD: postgres_password
    volumes:
      - ./postgres:/var/lib/postgresql/data

  xlyra:
    image: yachiiiiyo/xlyra:latest
    container_name: xlyra
    restart: unless-stopped
    depends_on:
      - postgres
    environment:
      DB_HOST: postgres
      DB_NAME: xlyra
      DB_USER: xlyra
      DB_PASSWORD: postgres_password
    volumes:
      - ./data:/data
    ports:
      - "5801:5801"
docker compose up -d

Access the console at http://localhost:5801⁠ and create the first admin account on initial visit.

Before public deployment, change the default PostgreSQL password and configure HTTPS and a reverse proxy. The encryption master key is generated automatically on first startup at ./data/conf/master.key.

⁠Gateway Endpoints

MethodPathDescription
GET/v1/modelsList downstream-visible models
POST/v1/chat/completionsOpenAI Chat Completions
POST/v1/responsesOpenAI Responses API
GET/v1/responsesOpenAI Responses API over WebSocket
POST/v1/messagesAnthropic Messages-style endpoint
POST/v1/images/generationsImage generation
POST/v1/images/editsImage editing (multipart)
POST/v1/embeddingsEmbeddings
POST/v1/audio/speechText-to-speech audio

⁠Supported Upstream Providers

Official API / Direct OpenAI Compatible · Anthropic · Grok · OpenCode Go · DeepSeek · MiniMax · Moonshot · Kimi Code · Xiaomi MiMo · Google Gemini · GLM

Relay / Aggregator xLyra (cascade) · NewAPI

OAuth Codex (ChatGPT) · Antigravity (Gemini) · Claude Code

⁠Key Features

  • Protocol conversion between Chat Completions, Responses, Anthropic Messages, Images, Embeddings, and TTS
  • Responses WebSocket support
  • Multi-site routing with health scoring, latency, price, and priority; half-open cooldown with automatic recovery
  • Per-model RPM limits with in-memory queuing and upstream429 wait-and-retry
  • Image generation bridge — gateway executes image_generation tool calls when the upstream cannot
  • Long-context tiered pricing for OpenAI models (auto-detects 272K+ input)
  • OAuth account management for Codex, Antigravity, Grok, and Claude Code with quota sync
  • Model name mapping — hard and soft (wildcard fallback) rules per downstream API key
  • Request logs with full detail, usage, estimated cost, and protocol conversion trace
  • Real-time traffic flow graph — live in-flight request topology
  • Model playground — multi-protocol interactive testing from the console
  • S3-compatible auto backup and restore
  • Per-key usage portal — public page accessible without authentication

⁠Environment Variables

VariableDescription
HTTP_PORTBackend listen port (default: 5801)
POSTGRES_DSNFull PostgreSQL DSN (overrides split DB settings)
DB_HOST / DB_PORT / DB_NAMEDatabase host, port, name
DB_USER / DB_PASSWORDDatabase credentials
APP_ENVdevelopment / staging / production

⁠Data Mounts

PathContent
./postgresPostgreSQL data
./dataBackend runtime data, config, and master.key

Tag summary

Content type

Image

Digest

sha256:5dce89a54…

Size

19.9 MB

Last updated

6 days ago

docker pull yachiiiiyo/xlyra