Repository navigation
v2.1.0
What's New in v2.1.0
New API Endpoints
eiroute now proxies 18 additional OpenAI-compatible endpoints to backends:
OpenAI API:
POST /v1/responses— OpenAI Responses APIGET /v1/responses/{id}— Retrieve a response by IDPOST /v1/responses/{id}/cancel— Cancel a response by IDPOST /v1/embeddings— Text embeddingsPOST /v1/classify— Text classificationPOST /v1/tokenize— Token countingPOST /v1/detokenize— Token decodingPOST /v1/audio/transcriptions— Audio transcription (Whisper)POST /v1/score— Text scoringPOST /v1/rerank— Rerank (v1)POST /rerank— Rerank (root)POST /v2/rerank— Rerank (v2)
Anthropic API:
POST /v1/messages— Anthropic Messages APIPOST /v1/messages/count_tokens— Anthropic token counting
Ollama API:
POST /api/chat— Ollama Chat APIPOST /api/generate— Ollama Generate API
WebSocket:
GET /v1/realtime— OpenAI Realtime API (WebSocket proxy withwss://support)
Performance Improvements
- Streaming body parsing: Request bodies are now parsed using streaming JSON token decoding (
parseRoutingFields). Only themodelfield is read for routing — the rest of the body streams through to the backend without buffering the entire payload into memory, significantly reducing latency and memory usage for large requests. - Transport tuning:
- 32KB per-connection read/write buffers (up from Go defaults)
- TCP keepalive reduced from 30s to 15s for faster connection recycling
- Connection pool: 256 max idle connections, 64 per host
Bug Fixes
- Fixed: All API routes returning 404 — The
gorilla/muxrouter was incorrectly used with"METHOD /path"route patterns.gorilla/mux.Handle()treats the entire string as a URL path, causing all route registrations to silently fail. Switched back tohttp.NewServeMuxwhich natively supports"METHOD /path"patterns (Go 1.22+) and{id}wildcards. - Fixed: WebSocket
wss://never used — The WebSocket proxy unconditionally set the scheme tows://before checking if the backend URL used HTTPS, sowss://connections were never established. The scheme is now checked first. - Fixed: Request IDs not correlatable with upstream proxies —
uuid.New()was replaced with an atomic hex counter, producing IDs like000000000000001finstead ofc3839f1e-ccbf-4061-bd6f-d30a11dff92d. Hex counters are not globally unique (reset on restart) and cannot be correlated with upstream systems like Bifrost. Restored UUID generation.
New Sections in README
- WebSocket Proxy — Documents
wss://support, concurrency limits, relay buffers, and timeouts - Performance — Documents transport tuning and streaming body parsing
- Version command —
./eiroute versionsubcommand
Full Changelog
feat: proxy additional OpenAI-compatible endpoints to backendfeat: add messages/count_tokens, responses/{id}, responses/{id}/cancel, and realtime endpointsperf: optimize proxy speed and connection handlingfix: use wss scheme for WebSocket connections to HTTPS backendsfix: replace gorilla/mux with http.NewServeMux to restore all API routesfix: restore UUID request IDs for correlation with upstream proxiesdocs: update README with new endpoints, WebSocket proxy, and performance section