← all repositories
bestruirui/octopus

A self-hosted switchboard for your scattered LLM keys

Octopus is a self-hosted gateway that unifies multiple LLM providers, API keys, and billing behind a single endpoint.

2.6k stars TypeScript LLMOps · EvalInference · Serving
octopus
Velocity · 7d
+4.3
★ / day
Trend
cooling
star history

What it does

Octopus sits between your code and upstream LLM services, giving you a single point of contact for OpenAI, Anthropic, Gemini, and others. You configure provider channels and API keys through a web panel, then expose them as unified model groups that clients call instead of hitting each provider directly. The gateway handles routing, protocol translation, and keeps a running tally of token spend.

The interesting bit

The group abstraction lets you pool several providers offering the same model under one name, then load-balance across channels using round-robin, weighted, or failover strategies. Per-channel, it can also pick the endpoint with the lowest latency, and it auto-syncs model lists and per-token prices from an upstream registry while letting you override prices manually.

Key highlights

  • Pools multiple providers and API keys into unified model groups, with per-channel latency-based endpoint selection.
  • Translates between OpenAI Chat, OpenAI Responses, and Anthropic API formats on the fly.
  • Auto-syncs model lists and pricing from models.dev, with user-defined prices taking priority.
  • Batches request statistics and cost tracking in memory before flushing to the database.
  • Ships as a single Go binary with an embedded web UI, supporting SQLite, MySQL, or PostgreSQL.

Caveats

  • In-memory statistics are lost on forced termination; the README explicitly warns against sending SIGKILL.
  • Default login credentials are admin/admin, and the project nags you to change them immediately.

Verdict

Ideal for individual developers or small teams who self-host and want to consolidate multiple LLM subscriptions behind one endpoint with basic cost accounting. Skip it if you need a managed, multi-tenant enterprise gateway or deep request-level observability.

Frequently asked

What is bestruirui/octopus?
Octopus is a self-hosted gateway that unifies multiple LLM providers, API keys, and billing behind a single endpoint.
Is octopus open source?
Yes — bestruirui/octopus is open source, released under the AGPL-3.0 license.
What language is octopus written in?
bestruirui/octopus is primarily written in TypeScript.
How popular is octopus?
bestruirui/octopus has 2.6k stars on GitHub and is currently cooling off.
Where can I find octopus?
bestruirui/octopus is on GitHub at https://github.com/bestruirui/octopus.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.