Skip to content

BitRouter Setup Guide

Repo: bitrouter/bitrouter Stars: ⭐209 | License: Apache-2.0 | Language: Rust Install: cargo install bitrouter

Overview

BitRouter is a self-improving LLM router that optimizes agentic workflows with every run. It sits between your agent harness and LLM providers, routing each request to the optimal model based on cost, latency, and quality. Works with any harness (Hermes, OpenClaw, Claude Code, Codex) and any model.

Key capabilities: - Self-improving routing - learns from every request - Multi-model dispatch: DeepSeek, OpenAI, Anthropic, Ollama, and more - Agent observability: token tracking, cost analysis, latency metrics - Guardrails: rate limiting, content filtering, cost caps - MCP-ready for agent integration - OpenTelemetry-native for monitoring

Prerequisites

  • Rust toolchain (for building from source) OR Docker
  • At least one LLM provider API key (OpenAI, Anthropic, DeepSeek, etc.)

Installation

# Via cargo
cargo install bitrouter

# Via Docker
docker pull bitrouter/bitrouter:latest
docker run -d -p 8080:8080 \
  -e OPENAI_API_KEY=\$OPENAI_API_KEY \
  -e ANTHROPIC_API_KEY=\$ANTHROPIC_API_KEY \
  bitrouter/bitrouter

Configuration

# ~/.bitrouter/config.yaml
server:
  port: 8080
  host: "127.0.0.1"

providers:
  - name: deepseek
    base_url: https://api.deepseek.com/v1
    api_key_env: DEEPSEEK_API_KEY
    models:
      - deepseek-v4-pro
      - deepseek-chat
  - name: anthropic
    base_url: https://api.anthropic.com/v1
    api_key_env: ANTHROPIC_API_KEY
    models:
      - claude-sonnet-4-20250514
      - claude-opus-4-20250514

routing:
  strategy: cost_quality  # cost_only | latency_first | cost_quality | learning
  learning_window: 1000   # requests to analyze before self-improving
  cost_cap_daily: 50.00   # USD

Integration with Hermes

Point Hermes to use BitRouter as its LLM provider:

# ~/.hermes/config.yaml
model:
  default: bitrouter/auto        # Let BitRouter pick the model
  provider: bitrouter
  base_url: http://127.0.0.1:8080/v1

Verification

# Health check
curl http://127.0.0.1:8080/health

# Test routing
curl -X POST http://127.0.0.1:8080/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{"model":"auto","messages":[{"role":"user","content":"Hello"}]}'

# Check routing stats
bitrouter stats

Pitfalls

  • Self-improving mode needs ~1000 requests before routing noticeably improves
  • Docker image requires proper volume mounting for persistent learning data
  • When API keys expire, BitRouter auto-routes to available providers
  • Not a model aggregator - requires individual provider API keys

Integration with CorpusIQ

CorpusIQ is the connector layer that lets AI assistants read the systems a business already runs on - accounting, payments, CRM, email, files and analytics - and answer with the source named. It is read-only by design: it retrieves data and never writes to, or acts in, a connected system, which is what makes it safe to point at live accounts.

This page is part of the CorpusIQ directory, the reference we maintain for the MCP server and agent-skill ecosystem. Run alongside CorpusIQ, a third-party server like this one can be combined with a company's own business data in a single answer.

See what CorpusIQ connects

AI answers on your data. See where every number comes from.

Connect your tools and ask in ChatGPT, Claude, or Perplexity. Enterprise-grade answers in minutes. From $29.95/month.

Start free, no credit card
Contact Terms Privacy Pricing