3 Commits
Author SHA1 Message Date
Konrad Lother 6412c738bd models: refresh from providers, import prices, dynamic model pools
The background fetch now repeats (models_refresh, default 300 s) instead of
running once at startup.  It reads the price fields the provider publishes next
to each model and merges them over prices.conf (budget/request windows from the
file survive).  Known limits survive a refresh, so ollama is not asked
/api/show for every model on every pass.

A pool can be built from a provider's current model list:

    pool free from opencode-go-free match "*-free"

Rules keep a marker and resolve the pool per request, so a model that appears
later is routable without a config reload.  Pools used as judges or ctx_fallback
resolve the same way.

Virtual keys grow a deny glob: the olivia key hides the olivia model from that
key's /v1/models and refuses it on the request path, while other keys still see
it.
2026-11-23 07:52:08 +00:00
Hermes 83a56eb11d tests: wait for a port instead of sleeping before it
Run 13 failed the whole cache section with six checks and no listener: the
router was started with "sleep 0.8" and curl asked too early. The same fixed
sleep sat in front of a dozen other routers and stubs. Every one now waits for
its port (wait_port), and the two checks that need a listener to be *absent*
(mesh without a secret, roll3 without SO_REUSEPORT) wait for their log line
(wait_log) instead of hoping the message is there after 0.6 s.

Same checks, no fixed windows left before a listener; the suite is also faster
because it no longer sleeps through them. Full run: 537 OK, 0 FAIL, PASS.
2026-11-19 06:59:55 +00:00
Hermes b9213c6b06 models: allow/deny-Politik und /v1/models filtern
- `models allow` ist eine Whitelist, `models deny` gewinnt. Muster sind
  fnmatch-Globs auf die Modell-ID; ein Suffix "#variante" wird zusätzlich
  ohne Variante geprüft, damit der opencode-Effort-Selektor nutzbar bleibt.
- /v1/models wird gefiltert und um virtuelle Alias-/Pool-Modelle mit der
  kleinsten Kontextgrenze der Kette ergänzt. Das gilt auch für chunked
  Antworten und für die opencode-Brücke.
- Anfragen mit gesperrtem Modell bekommen 403 model_not_allowed, bevor ein
  Endpoint-Slot belegt wird. /v1/models selbst ist token-frei und umgeht
  Hard-Budget und Soft-Throttle.
- /v1/models wird mit Accept-Encoding: identity geholt. Sonst könnte eine
  komprimierte Liste am Filter vorbeigehen; andere Pfade behalten den
  Accept-Encoding-Wunsch des Clients.
2026-11-15 21:26:40 +00:00