Repository navigation
Releases
v2.2.0
What's New
Audio Transcription Support
- Multipart/form-data handling:
/v1/audio/transcriptionsnow properly proxies Whisper and other audio transcription requests to backends - Requests with
fileandmodelform fields are correctly routed based on the model parameter
SGLang Compatibility
- Error passthrough: SGLang-specific error responses are now passed through verbatim instead of being re-wrapped
- Responses API streaming:
/v1/responsesstreaming is now supported by translating to/v1/chat/completionsstreaming and back
Bug Fixes
- Fixed Content-Length header handling when re-wrapping upstream error bodies
- Fixed multipart body buffering to preserve request body for proxying
Commits
699c1a3fix: preserve multipart body for proxy after parsing model field7b0ad2bfix: properly buffer multipart body before parsingf26cbdbfeat: handle multipart/form-data for /v1/audio/transcriptions51a99eefix: rewrite upstream Content-Length header when rewrapping error body1a1f1d5feat: pass sglang errors through verbatim and translate /v1/responses streaming
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
v2.0.0
What's New
OpenAI Responses API Support
eiroute now proxies POST /v1/responses requests to your backend. This endpoint is used by newer OpenAI API clients and supports advanced features like:
- Multi-turn conversations with
previous_response_id - Enhanced tool calling capabilities
- Structured output with JSON schema
The route follows the same pattern as existing /v1/chat/completions and /v1/completions endpoints, including automatic backend selection, streaming support, semaphore-based rate limiting, and Request ID propagation.
Changes
- Added
POST /v1/responsesroute incmd/eiroute/main.go - Added
TestProxy_ResponsesRoutetest ininternal/router/router_test.go
Requirements
- Backend must support the Responses API (e.g., sglang)
- No configuration changes required - works with existing model definitions
v1.3.0
Eiroute v1.3.0
Bug Fixes
Semaphore State Timing Fix
Previously, when Acquire() timed out due to a full semaphore, the log captured semaphore_used AFTER other requests had released their slots, showing misleading values like 0 or 1.
Now semaphore_used and semaphore_capacity are captured immediately when the timeout occurs, showing the true state at failure time.
v1.2.0
Eiroute v1.2.0
New Features
Backend Status in Error Logs
All error logs now include backend status information when a backend is involved:
backend- Backend namebackend_url- Backend URLbackend_healthy- Current health statussemaphore_used- Current semaphore usagesemaphore_capacity- Max semaphore capacity
Bug Fixes
Error Key Corrections
- Upstream 429 →
backend_overloaded(correct error key) - Eiroute semaphore overload →
rate_limited(correct error key) - Error messages properly assigned to each key
Example Log Output
{"level":"WARN","msg":"request error","request_id":"...","error_key":"rate_limited","http_status":429,"backend":"minimax","backend_url":"http://...","backend_healthy":true,"semaphore_used":10,"semaphore_capacity":10}v1.1.1
v1.1.0
Eiroute v1.1.0
New Features
Model Deprecation
- Add
deprecated: trueto mark a model as deprecated - Add
successorfield to specify the replacement model name - Add
deprecated_notice_intervalto probabilistically show 303 deprecation notice - Add
retry_afterto set Retry-After header on 301/303 responses - New error templates:
model_deprecated(303) andmodel_outdated(301)
Debug Logging
- New debug status logger outputs every 10 seconds when
log_level: debug - Shows backend status, active requests, memory usage, and system load average
Error Template Hot Reload
- Error templates are now reloaded on
/-/reloadand SIGHUP - No restart needed when updating error templates
New Metrics
llm_router_upstream_429_total- Upstream 429 responsesllm_router_backend_overloaded_total- Local semaphore overload (429)llm_router_upstream_errors_total- All upstream HTTP errorsllm_router_health_check_duration_seconds- Health check latency
Docker
- Docker tags now include
vprefix (e.g.v1.1.0instead of1.1.0)
Documentation
- Updated README with YAML examples for active and deprecated models
- Added AGENTS.md with GitHub workflow guidelines
Bug Fixes
- Fixed semaphore recreation during hot reload (max_concurrent changes now applied)
- Fixed HTTP 429 error logging (both upstream and local)
- Swapped error keys: upstream 429 → backend_overloaded, eiroute overload → rate_limited
Breaking Changes
- None - fully backward compatible
v1.0.0
Eiroute v1.0.0
Eiroute ist ein minimaler, aber schneller HTTP-Reverse-Proxy für selbst-gehostete OpenAI-kompatible LLM Backends (sglang, vLLM).
Features
- Multi-Backend Support: Lastverteilung über mehrere Upstream-Backends
- Model-basiertes Routing: Automatische Weiterleitung basierend auf dem model-Feld
- Health Checks: Automatische Überwachung der Backend-Gesundheit mit konfigurierbarem Intervall
- Hot Reload: Konfiguration ohne Neustart via POST /-/reload oder SIGHUP
- Concurrency Control: Pro-Backend Semaphore für maximale gleichzeitige Requests
- Streaming Support: SSE-Streams werden transparent durchgereicht
Fixes
- Semaphore wird jetzt bei Hot-Reload mit neuer Kapazität neu erstellt
- HTTP 429 Fehler werden korrekt geloggt (sowohl Upstream- als auch lokale Limits)
- Error Keys getauscht: Upstream 429 -> backend_overloaded, lokale Limits -> rate_limited
Configuration
Siehe config.example.yaml für verfügbare Optionen.