Open dyga01 opened 4 days ago
Hello @dyga01 and @hemanialaparthi there are two PRs connected to exception handling. Do you have a preference on the order in which they are reviewed and ultimately merged?
Hello @dyga01 and @hemanialaparthi there are two PRs connected to exception handling. Do you have a preference on the order in which they are reviewed and ultimately merged?
We do not have a preference for the order in which both PRs are merged. We would suggest merging them chronologically, but we do not foresee any issues.
Pull Request: Add Exception Handling for API key and API server exceptions for LiteLLM so it doesn't crash and give a long stack trace.
Aidan Dyga (@dyga01) and Hemani Alaparthi (@hemanialaparthi)
3
bug, enhancement
This pull request aims to enhance LiteLLM's error handling capabilities, focusing on API key and server exceptions. By implementing the new exceptions.py file and making changes to advise.py, we hope to prevent crashes and long stack traces that can confuse users. The goal is to improve the library's stability and user experience by providing more graceful error handling and user-friendly error messages, making LiteLLM more robust and easier to debug in real-world scenarios.
Coverage will be maintained for the exceptions.py file, as we have implemented new tests to ensure the new feature is fully tested.
The tests have been conducted on a Mac. It would be great if I could have a Linux and Windows user test it out.
Output can vary based on the exceptions.
i) For example for the command where the
advice_model
is incorrect, the output should be the according:ii) If the
advice_server
is invalid, this should be the output:iii) NOTE: If LiteLLM does change their exception handling, the program will still not crash because we implemented a default behaviour for non LiteLLM Exceptions and this will produce the error message and a general purpose output but not a stacktrace .