admin /providers page and dynamic llms settings#199
Open
jrhizor wants to merge 1 commit into
Open
Conversation
…ration) - Adds `/admin/providers` showing active SCRAPE_TARGETS, per-provider configured status, and a per-target smoke-test button (real call, latency + sample). - Replaces the three hardcoded ChatGPT/Claude/Google cards on `/app/$brand/settings/llms` with one card per active model; toggles write to `brand.enabledModels`. Semantics match `selectTargetsForBrand` that landed in PR 4: null = all enabled, [] = explicit opt-out (nothing runs), [...] = opt-in. Orphaned entries from a shrunk SCRAPE_TARGETS are flagged and dropped on save. - Surfaces the whitelabel report-run coupling: any SCRAPE_TARGETS model not in `WHITELABEL_REPORT_RUNS_PER_MODEL` gets a warning badge on the providers page on `DEPLOYMENT_MODE=whitelabel`. Constant moved into `@workspace/lib/providers` so the web can read it without importing worker code. - Adds "Providers" to the admin sidebar. Completes PR 5 — the provider migration scope from #153 is now closed.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Completes PR 5 of the provider migration (
#153) — the UI data-binding layer on top of the worker dispatch that landed in #197./admin/providersroute. Renders the currentSCRAPE_TARGETSconfiguration (model, provider, version, webSearch), the full provider registry withisConfigured()credential status, and a per-target Test button that calls the real provider with a canned prompt and shows pass/fail + latency + a sample of the response./app/$brand/settings/llmsis now data-driven. The three hardcoded ChatGPT/Claude/Google cards are gone; the page now renders one card per activeSCRAPE_TARGETSmodel usinggetModelMetafor labels + icons. Toggles write tobrand.enabledModelsvia a newupdateBrandEnabledModelsFnserver function.enabledModelssemantics (matchselectTargetsForBrandinpackages/lib/src/providers/runner.ts:13, which is what the worker enforces):null— no override, every configured target runs.[]— explicit opt-out, nothing runs for this brand.[x, y, ...]— opt-in list; every entry must be in the currentSCRAPE_TARGETSor the server-side validator rejects the save.null, so brands can opt out of the opt-in list.enabledModelsreferences a model no longer inSCRAPE_TARGETS(ops removed it from the env), the settings page flags it visibly and drops it from the payload on next save — before the worker would have thrown on next dispatch.WHITELABEL_REPORT_RUNS_PER_MODELmoved fromapps/worker/src/report-worker.tsinto@workspace/lib/providersso the web can read it without importing worker code./admin/providersnow renders a warning badge next to any active target missing from that map onDEPLOYMENT_MODE=whitelabel, where report generation would otherwise throw on first run.Test plan
pnpm turbo build— all 6 packages compile; routeTree.gen.ts regenerated.pnpm turbo test— 206 tests pass (150 lib + 56 web); no new tests needed (the runner semantics this binds to are already covered byselectTargetsForBrand's unit tests).