mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-07 02:59:05 +00:00
fix(proxy): reload the unpriced-model toggle regardless of supported_db_objects
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
3c44f8d926
commit
df00c334d1
2 changed files with 7 additions and 4 deletions
|
|
@ -6823,7 +6823,8 @@ class ProxyConfig:
|
|||
|
||||
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)
|
||||
|
||||
await self._apply_safe_litellm_settings_overrides_from_db(prisma_client=prisma_client)
|
||||
|
||||
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")
|
||||
|
|
|
|||
|
|
@ -741,9 +741,11 @@ class TestBlockRequestsForModelsWithoutPricing:
|
|||
assert litellm.block_requests_for_models_without_pricing is True
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_periodic_db_sync_applies_flag_to_peer_worker(self):
|
||||
@pytest.mark.parametrize("loads_config_overrides", [True, False])
|
||||
async def test_periodic_db_sync_applies_flag_to_peer_worker(self, loads_config_overrides):
|
||||
"""The ~10s reconcile loop runs _init_non_llm_objects_in_db on every worker; it must apply
|
||||
the persisted flag so peers converge without a restart."""
|
||||
the persisted flag so peers converge without a restart, including when supported_db_objects
|
||||
leaves config_overrides out."""
|
||||
from types import SimpleNamespace
|
||||
|
||||
from litellm.proxy.proxy_server import ProxyConfig
|
||||
|
|
@ -756,7 +758,7 @@ class TestBlockRequestsForModelsWithoutPricing:
|
|||
patch.object(
|
||||
ProxyConfig,
|
||||
"_should_load_db_object",
|
||||
side_effect=lambda object_type: object_type == "config_overrides",
|
||||
side_effect=lambda object_type: loads_config_overrides and object_type == "config_overrides",
|
||||
),
|
||||
patch.object(ProxyConfig, "_init_hashicorp_vault_config_override", AsyncMock()),
|
||||
patch("litellm.proxy.proxy_server.get_config_param", AsyncMock(return_value=config_record)),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue