Skip to content

v2.1.0

Choose a tag to compare

@engel75 engel75 released this 16 Apr 17:17
· 6 commits to main since this release
a2e5dd7

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 API
  • GET /v1/responses/{id} — Retrieve a response by ID
  • POST /v1/responses/{id}/cancel — Cancel a response by ID
  • POST /v1/embeddings — Text embeddings
  • POST /v1/classify — Text classification
  • POST /v1/tokenize — Token counting
  • POST /v1/detokenize — Token decoding
  • POST /v1/audio/transcriptions — Audio transcription (Whisper)
  • POST /v1/score — Text scoring
  • POST /v1/rerank — Rerank (v1)
  • POST /rerank — Rerank (root)
  • POST /v2/rerank — Rerank (v2)

Anthropic API:

  • POST /v1/messages — Anthropic Messages API
  • POST /v1/messages/count_tokens — Anthropic token counting

Ollama API:

  • POST /api/chat — Ollama Chat API
  • POST /api/generate — Ollama Generate API

WebSocket:

  • GET /v1/realtime — OpenAI Realtime API (WebSocket proxy with wss:// support)

Performance Improvements

  • Streaming body parsing: Request bodies are now parsed using streaming JSON token decoding (parseRoutingFields). Only the model field 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/mux router 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 to http.NewServeMux which natively supports "METHOD /path" patterns (Go 1.22+) and {id} wildcards.
  • Fixed: WebSocket wss:// never used — The WebSocket proxy unconditionally set the scheme to ws:// before checking if the backend URL used HTTPS, so wss:// 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 like 000000000000001f instead of c3839f1e-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 version subcommand

Full Changelog

  • feat: proxy additional OpenAI-compatible endpoints to backend
  • feat: add messages/count_tokens, responses/{id}, responses/{id}/cancel, and realtime endpoints
  • perf: optimize proxy speed and connection handling
  • fix: use wss scheme for WebSocket connections to HTTPS backends
  • fix: replace gorilla/mux with http.NewServeMux to restore all API routes
  • fix: restore UUID request IDs for correlation with upstream proxies
  • docs: update README with new endpoints, WebSocket proxy, and performance section