How samucamg/veroroute-edge works
VeroRoute Edge is a Cloudflare Workers AI gateway. Clients authenticate and submit OpenAI- or Anthropic-shaped requests; the gateway normalizes and enriches requests, then routes them across configured providers with fallback and resilience controls. It also exposes web search/fetch and MCP tools, plus an authenticated dashboard for provider, key, and route administration. The graph reflects documented capabilities where implementation excerpts are incomplete; unsampled subsystem links are omitted when their caller is unclear.
Main entry points: cascade.ts Cascade Dispatch · index.ts HTTP Gateway · antigravity.ts OAuth Tokens · routes.ts Admin API
Components 29
Gateway API
- HTTP Gateway
src/index.ts - Authentication
src/admin/auth.ts - API Translation
src/adapters/anthropic.ts - Request Preparation
src/compression/pipeline.ts - Modality Bridge
src/modality/bridge.ts
Routing Core
- Cascade Dispatch
src/routing/cascade.ts - Model Registry
src/config/modelRegistry.ts - Provider Config
src/config/providers.ts - Credential Pool
src/routing/keyPool.ts - Rate Limiting
src/routing/rateLimiter.ts - Circuit Breakers
src/routing/circuitBreaker.ts - Retry And Resilience
src/routing/resilience.ts - Response Cache
src/routing/responseCache.ts - Cost Tracking
src/routing/costTracker.ts
AI And Search
- Provider Adapters
src/adapters/openai-compatible.ts - Workers AI Adapter
src/adapters/cloudflare-ai.ts - Antigravity Adapter
src/adapters/antigravity.ts - OAuth Tokens
src/oauth/antigravity.ts
Admin And Config
- Admin Dashboard
src/ui/dashboard.ts - Admin API
src/admin/routes.ts - Admin Config Store
src/admin/store.ts
Search And MCP
- Search API
src/search/dispatcher.ts - Search Engines
src/search/searxng.ts - Web Fetch
src/search/jina.ts - MCP Server
src/mcp/server.ts
Other components
- API Client
- AI Providers
- Search Services
- Cloudflare KV
Connections 40
- API Client → HTTP Gateway: sends requests
- HTTP Gateway → Authentication: checks identity
- HTTP Gateway → API Translation: translates messages
- HTTP Gateway → Modality Bridge: bridges modalities
- HTTP Gateway → Search API: augments with search
- HTTP Gateway → Request Preparation: prepares request
- HTTP Gateway → Cascade Dispatch: dispatches completion
- HTTP Gateway → Web Fetch: fetches pages
- HTTP Gateway → Admin API: mounts admin API
- Cascade Dispatch → Model Registry: resolves models
- Cascade Dispatch → Provider Config: loads provider config
- Cascade Dispatch → Credential Pool: selects credentials
- Cascade Dispatch → Rate Limiting: enforces limits
- Cascade Dispatch → Circuit Breakers: checks failures
- Cascade Dispatch → Retry And Resilience: handles retries
- Cascade Dispatch → Response Cache: checks responses
- Cascade Dispatch → Cost Tracking: tracks usage
- Cascade Dispatch → Provider Adapters: dispatches requests
- Cascade Dispatch → Workers AI Adapter: dispatches requests
- Cascade Dispatch → Antigravity Adapter: dispatches requests
- Antigravity Adapter → OAuth Tokens: obtains access token
- Provider Adapters → AI Providers: calls models
- Workers AI Adapter → AI Providers: calls models
- Antigravity Adapter → AI Providers: calls models
- Authentication → Admin Config Store: reads auth config
- Admin Dashboard → Admin API: calls endpoints
- Admin API → Admin Config Store: reads and updates
- Admin API → Workers AI Adapter: tests provider
- OAuth Tokens → Admin Config Store: reads OAuth credentials
- OAuth Tokens → Credential Pool: selects refresh credential
- OAuth Tokens → Cloudflare KV: caches access token
- Credential Pool → Cloudflare KV: reads credentials
- Rate Limiting → Cloudflare KV: tracks request windows
- Circuit Breakers → Cloudflare KV: persists cooldowns
- Search API → Search Engines: dispatches queries
- Search Engines → Search Services: queries providers
- Web Fetch → Search Services: retrieves page content
- MCP Server → Search API: runs web search
- MCP Server → Web Fetch: fetches page
- MCP Server → Model Registry: lists providers