Skip to content

[litellm-agent] Staging → litellm_internal_staging (5/15/2026) - #27991

Closed
oss-pr-review-agent-shin[bot] wants to merge 3 commits into
litellm_internal_stagingfrom
shin_agent_oss_staging_05_15_2026
Closed

[litellm-agent] Staging → litellm_internal_staging (5/15/2026)#27991
oss-pr-review-agent-shin[bot] wants to merge 3 commits into
litellm_internal_stagingfrom
shin_agent_oss_staging_05_15_2026

Conversation

@oss-pr-review-agent-shin

@oss-pr-review-agent-shin oss-pr-review-agent-shin Bot commented May 15, 2026

Copy link
Copy Markdown
Contributor

Squash-merged by litellm-agent from FabrizioCafolla's PR.
@oss-pr-review-agent-shin

Copy link
Copy Markdown
Contributor Author

@greptile please review

@greptile-apps

greptile-apps Bot commented May 15, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR merges two features: HPA autoscaling behavior support in the Helm chart, and an admin-controlled blocked flag for proxy models to enable pause/resume from the UI.

  • HPA behavior: Adds an optional behavior block to hpa.yaml via toYaml | nindent, guarded by {{- if .Values.autoscaling.behavior }}, with a new helm-unittest test suite covering both presence and absence of the field.
  • Model blocking: Adds a blocked column to LiteLLM_ProxyModelTable (safe migration, DEFAULT false), propagates the flag through router filtering (_filter_blocked_deployments, _is_deployment_blocked, get_fully_blocked_model_names), enforces proxy-admin-only authorization in patch_model, hides fully-blocked models from /v1/models, and invalidates the in-memory router via clear_cache()add_deployment() after a PATCH.
  • Redis: Adds socket_timeout and socket_connect_timeout to the allowed cluster kwargs set.

Confidence Score: 5/5

Safe to merge. Both features are additive, the migration is backward-compatible, and the model-blocking logic is applied consistently across all routing and credential-lookup paths.

The blocked flag flows correctly from DB → get_model_info_with_id → router model list → every routing entry point (sync, async, pass-through, credential helpers). The auth gate is correctly placed before the DB write. clear_cache() triggers a synchronous DB reload so the block takes effect immediately after the PATCH. The migration uses IF NOT EXISTS with DEFAULT false so existing rows are unaffected. Tests are mock-only and cover all new paths.

No files require special attention.

Important Files Changed

Filename Overview
litellm/router.py Adds _filter_blocked_deployments, _is_deployment_blocked, and get_fully_blocked_model_names; applies blocked filtering at every routing entry point (sync/async, pass-through, direct dict, credential helpers). Logic is consistent and well-tested.
litellm/proxy/management_endpoints/model_management_endpoints.py Auth gate (proxy-admin only) added before the DB update; update_db_model threads blocked into the Prisma payload; clear_cache() triggers a full DB reload so the block takes effect synchronously.
litellm/proxy/proxy_server.py Propagates DB blocked column into model_info["blocked"] during model load; filters fully-blocked model names from /v1/models in both code branches of model_list.
litellm-proxy-extras/litellm_proxy_extras/migrations/20260514120000_add_blocked_to_proxy_model_table/migration.sql Safe additive migration: ADD COLUMN IF NOT EXISTS "blocked" BOOLEAN NOT NULL DEFAULT false — existing rows are unaffected.
litellm/types/router.py Adds blocked: Optional[bool] = None to ModelInfo and updateDeployment. ModelInfo uses extra="allow" and a custom .get() so dict-style access in the hot path remains compatible.
litellm/proxy/route_llm_request.py Adds _is_deployment_blocked check to the credential-resolution path for file/batch/passthrough endpoints, preventing bypass of an admin pause.
deploy/charts/litellm-helm/templates/hpa.yaml Adds optional behavior block to HPA spec using standard `toYaml
tests/test_litellm/test_router.py Comprehensive mock-only tests for all new blocking paths: sync/async healthy deployment filters, pass-through, credential helpers, and get_fully_blocked_model_names.

Reviews (3): Last reviewed commit: "fix: pass socket timeouts to Redis clust..." | Re-trigger Greptile

maxReplicas: 100
targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80
# behavior: {}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 The commented-out hint behavior: {} documents the option but an empty map is falsy in Go templates, so uncomment-and-leave-empty silently produces no output. A brief inline example with at least one meaningful key makes the expectation clearer and reduces user confusion.

Suggested change
# behavior: {}
# behavior:
# scaleDown:
# stabilizationWindowSeconds: 300
# scaleUp:
# stabilizationWindowSeconds: 0

@codecov

codecov Bot commented May 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
litellm/proxy/route_llm_request.py 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

…27927)

Squash-merged by litellm-agent from Cyberfilo's PR.
@oss-pr-review-agent-shin

Copy link
Copy Markdown
Contributor Author

@greptile please review

Squash-merged by litellm-agent from tomdee's PR.
@oss-pr-review-agent-shin

Copy link
Copy Markdown
Contributor Author

@greptile please review

@Sameerlite Sameerlite closed this May 18, 2026
@Sameerlite
Sameerlite deleted the shin_agent_oss_staging_05_15_2026 branch May 22, 2026 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants