Commit Graph
4 Commits
Author SHA1 Message Date
lukaszraczyloandGitHub 4c61d19a72 feat(router): smart routers and per-member rate limits (#9)
Add smart routers: virtual models that score each request and route it to admin-defined model tiers. A retryable failure moves the request to a higher tier. The classifier v2 extracts prose, finds the original ask in long tool loops, adds an uncertainty margin and reads tool-output failures. Sessions, outcome signals, bounded calibration, adaptive selection within a tier, gated saturation downgrade, a first-byte timeout and an opt-in timeout fallback are included. Every new feature is off by default.

Add per-member group limits, a tokensPerMinute window that counts uncached input and output, rate-limit headers in three dialects, soft pacing before the hard limit, and a limitExemptKinds list so embedding and reranking traffic never counts toward or hits a limit.

Fix yaegi named-result state that made smartContentSize grow between calls.
2026-11-25 00:40:30 +00:00
lukaszraczyloandGitHub a4fda5f9cb feat(provider): per-model and per-path upstreams (#8)
Add modelBaseUrls and pathBaseUrls to openai-type providers.
2026-11-08 07:26:14 +00:00
lukaszraczylo cbffcb4061 fix(concurrency): clamp learned limit below the ceiling
An overload seen with many requests in flight set the learned limit above the ceiling. The learner now clamps the value to one below the ceiling.
2026-11-02 23:57:07 +00:00
lukaszraczylo 644b8115c8 feat(config): advertise concurrency via RateLimit-Policy with autodetect
The gateway now sends the concurrency limit as a RateLimit-Policy
field from draft-ietf-httpapi-ratelimit-headers. The value is
"concurrency";q=<n>;qu="concurrent-requests". The invented
X-Concurrency-Limit header is gone.

The new concurrencyAutodetect option is off by default. When on,
the gateway learns a limit for each configured provider. A 429, 503,
504 or upstream timeout sets the limit to half the in-flight
requests, with a minimum of 1. Four consecutive successes add 1.
At 64 the limit counts as unknown again.

Responses served via a provider advertise the smaller of
maxConcurrency and the learned value. An explicit maxConcurrency
always wins. Routing, retry and failover do not change.
2026-10-18 13:44:08 +01:00