Commit Graph
3 Commits
Author SHA1 Message Date
lukaszraczylo 0753a8cb4c fix(shared-state): read calibrator counters without the limiter latch
The shared calibration refresh read through the limiter. A Redis error
there latched the chat route's limiter store for five seconds. The
refresh now reads the store directly, as the shared-state loop does.
2026-11-26 04:13:36 +00:00
lukaszraczylo 367f3b60ff perf(shared-state): batch calibrator counters with the usage write
Each served request spawned a second async write for the calibrator
counters. They now ride the batch accountWith already sends, and only
when shared state is on and a store is configured.
2026-11-26 04:12:38 +00:00
lukaszraczylo e70eb32336 feat(router): share the token-size estimate through Redis
With redis.sharedState on, each observed sample also adds to day counters of prompt bytes, prompt tokens and sample count per model. The router-learning loop reads the counters of the routers' target models and keeps one fleet ratio per model. The estimate prefers that ratio once the fleet has the same minimum sample count as the local calibrator. Dropped counter writes only blur the estimate. With the switch off, the calibrator runs its local code only and makes no store call.
2026-11-26 03:32:03 +00:00