Skip to content

Commit 71d1420

Browse files
committed
feat: OmniRoute v1.0.0 — Intelligent AI Gateway & Universal LLM Proxy
OmniRoute is an intelligent API gateway that unifies 20+ AI providers behind a single OpenAI-compatible endpoint. Features include intelligent routing with 6 strategies, multi-format translation (OpenAI/Claude/Gemini/Responses API), circuit breakers, semantic caching, combo fallback chains, real-time health monitoring, and a full dashboard with provider management, analytics, and CLI tool integration. Key highlights: - 20+ providers (Claude Code, Codex, Gemini CLI, GitHub Copilot, iFlow, Qwen, Kiro, etc.) - 6 routing strategies (Fill First, Round Robin, P2C, Random, Least Used, Cost Optimized) - Export/Import database backup with full archive support - Translator Playground with 4 modes (Playground, Chat Tester, Test Bench, Live Monitor) - 100% TypeScript across src/ and open-sse/ - Docker support with multi-stage builds - Comprehensive documentation and 9 dashboard screenshots
0 parents  commit 71d1420

File tree

634 files changed

+117321
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

634 files changed

+117321
-0
lines changed

.agent/workflows/git-workflow.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
description: Git workflow — NEVER commit directly to main. Always use feature branches.
3+
---
4+
5+
# Git Workflow
6+
7+
## ⚠️ CRITICAL RULE: NEVER commit directly to `main`
8+
9+
## Steps
10+
11+
1. **Before starting any work**, create a feature branch from `main`:
12+
13+
```bash
14+
git checkout main && git pull origin main
15+
git checkout -b feature/<feature-name>
16+
```
17+
18+
2. **During development**, commit to the feature branch:
19+
20+
```bash
21+
git add -A && git commit -m "<type>(<scope>): <description>"
22+
```
23+
24+
3. **Before pushing**, verify the build passes:
25+
26+
```bash
27+
npm run build
28+
```
29+
30+
4. **When the feature is complete and verified**, push the branch and STOP:
31+
32+
```bash
33+
git push origin feature/<feature-name>
34+
```
35+
36+
5. **DO NOT** create a PR, merge, or push to `main`. Let the user handle that.
37+
38+
## Branch naming convention
39+
40+
- `feature/<name>` — new features
41+
- `fix/<name>` — bugfixes
42+
- `refactor/<name>` — refactoring
43+
- `docker/<name>` — Docker / infrastructure changes
44+
- `style/<name>` — UI / CSS changes
45+
46+
## Commit types
47+
48+
- `feat` — new feature
49+
- `fix` — bugfix
50+
- `refactor` — code refactoring
51+
- `style` — UI / CSS changes
52+
- `docker` — Docker / infrastructure
53+
- `docs` — documentation
54+
- `chore` — maintenance

.dockerignore

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# VCS
2+
.git
3+
**/.git
4+
5+
# Editor
6+
.vscode
7+
**/.vscode
8+
9+
# Dependencies and build output
10+
node_modules
11+
.next
12+
out
13+
build
14+
dist
15+
coverage
16+
17+
# Runtime data and logs
18+
data
19+
logs
20+
21+
# Local env files (inject at runtime via --env-file or -e)
22+
.env
23+
.env.local
24+
.env.development.local
25+
.env.test.local
26+
.env.production.local
27+
28+
# Debug logs
29+
npm-debug.log*
30+
yarn-debug.log*
31+
yarn-error.log*
32+
.pnpm-debug.log*

