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 & 48-Model Endpoint Coverage: Exposes OpenAI (/v1/chat/completions, /v1/completions, /v1/responses, /v1/embeddings, /v1/images/{generations,edits}, /v1/audio/{speech,transcriptions,translations,realtime,turn-detection}, /v1/models), task endpoints (/v1/rerank, /v1/translations, /v1/classifications, /v1/extractions, /v1/decisions, /v1/vision, /v1/ai/run), Anthropic /v1/messages, and Gemini /v1beta/models/*.
  • 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 enforces SSRF/remote-URL checks across upstream baseUrl, clairic/clef*, and moondream.

Explicit Non-Goals & Hard Boundaries

  • Strict Parameter Rejection: Rejects unsupported combinations pre-flight (CF /v1/responses streaming, CF response_format=url/n>1/mask, Aura speed!=1); Gemini :countTokens always returns 501, and non-chat task models sent to /v1/chat/completions return 400 naming the proper endpoint.
  • Advisory Discovery & No Blind 5xx Retries: The 48-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