mirror of
https://github.com/tiennm99/litellm.git
synced 2026-07-11 17:05:43 +00:00
844d0d47b7
The _add_tag_to_deployment function was directly modifying the deployment's litellm_params in memory and writing it back to the database, which caused encrypted API keys and other sensitive fields to be lost. This fix retrieves the model from the database first, preserves all existing fields including encrypted ones, adds only the new tag to the tags array, and updates the database with the modified params while keeping encrypted fields intact. Added comprehensive unit tests covering preservation of encrypted fields, handling of both string and dict litellm_params formats, duplicate tag prevention, and error handling for missing models. Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <noreply@anthropic.com>
In total litellm runs 1000+ tests
[02/20/2025] Update:
To make it easier to contribute and map what behavior is tested,
we've started mapping the litellm directory in tests/test_litellm
This folder can only run mock tests.