.env.example

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
# OmniRoute environment contract
2+
# This file reflects actual runtime usage in the current codebase.
3+
4+
# ═══════════════════════════════════════════════════
5+
# REQUIRED SECRETS — Generate strong values!
6+
# ═══════════════════════════════════════════════════
7+
# Generate with: openssl rand -base64 48
8+
JWT_SECRET=
9+
# Generate with: openssl rand -hex 32
10+
API_KEY_SECRET=
11+
12+
# Initial admin password — CHANGE THIS before first use!
13+
INITIAL_PASSWORD=CHANGEME
14+
DATA_DIR=/var/lib/omniroute
15+
16+
# Storage (SQLite)
17+
STORAGE_DRIVER=sqlite
18+
# Generate with: openssl rand -hex 32
19+
STORAGE_ENCRYPTION_KEY=
20+
STORAGE_ENCRYPTION_KEY_VERSION=v1
21+
LOG_RETENTION_DAYS=90
22+
SQLITE_MAX_SIZE_MB=2048
23+
SQLITE_CLEAN_LEGACY_FILES=true
24+
25+
# Recommended runtime variables
26+
PORT=20128
27+
NODE_ENV=production
28+
INSTANCE_NAME=omniroute
29+
30+
# Recommended security and ops variables
31+
MACHINE_ID_SALT=endpoint-proxy-salt
32+
ENABLE_REQUEST_LOGS=false
33+
AUTH_COOKIE_SECURE=false
34+
REQUIRE_API_KEY=false
35+
36+
# Input Sanitizer (FASE-01 — prompt injection & PII protection)
37+
# INPUT_SANITIZER_ENABLED=true
38+
# INPUT_SANITIZER_MODE=warn # warn | block | redact
39+
# PII_REDACTION_ENABLED=false
40+
41+
# Cloud sync variables
42+
# Must point to this running instance so internal sync jobs can call /api/sync/cloud.
43+
# Server-side preferred variables:
44+
BASE_URL=http://localhost:20128
45+
CLOUD_URL=
46+
# Backward-compatible/public variables:
47+
NEXT_PUBLIC_BASE_URL=http://localhost:20128
48+
NEXT_PUBLIC_CLOUD_URL=
49+
50+
# Optional outbound proxy variables for upstream provider calls
51+
# Lowercase variants are also supported: http_proxy, https_proxy, all_proxy, no_proxy
52+
# SOCKS5 proxy support
53+
ENABLE_SOCKS5_PROXY=true
54+
NEXT_PUBLIC_ENABLE_SOCKS5_PROXY=true
55+
# HTTP_PROXY=http://127.0.0.1:7890
56+
# HTTPS_PROXY=http://127.0.0.1:7890
57+
# ALL_PROXY=socks5://127.0.0.1:7890
58+
# NO_PROXY=localhost,127.0.0.1
59+
60+
# TLS fingerprint spoofing (opt-in) — mimics Chrome 124 TLS handshake via wreq-js
61+
# Reduces risk of JA3/JA4 fingerprint-based blocking by providers (e.g., Google)
62+
# Requires wreq-js to be installed (included in dependencies)
63+
# ENABLE_TLS_FINGERPRINT=true
64+
65+
# Optional CLI runtime overrides (Docker/host integration)
66+
# CLI_MODE=auto
67+
# CLI_EXTRA_PATHS=/host-cli/bin
68+
# CLI_CONFIG_HOME=/root
69+
# CLI_ALLOW_CONFIG_WRITES=true
70+
# CLI_CLAUDE_BIN=claude
71+
# CLI_CODEX_BIN=codex
72+
# CLI_DROID_BIN=droid
73+
# CLI_OPENCLAW_BIN=openclaw
74+
# CLI_CURSOR_BIN=agent
75+
# CLI_CLINE_BIN=cline
76+
# CLI_ROO_BIN=roo
77+
# CLI_CONTINUE_BIN=cn
78+
79+
# Provider OAuth Credentials (optional — override hardcoded defaults)
80+
# These can also be set via data/provider-credentials.json
81+
# CLAUDE_OAUTH_CLIENT_ID=
82+
# GEMINI_OAUTH_CLIENT_ID=
83+
# GEMINI_OAUTH_CLIENT_SECRET=
84+
# GEMINI_CLI_OAUTH_CLIENT_ID=
85+
# GEMINI_CLI_OAUTH_CLIENT_SECRET=
86+
# CODEX_OAUTH_CLIENT_ID=
87+
# CODEX_OAUTH_CLIENT_SECRET=
88+
# QWEN_OAUTH_CLIENT_ID=
89+
# IFLOW_OAUTH_CLIENT_ID=
90+
# IFLOW_OAUTH_CLIENT_SECRET=
91+
# ANTIGRAVITY_OAUTH_CLIENT_ID=
92+
# ANTIGRAVITY_OAUTH_CLIENT_SECRET=
93+
94+
# API Key Providers (Phase 1 + Phase 4)
95+
# Add via Dashboard → Providers → Add API Key, or set here
96+
# DEEPSEEK_API_KEY=
97+
# GROQ_API_KEY=
98+
# XAI_API_KEY=
99+
# MISTRAL_API_KEY=
100+
# PERPLEXITY_API_KEY=
101+
# TOGETHER_API_KEY=
102+
# FIREWORKS_API_KEY=
103+
# CEREBRAS_API_KEY=
104+
# COHERE_API_KEY=
105+
# NVIDIA_API_KEY=
106+
107+
# Embedding Providers (optional — used by /v1/embeddings)
108+
# NEBIUS_API_KEY=
109+
# Provider keys above (openai, mistral, together, fireworks, nvidia) also work for embeddings
110+
111+
# Timeout settings
112+
# FETCH_TIMEOUT_MS=120000
113+
# STREAM_IDLE_TIMEOUT_MS=60000
114+
115+
# CORS configuration (default: * allows all origins)
116+
# CORS_ORIGINS=*
117+
118+
# Logging
119+
# LOG_LEVEL=info
120+
# LOG_FORMAT=text

