-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Add bedrock latency optimized inference support + Vertex AI Multimodal embedding cost tracking #9623
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
Conversation
…on bedrock Closes #7606
… getter for params which are separate config blocks
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
…embedding calls Enables cost calculation for multimodal embeddings
…calls ensures accurate cost tracking for vertexai multimodal embedding calls
return Usage(**usage_obj.model_dump()) | ||
else: | ||
verbose_logger.debug( | ||
f"Unknown usage object type: {type(usage_obj)}, usage_obj: {usage_obj}" |
Check failure
Code scanning / CodeQL
Clear-text logging of sensitive information High
sensitive data (password)
This expression logs
sensitive data (password)
This expression logs sensitive data (password) as clear text.
This expression logs sensitive data (password) as clear text.
This expression logs sensitive data (password) as clear text.
This expression logs sensitive data (password) as clear text.
This expression logs sensitive data (password) as clear text.
This expression logs sensitive data (password) as clear text.
This expression logs sensitive data (password) as clear text.
This expression logs sensitive data (password) as clear text.
This expression logs sensitive data (password) as clear text.
This expression logs sensitive data (password) as clear text.
This expression logs sensitive data (secret) as clear text.
This expression logs sensitive data (password) as clear text.
This expression logs sensitive data (password) as clear text.
This expression logs sensitive data (password) as clear text.
This expression logs sensitive data (password) as clear text.
This expression logs sensitive data (password) as clear text.
This expression logs sensitive data (password) as clear text.
This expression logs sensitive data (password) as clear text.
This expression logs sensitive data (password) as clear text.
This expression logs sensitive data (password) as clear text.
This expression logs sensitive data (password) as clear text.
This expression logs sensitive data (password) as clear text.
This expression logs sensitive data (password) as clear text.
This expression logs sensitive data (password) as clear text.
This expression logs sensitive data (password) as clear text.
This expression logs sensitive data (password) as clear text.
This expression logs sensitive data (password) as clear text.
This expression logs sensitive data (password) as clear text.
This expression logs sensitive data (password) as clear text.
This expression logs sensitive data (password) as clear text.
This expression logs sensitive data (password) as clear text.
This expression logs sensitive data (password) as clear text.
This expression logs sensitive data (password) as clear text.
This expression logs sensitive data (password) as clear text.
This expression logs sensitive data (password) as clear text.
This expression logs sensitive data (password) as clear text.
This expression logs sensitive data (password) as clear text.
This expression logs sensitive data (password) as clear text.
This expression logs sensitive data (password) as clear text.
This expression logs sensitive data (password) as clear text.
This expression logs sensitive data (password) as clear text.
This expression logs sensitive data (password) as clear text.
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 6 months ago
To fix the problem, we need to ensure that sensitive information is not logged in clear text. The best way to fix this without changing existing functionality is to redact or mask the sensitive information before logging it. Specifically, we should modify the logging statement on line 492 in litellm/cost_calculator.py
to exclude or mask the sensitive data.
-
Copy modified line R491 -
Copy modified line R493
@@ -490,4 +490,5 @@ | ||
else: | ||
redacted_usage_obj = {k: (v if k != "client_secret" else "REDACTED") for k, v in usage_obj.items()} if isinstance(usage_obj, dict) else "REDACTED" | ||
verbose_logger.debug( | ||
f"Unknown usage object type: {type(usage_obj)}, usage_obj: {usage_obj}" | ||
f"Unknown usage object type: {type(usage_obj)}, usage_obj: {redacted_usage_obj}" | ||
) |
…+image+video input
Codecov ReportAttention: Patch coverage is
📢 Thoughts on this report? Let us know! |
Closes #7606
fix(converse_transformation.py): refactor to use more flexible single getter for params which are separate config blocks
test(test_main.py): add e2e mock test for bedrock performance config
build(model_prices_and_context_window.json): add versioned multimodal embedding
refactor(multimodal_embeddings/): migrate to config pattern
feat(vertex_ai/multimodalembeddings): calculate usage for multimodal embedding calls
Enables cost calculation for multimodal embeddings
ensures accurate cost tracking for vertexai multimodal embedding calls
fix(embedding_handler.py): remove unused imports
fix: fix linting errors
fix: handle response api usage calculation
test(test_vertex_ai_multimodal_embedding_transformation.py): update tests
test: mark flaky test
feat(vertex_ai/multimodal_embeddings/transformation.py): support text+image+video input
docs(vertex.md): document sending text + image to vertex multimodal embeddings
test: remove incorrect file
fix(multimodal_embeddings/transformation.py): fix linting error
style: remove unused import