Skip to content

fix(model_management_endpoints): clear cache and reload models after update #10853

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

Merged

Conversation

jtong99
Copy link
Contributor

@jtong99 jtong99 commented May 15, 2025

Fix model's name was not reloaded after editing model

Added clear cache and reload models after editing

Relevant issues

Fixes #9111

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have Added testing in the tests/litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • I have added a screenshot of my new test passing locally
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible, it only solves 1 specific problem

Type

🐛 Bug Fix

Changes

In model_management_endpoints.py:

  • Created clear_cache function
  • Called clear_cache function after editing model successfully in patch_model function
  • Added test case to verify clear_cache function worked correctly

Screenshot 2025-05-16 at 00 27 07

Copy link

vercel bot commented May 15, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
litellm ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 24, 2025 5:06am

@CLAassistant
Copy link

CLAassistant commented May 15, 2025

CLA assistant check
All committers have signed the CLA.

@jtong99 jtong99 changed the title fix(model_management_endpoints): clear cache and reload models after update a model fix(model_management_endpoints): clear cache and reload models after update May 16, 2025
@jtong99
Copy link
Contributor Author

jtong99 commented May 19, 2025

Hi @ishaan-jaff , is there any way that I can fix the error from mock testing above? they're not from my PR

@krrishdholakia
Copy link
Contributor

Hey @jtong99 just rebase with main - it should be fixed

@jtong99 jtong99 marked this pull request as ready for review May 24, 2025 05:11
@jtong99
Copy link
Contributor Author

jtong99 commented May 24, 2025

Hey @jtong99 just rebase with main - it should be fixed

Thanks @krrishdholakia , it worked. Please check my PR when you have time and tell me if there is anything that need changes.

@krrishdholakia krrishdholakia merged commit bb700b8 into BerriAI:main May 24, 2025
6 checks passed
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.

[Bug]: Can't modify models settings on UI (Edit Option)
3 participants