Skip to content

ModelBridgeMulti-Protocol LLM Gateway

One shared gateway core exposing OpenAI, Anthropic, and Gemini APIs across Cloudflare Workers, EdgeOne Makers, Alibaba Cloud ESA, and a self-hosted Node.js 24 + SQLite state service.

AI Translation Notice

This site and documentation have been translated by an AI language model. In case of any discrepancies or ambiguities, please refer to the Chinese documentation as the authoritative source.

Capabilities & Explicit Limits ​

What ModelBridge Delivers

  • Three-Protocol Ingress & Pre-Flight Checks: Exposes OpenAI (/v1/chat/completions, /v1/completions, /v1/embeddings, /v1/models), Anthropic /v1/messages, and Gemini /v1beta/models/* while preserving tool strictness and signed thinking replay metadata.
  • Four-Domain Secret Isolation & Single Authority: Separates ADMIN_PASSWORD, apiKeys, upstream creds, and MODELBRIDGE_STATE_TOKEN across WAL SQLite or AppConfigStore DO, supporting explicit upstream:<id>:<model> pinning.
  • Platform Budget Injection & SSRF Guards: Emits 6 platform bundles (Cloudflare 16 MiB, Makers 1 MiB, ESA 4-fetch limit) and validates custom upstream baseUrl values via public HTTPS checks.

Explicit Non-Goals & Hard Boundaries

  • Explicitly Omitted Surfaces: Does not implement /v1/responses or image/audio media generation; Gemini :countTokens always returns 501.
  • Advisory Discovery & No Blind 5xx Retries: The 65-alias map and Neurons indicator are non-enforcing helpers; timeouts and 5xx errors never fail over across accounts to avoid duplicate billing.
  • No Dual-Write State Fallback: Never dual-writes between self-hosted SQLite and native DO; EdgeOne Makers enforces a strict 1 MiB request cap.

Architecture Overview ​

ModelBridge Architecture (Archify interactive diagram; pan / zoom / inspect supported)
Open Fullscreen ↗

Local Quick Verification ​

Requires Node.js 24+ at the repository root (zero third-party runtime dependencies for the core gateway and state service):

sh
# 1. Run syntax checks and full mocked regression tests
pnpm run check
node --test tests/*.test.mjs

# 2. Build all six deployment bundles under dist/
node tools/build-platforms.mjs

# 3. Start the self-hosted SQLite state service locally (127.0.0.1:8788)
MODELBRIDGE_STATE_TOKEN="$(openssl rand -hex 32)" pnpm run start:state

Documentation Guide ​

Quick Navigation by Role & Goal