-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
LiteLLM Minor Fixes & Improvements (09/18/2024) #5772
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
model_name = model_name.lower() | ||
|
||
# Check for MoE models in the form <number>x<number>b | ||
moe_match = re.search(r"(\d+)x(\d+)b", model_name) |
Check failure
Code scanning / CodeQL
Polynomial regular expression used on uncontrolled data High
regular expression
user-provided value
This
regular expression
user-provided value
This
regular expression
user-provided value
This
regular expression
user-provided value
return "fireworks-ai-56b-to-176b" | ||
|
||
# Check for standard models in the form <number>b | ||
re_params_match = re.search(r"(\d+)b", model_name) |
Check failure
Code scanning / CodeQL
Polynomial regular expression used on uncontrolled data High
regular expression
user-provided value
This
regular expression
user-provided value
This
regular expression
user-provided value
This
regular expression
user-provided value
model="fireworks_ai/mixtral-8x7b-instruct", messages=messages | ||
) # works fine | ||
|
||
print(resp) |
Check failure
Code scanning / CodeQL
Clear-text logging of sensitive information High test
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expression logs
sensitive data (secret)
This expressi
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 3 days ago
To fix the problem, we should avoid logging the entire resp
object directly. Instead, we can log only non-sensitive parts of the response or use a logging mechanism that redacts sensitive information.
The best way to fix this without changing existing functionality is to:
- Identify and log only the non-sensitive parts of the
resp
object. - Use a custom logging function that redacts or omits sensitive information.
-
Copy modified lines R1276-R1280
@@ -1275,3 +1275,7 @@ | ||
|
||
print(resp) | ||
# Log only non-sensitive parts of the response | ||
if hasattr(resp, 'non_sensitive_data'): | ||
print(f"Non-sensitive response data: {resp.non_sensitive_data}") | ||
else: | ||
print("Response received, but contains sensitive data.") | ||
cost = completion_cost(completion_response=resp) |
…er compose Closes #5739
…ist of dictionaries Fixes #5755
…m for fetching API base and token, if unspecified (#5746) * LiteLLM Minor Fixes & Improvements (09/16/2024) (#5723) * coverage (#5713) Signed-off-by: dbczumar <[email protected]> * Move (#5714) Signed-off-by: dbczumar <[email protected]> * fix(litellm_logging.py): fix logging client re-init (#5710) Fixes #5695 * fix(presidio.py): Fix logging_hook response and add support for additional presidio variables in guardrails config Fixes #5682 * feat(o1_handler.py): fake streaming for openai o1 models Fixes #5694 * docs: deprecated traceloop integration in favor of native otel (#5249) * fix: fix linting errors * fix: fix linting errors * fix(main.py): fix o1 import --------- Signed-off-by: dbczumar <[email protected]> Co-authored-by: Corey Zumar <[email protected]> Co-authored-by: Nir Gazit <[email protected]> * feat(spend_management_endpoints.py): expose `/global/spend/refresh` endpoint for updating material view (#5730) * feat(spend_management_endpoints.py): expose `/global/spend/refresh` endpoint for updating material view Supports having `MonthlyGlobalSpend` view be a material view, and exposes an endpoint to refresh it * fix(custom_logger.py): reset calltype * fix: fix linting errors * fix: fix linting error * fix Signed-off-by: dbczumar <[email protected]> * fix: fix import * Fix Signed-off-by: dbczumar <[email protected]> * fix Signed-off-by: dbczumar <[email protected]> * DB test Signed-off-by: dbczumar <[email protected]> * Coverage Signed-off-by: dbczumar <[email protected]> * progress Signed-off-by: dbczumar <[email protected]> * fix Signed-off-by: dbczumar <[email protected]> * fix Signed-off-by: dbczumar <[email protected]> * fix Signed-off-by: dbczumar <[email protected]> * fix test name Signed-off-by: dbczumar <[email protected]> --------- Signed-off-by: dbczumar <[email protected]> Co-authored-by: Krish Dholakia <[email protected]> Co-authored-by: Nir Gazit <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Title
Relevant issues
Fixes #4570
Closes #5739
Fixes #5755
Fixes #5763
Fixes #5762
Type
🆕 New Feature
🐛 Bug Fix
🧹 Refactoring
📖 Documentation
🚄 Infrastructure
✅ Test
Changes
[REQUIRED] Testing - Attach a screenshot of any new tests passing locall
If UI changes, send a screenshot/GIF of working UI fixes