feat: admin-configurable default AI providers/models (v0.30.0)
Add DEFAULT_{TEXT,VISION,MEAL_PLAN}_{PROVIDER,MODEL} site settings,
editable from Settings -> Admin (new AdminDefaultModelForm, mirroring
the per-user model-prefs UI). getDefaultProviderWithKey now accepts
the use case and checks the admin default (after the user's own BYOK
key, before the old "first configured site key" heuristic) so admins
can pin a specific provider/model per feature instead of it being
whichever key happens to exist.
Wired into scale/substitute/batch-cook/meal-plan generation routes,
which previously called getDefaultProviderWithKey() without a use
case and so never had visibility into per-feature routing at all.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -14,6 +14,12 @@ const ALLOWED_KEYS: SiteSettingKey[] = [
|
||||
"NEXT_PUBLIC_VAPID_PUBLIC_KEY",
|
||||
"VAPID_PRIVATE_KEY",
|
||||
"SIGNUPS_DISABLED",
|
||||
"DEFAULT_TEXT_PROVIDER",
|
||||
"DEFAULT_TEXT_MODEL",
|
||||
"DEFAULT_VISION_PROVIDER",
|
||||
"DEFAULT_VISION_MODEL",
|
||||
"DEFAULT_MEAL_PLAN_PROVIDER",
|
||||
"DEFAULT_MEAL_PLAN_MODEL",
|
||||
];
|
||||
|
||||
async function requireAdmin() {
|
||||
|
||||
Reference in New Issue
Block a user