-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Enhance proxy CLI with Rich formatting and improved user experience #11420
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
Enhance proxy CLI with Rich formatting and improved user experience #11420
Conversation
- Integrated Rich library for better console output in `proxy_cli.py`, including version display, health check results, and test completion responses. - Updated health check and test completion methods to provide progress indicators and formatted tables. - Refactored feedback display in `proxy_server.py` to use Rich for a more visually appealing user interface. - Adjusted tests in `test_proxy_cli.py` to mock console output instead of using print statements, ensuring compatibility with Rich formatting.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reviewed
- Removed progress indicators for IAM token generation and environment variable decryption to simplify the code. - Consolidated the logic for generating the database URL and setting environment variables. - Enhanced error handling for configuration loading and database setup, ensuring clearer feedback
…del display. Added support for loading model parameters from environment variables and refined provider identification logic. Fallback to original print formatting if Rich is not available.
…tom warning display to utils.py. Enhanced feedback box with rich formatting and fallback to ASCII for environments without rich. Cleaned up proxy_server.py by removing obsolete code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mostly looks good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
requested changes
…ic to a new utility function `display_model_initialization` for improved readability and maintainability. Enhanced model provider extraction with a dedicated function. Fallback to basic logging if Rich console is unavailable.
…om_model` function with a more robust approach using `get_llm_provider`. Implement fallback logic for provider identification and improve error handling. Ensure compatibility with Rich console for model initialization display.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…erriAI#11420) * Enhance proxy CLI with Rich formatting and improved user experience - Integrated Rich library for better console output in `proxy_cli.py`, including version display, health check results, and test completion responses. - Updated health check and test completion methods to provide progress indicators and formatted tables. - Refactored feedback display in `proxy_server.py` to use Rich for a more visually appealing user interface. - Adjusted tests in `test_proxy_cli.py` to mock console output instead of using print statements, ensuring compatibility with Rich formatting. * fix linting error * refactor(proxy_cli.py): simplify DB setup logging - Removed progress indicators for IAM token generation and environment variable decryption to simplify the code. - Consolidated the logic for generating the database URL and setting environment variables. - Enhanced error handling for configuration loading and database setup, ensuring clearer feedback * Update test-linting workflow to include proxy-dev dependencies in Poetry installation * Enhance proxy server initialization with Rich console for improved model display. Added support for loading model parameters from environment variables and refined provider identification logic. Fallback to original print formatting if Rich is not available. * Refactor feedback handling: Moved feedback message generation and custom warning display to utils.py. Enhanced feedback box with rich formatting and fallback to ASCII for environments without rich. Cleaned up proxy_server.py by removing obsolete code. * fix linting error * Refactor model initialization display: Moved model initialization logic to a new utility function `display_model_initialization` for improved readability and maintainability. Enhanced model provider extraction with a dedicated function. Fallback to basic logging if Rich console is unavailable. * Refactor model provider extraction: Replace the `_extract_provider_from_model` function with a more robust approach using `get_llm_provider`. Implement fallback logic for provider identification and improve error handling. Ensure compatibility with Rich console for model initialization display.
…rience (BerriAI#11420)" This reverts commit 3b911ba.
Title
🚄 Enhance LiteLLM Proxy CLI with Rich formatting and improved UX
Relevant issues
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
tests/litellm/
directory, Adding at least 1 test is a hard requirement - see detailsmake test-unit
Type
🆕 New Feature
🚄 Infrastructure
✅ Test
Changes
CLI Enhancement with Rich Library
Enhanced
litellm/proxy/proxy_cli.py
:Enhanced
litellm/proxy/proxy_server.py
:Updated
tests/test_litellm/proxy/test_proxy_cli.py
:Visual Improvements
Before:
After:
Technical Details
User Experience Improvements
Code Quality
This enhancement significantly improves the developer experience when using LiteLLM Proxy CLI while maintaining full backward compatibility and test coverage.