.github/dependabot.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "npm"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
day: "monday"
8+
commit-message:
9+
prefix: "deps"
10+
open-pull-requests-limit: 10
11+
groups:
12+
production:
13+
dependency-type: "production"
14+
development:
15+
dependency-type: "development"
16+
ignore:
17+
- dependency-name: "react"
18+
update-types: ["version-update:semver-major"]
19+
- dependency-name: "react-dom"
20+
update-types: ["version-update:semver-major"]
21+
- dependency-name: "next"
22+
update-types: ["version-update:semver-major"]
23+
- dependency-name: "eslint"
24+
update-types: ["version-update:semver-major"]
25+
- dependency-name: "eslint-config-next"
26+
update-types: ["version-update:semver-major"]
27+
28+
- package-ecosystem: "github-actions"
29+
directory: "/"
30+
schedule:
31+
interval: "weekly"

.github/workflows/ci.yml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
lint:
15+
name: Lint
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v6
19+
- uses: actions/setup-node@v6
20+
with:
21+
node-version: 22
22+
cache: npm
23+
- run: npm ci
24+
- run: npm run lint
25+
26+
security:
27+
name: Security Audit
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v6
31+
- uses: actions/setup-node@v6
32+
with:
33+
node-version: 22
34+
cache: npm
35+
- run: npm ci
36+
- name: Dependency audit
37+
run: npm audit --audit-level=high --omit=dev
38+
- name: Check for known vulnerabilities
39+
run: npx is-my-node-vulnerable || true
40+
41+
build:
42+
name: Build
43+
runs-on: ubuntu-latest
44+
strategy:
45+
matrix:
46+
node-version: [20, 22]
47+
steps:
48+
- uses: actions/checkout@v6
49+
- uses: actions/setup-node@v6
50+
with:
51+
node-version: ${{ matrix.node-version }}
52+
cache: npm
53+
- run: npm ci
54+
- run: npm run build
55+
56+
test-unit:
57+
name: Unit Tests
58+
runs-on: ubuntu-latest
59+
needs: build
60+
strategy:
61+
matrix:
62+
node-version: [20, 22]
63+
env:
64+
JWT_SECRET: ci-test-secret-with-sufficient-length-for-validation
65+
API_KEY_SECRET: ci-test-api-key-secret-long
66+
steps:
67+
- uses: actions/checkout@v6
68+
- uses: actions/setup-node@v6
69+
with:
70+
node-version: ${{ matrix.node-version }}
71+
cache: npm
72+
- run: npm ci
73+
- run: npm run test:unit
74+
75+
test-coverage:
76+
name: Coverage
77+
runs-on: ubuntu-latest
78+
needs: build
79+
env:
80+
JWT_SECRET: ci-test-secret-with-sufficient-length-for-validation
81+
API_KEY_SECRET: ci-test-api-key-secret-long
82+
steps:
83+
- uses: actions/checkout@v6
84+
- uses: actions/setup-node@v6
85+
with:
86+
node-version: 22
87+
cache: npm
88+
- run: npm ci
89+
- run: npm run test:coverage
90+
- name: Check coverage threshold
91+
run: |
92+
echo "Coverage report generated. Check output for threshold compliance."
93+
94+
test-e2e:
95+
name: E2E Tests
96+
runs-on: ubuntu-latest
97+
needs: build
98+
env:
99+
JWT_SECRET: ci-test-secret-with-sufficient-length-for-validation
100+
API_KEY_SECRET: ci-test-api-key-secret-long
101+
steps:
102+
- uses: actions/checkout@v6
103+
- uses: actions/setup-node@v6
104+
with:
105+
node-version: 22
106+
cache: npm
107+
- run: npm ci
108+
- run: npx playwright install --with-deps chromium
109+
- run: npm run build
110+
- run: npm run test:e2e

.github/workflows/codex-review.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Codex PR Review
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize]
6+
7+
jobs:
8+
request-codex-review:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
pull-requests: write
12+
steps:
13+
- name: Request Codex Review
14+
uses: actions/github-script@v8
15+
with:
16+
script: |
17+
await github.rest.issues.createComment({
18+
owner: context.repo.owner,
19+
repo: context.repo.repo,
20+
issue_number: context.payload.pull_request.number,
21+
body: '@codex review'
22+
});

0 commit comments

Comments
 (0)