-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
feat(proxy): add admin toggle to block requests for models without pricing #35181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
7e1f44f
84c41dc
074b37b
6bd21fa
c551a5c
9c29e11
21891b4
7f539e3
5301872
ab79b8d
eb8d402
2b2d6d7
3672fa9
3c44f8d
df00c33
c73480c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6824,6 +6824,20 @@ async def _init_non_llm_objects_in_db(self, prisma_client: PrismaClient): | |
| if self._should_load_db_object(object_type="config_overrides"): | ||
| await self._init_hashicorp_vault_config_override(prisma_client=prisma_client) | ||
|
|
||
| await self._apply_safe_litellm_settings_overrides_from_db(prisma_client=prisma_client) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When Knowledge Base Used: Proxy Server Request Flow
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. config_overrides gates the vault table, not litellm_settings. Startup already applies these DB values ungated, so the periodic reload just matches it
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're right — the original comment conflated two distinct loading mechanisms. Looking at the diff: if self._should_load_db_object(object_type="config_overrides"):
await self._init_hashicorp_vault_config_override(prisma_client=prisma_client)
await self._apply_safe_litellm_settings_overrides_from_db(prisma_client=prisma_client)The |
||
|
|
||
| async def _apply_safe_litellm_settings_overrides_from_db(self, prisma_client: PrismaClient) -> None: | ||
| config_record: Final = await get_config_param(prisma_client, "litellm_settings") | ||
| if config_record is None or config_record.param_value is None: | ||
| return | ||
| raw_settings: Final = config_record.param_value | ||
| litellm_settings: Final = json.loads(raw_settings) if isinstance(raw_settings, str) else raw_settings | ||
| if not isinstance(litellm_settings, dict): | ||
| return | ||
| for key, value in litellm_settings.items(): | ||
| if key in LITELLM_SETTINGS_SAFE_DB_OVERRIDES: | ||
| setattr(litellm, key, value) | ||
|
|
||
| async def _init_semantic_filter_settings_in_db(self, prisma_client: PrismaClient): | ||
| """ | ||
| Initialize MCP semantic filter settings from database. | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.