Skip to content
MuvonPublic

About

High-performance LLM proxy: one OpenAI-style API over 20+ providers, with multi-tenant keys, full request logging, and usage analytics. Built in Rust.

Topics

Resources

Stars

10 stars

Watchers

0 watching

Forks

Repository files navigation

OctoHub

One OpenAI-style API in front of all your LLM providers — with multi-tenant keys, full request logging, and usage analytics.

CI Release License

OctoHub is a high-performance LLM proxy written in Rust. Clients talk to one stable endpoint; OctoHub talks to whichever providers you configure — OpenAI, Anthropic, Google, DeepSeek, Ollama, OpenRouter, Modal-hosted vLLM, and more — and records every request and response in your own database.

            ┌──────────────────┐
 client  →  │  OctoHub proxy   │  →  provider A (openai)
            │  (Rust / hyper)  │  →  provider B (anthropic)
            │                  │  →  provider C (ollama, your GPU)
            └──────────────────┘  →  provider D (Modal-hosted vLLM)
                     │
                     └─→ your DB (SQLite / MySQL / PostgreSQL)

Why OctoHub?

Provider APIs don't give you per-customer usage tracking, audit logs, or a way to swap models without breaking clients. OctoHub is the missing front door: one interface, many backends, everything recorded.

Quick Start

# Build
cargo build --release

# Drop in a config
cat > octohub.toml <<'EOF'
[server]
host = "127.0.0.1"
port = 8080
api_key = "your-master-secret"
db_url = "sqlite://octohub.db"

[models]
"minimax-m2.7" = ["minimax:minimax-m2.7"]
EOF

# Run
./target/release/octohub

Create a client key and make your first call:

curl -sX POST http://127.0.0.1:8080/v1/admin/keys \
  -H "Authorization: Bearer your-master-secret" \
  -H "Content-Type: application/json" \
  -d '{"name": "my-app"}'
# → {"id":1,"key":"nYwT8kQ2v…", ...}

curl -sX POST http://127.0.0.1:8080/v1/completions \
  -H "Authorization: Bearer nYwT8kQ2v…" \
  -H "Content-Type: application/json" \
  -d '{"model":"minimax-m2.7","input":"Say hi"}'

Installation

Prebuilt binaries — every release ships static binaries for 5 targets:

OS Targets
Linux (musl, static) x86_64-unknown-linux-musl, aarch64-unknown-linux-musl
macOS (Apple Silicon) aarch64-apple-darwin
Windows x86_64-pc-windows-msvc, aarch64-pc-windows-msvc
# Example: Linux x86_64
curl -fsSL https://github.com/Muvon/octohub/releases/download/0.7.8/octohub-0.7.8-x86_64-unknown-linux-musl.tar.gz | tar xz
./octohub

From source

cargo build --release
./target/release/octohub

Features

  • One endpoint, many providers — OpenAI-style POST /v1/completions, /v1/chat/completions, /v1/embeddings, and /v1/evaluations routed to 20+ upstream providers
  • Sequential WebSocket completions — authenticated HTTP/1.1 GET /v1/completions upgrade, using the existing native request schema and one final buffered JSON envelope per request; wait for each reply before sending the next request. POST is unchanged; this is not token streaming (protocol and limits)
  • Buffered chat SSE — text and tool-call deltas with stream: true, plus opt-in usage via stream_options.include_usage; upstream completes before SSE delivery (docs)
  • Media generation — /v1/images/generations, /v1/videos, /v1/audio/speech and /v1/audio/transcriptions across ElevenLabs, fal, OpenRouter, Replicate and Runway, with durable resumable jobs and per-request cost (docs)
  • Completion chaining — pass previous_completion_id and prior turns are replayed automatically, including reasoning/thinking blocks (DeepSeek-compatible)
  • Model mapping & load balancing — map short names to provider:model lists; OctoHub picks randomly across them
  • Multi-tenant API keys — issue/revoke per-client keys with per-key model allow-lists and usage attribution
  • Full request/response logging — every call stored in SQLite (default), MySQL, or PostgreSQL for audit, replay, and analytics
  • Usage analytics — aggregated stats by key and time bucket (hour/day/week/month)
  • Per-provider concurrency limits — throttle any upstream independently
  • Observability — structured JSON/pretty logs, Prometheus metrics on a separate port, X-Request-Id correlation
  • Ops-friendly — GET /health, SIGHUP config hot-reload, octohub-admin.sh wrapper for daily admin tasks

Configuration

Create octohub.toml in your working directory:

[server]
host = "127.0.0.1"
port = 8080
db_url = "sqlite://octohub.db"
api_key = "your-master-secret"   # master key for the admin API

[models]
# short name -> list of "provider:model" (random pick = simple load balancing)
"my-model" = ["minimax:minimax-m2.7", "ollama:minimax-m2.7"]

[embedding_models]
"voyage-3.5" = ["voyage:voyage-3.5"]

[evaluation_models]
"jev" = ["typesafe:jev-latest", "cloudflare:typesafe/jev"]
Backend DSN example
SQLite (default) sqlite://octohub.db
MySQL mysql://user:pass@host:3306/octohub
PostgreSQL postgres://user:pass@host:5432/octohub

Schema is created automatically on first connection. OCTOHUB_DB_URL overrides the config file. If api_key is omitted, client endpoints run open and admin endpoints are disabled (a warning is printed at startup).

Owner BYOK for configured chat aliases is available through the credential admin API. Set OCTOHUB_CREDENTIALS_KEY to base64 of 32 random bytes before storing owner provider keys. Credentials are encrypted in all three database backends; requests with matching owner credentials use only those lanes and report usage.byok: true. See the startup rules.

Full reference: doc/03 — Configuration.

Authentication

Two independent layers:

Layer Endpoints Key source
Client /v1/completions, /v1/chat/completions, /v1/embeddings, /v1/evaluations, /v1/images/generations, /v1/videos, /v1/audio/*, /v1/media/* Keys from the api_keys DB table
Admin /v1/admin/* Master key from octohub.toml
Discovery GET /v1/models (OpenAI list with supported_parameters, sorted by ID) Client key for allowed models; master key for all configured LLM faces

Details: doc/04 — Authentication.

Documentation

  • User docs — installation, configuration, auth, deployment, troubleshooting
  • API reference — full endpoint reference
  • Providers — supported provider:model prefixes
  • Media — image, video, speech and transcription endpoints
  • Changelog

License

Apache-2.0 — see LICENSE.

Credits

Developed by Muvon Un Limited.

About

High-performance LLM proxy: one OpenAI-style API over 20+ providers, with multi-tenant keys, full request logging, and usage analytics. Built in Rust.

Topics

Resources

Stars

10 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages