22 Commits

Author SHA1 Message Date
LovroG05
8bb62a1c20 feat: serve a backup model when the requested model fails
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Any model can name another model as its backup. The gateway tries the
backup when the model is offline, rate limited, or its upstream fails
before the client has received anything. The response reports the
requested model, so the client sees no switch. The request log records
each failed attempt and the address that served the request, and the
cost uses the backup's prices.
2026-10-15 09:56:01 +02:00
LovroG05
00800d3a3f fix: read the running llama.cpp context and allow a context override
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
The sync took meta.n_ctx_train from the model listing, which is the
training context, not the -c the server runs with. The llama.cpp provider
now asks the server for the live value: /props on a single server, the
router's /models status and /props?model=, and /upstream/<model>/props for
models llama-swap has loaded. Stopped models are never probed, because
that would start them.

Admins can also pin the context window per model from the Models page.
The override wins over the discovered value and survives syncs.
2026-10-04 18:14:09 +02:00
LovroG05
75b145a213 build: update dashboard dependencies and add a dev-db target
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
npm audit fix clears four high severity advisories. make dev-db starts
the local Postgres on its own, for the database tests.
2026-10-04 17:32:44 +02:00
LovroG05
a845aaa614 feat: full model addresses with copy, searchable picker, connect card
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Model catalog is a table keyed by the exact provider/slug address with
a copy button. The chat model picker filters by address and name.
API Keys shows the base URL and a curl example, also right after a
key is created. /v1/models entries gain created, display_name and
context_length.
2026-10-03 16:34:18 +02:00
LovroG05
3ec52d82b7 feat: redesign dashboard on shared UI primitives
Shared tokens and components, responsive layout, real health badge,
request volume chart with hover, log detail with errors and cost,
provider enable and edit, override clearing, OIDC re-login that
returns to the current page.
2026-10-03 16:17:11 +02:00
LovroG05
5c3635b2ea fix: record reasoning from OpenRouter, Anthropic, and dashboard chat
extractDelta and extractCompletion read only reasoning_content, so
reasoning from OpenRouter (reasoning, reasoning_details) and Anthropic
(thinking_delta blocks) was dropped from logged completions. The
streaming path now accumulates reasoning and content separately and
wraps reasoning in think tags, matching the non-streaming format.

The dashboard Test Chat page and the Anthropic stream/translate paths
also recognize the OpenRouter and Anthropic reasoning fields.
2026-08-29 19:07:12 +02:00
LovroG05
41865c5440 feat: faster 2026-07-01 16:40:17 +02:00
LovroG05
58d9c0a9c0 perf: lazy-load log content, populate user_id, keyset-paginate admin logs
Admin logs list no longer joins prompt/completion content for every row —
content is fetched per-row only when a log is expanded in the dashboard,
since a table of chat-length blobs was slow to serialize even at low row
counts.

request_logs.user_id (previously unpopulated despite an index existing on
it) is now set from the owning key on every insert, including synthetic
dashboard keys, and log queries filter on it directly instead of a
virtual_keys subquery. Pagination switches from OFFSET to a (created_at, id)
keyset cursor so paging deep into the log stays cheap. Adds indexes on
provider_name/key_prefix used by the admin filters.
2026-07-01 16:16:49 +02:00
LovroG05
8d8bd22ae1 feat: set app icons, PWA manifest, and favicons 2026-06-29 13:36:53 +02:00
LovroG05
a267cc28a5 feat: collapsible think block in chat, separate reasoning from content 2026-06-29 13:18:02 +02:00
LovroG05
057903f350 fix: log dashboard chat requests; add view-logs button on keys page 2026-06-29 13:11:17 +02:00
LovroG05
3fcc933999 feat: show token usage and TPS stats below each assistant message 2026-06-29 13:08:47 +02:00
LovroG05
ea2b24ed62 fix: test chat uses OIDC auth via /api/chat + /api/models, no key needed 2026-06-29 12:17:34 +02:00
LovroG05
1f5469bce1 fix: chat page key input + layout height; log reasoning_content in completions 2026-06-29 12:08:41 +02:00
LovroG05
ef3e894484 feat: add Test Chat page with streaming, model picker, stop button 2026-06-29 12:04:44 +02:00
LovroG05
5febc03412 fix: restore General settings (name/log-level/retention), remove OIDC section, wire save 2026-06-29 08:52:11 +02:00
LovroG05
02041751e3 fix: remove dead General settings section, show read-only OIDC config 2026-06-29 08:42:49 +02:00
LovroG05
21d74ebfe0 feat: OIDC-only auth, user-scoped keys/logs, admin group, 1yr log retention 2026-06-29 08:32:09 +02:00
LovroG05
d7bd1cced0 feat: content logging and per-key analytics
- Migration 000003: request_log_content table (messages jsonb, completion text)
- InsertRequestLog now returns the new row's ID so content can be linked
- Chat handler captures prompt messages and completion text (streaming accumulates deltas)
- ListRequestLogs left-joins content; logs API passes key filter through
- KeyStats query aggregates requests/tokens/cost/errors per key prefix
- GET /api/admin/stats/keys endpoint
- Logs page: expandable rows show prompt + completion inline
- Analytics page: per-key usage table below the chart
2026-06-29 00:01:25 +02:00
LovroG05
9d807a6cf1 feat: OIDC server-side login flow with confidential client
Add /auth/login and /auth/callback handlers. The backend holds the
client secret and exchanges the authorization code server-side;
the browser never sees the secret. Redirect URI and post-login
fragment destination are derived solely from GATEWAY_SERVER_PUBLIC_URL
(required when OIDC is set) to prevent host-header injection.
2026-06-28 23:46:30 +02:00
LovroG05
6227a49992 feat: add React admin dashboard
Tailwind v4 dark design (DM Sans/Mono, violet accent). Pages: Overview,
Logs, API Keys, Providers, Models, Analytics, Routing, Settings.
Auth gate uses localStorage token validated against /api/admin/providers.
Vite builds to internal/web/dist which is embedded into the binary.
2026-06-28 23:15:28 +02:00
LovroG05
7d72606bb9 frontend 2026-06-27 17:13:07 +02:00