* add helper functions
* update generic_cost_per_token function
* add test
* formatting
* add examples in docstring for _calculate_tiered_cost
* Restore files to upstream/main version
* dashscope specific calculation
* improve for different costs
* remove _calculate_flat_cost function
* fix(anthropic-adapter): properly translate Anthropic image format to OpenAI
Fixed bug where images were stripped during Anthropic Messages API to Azure
OpenAI translation. Image source data was being stringified instead of having
fields properly extracted.
- Added _translate_anthropic_image_to_openai() helper method
- Support both base64 and URL image formats per Anthropic API spec
- Refactored user message and tool result image handling
* test(anthropic-adapter): add comprehensive image translation tests
Add 5 unit tests covering image translation from Anthropic to OpenAI format:
- User messages with base64 images
- User messages with URL images
- Tool results with base64 images
- Tool results with URL images
- Mixed content with multiple images
* Add v1 cut of container api
* fix lint errors
* Add proxy support to container apis & logging support (#16049)
* Add proxy support to container apis
* Add logging support
* Add cost tracking support for containers and documentation
* Add new constant documentation
* Add container cost in model map
* fix failing azure tests
* Update tests based on model map changes
* fix model map tests
* fix model map tests
* Container modeshould be container
* Container tests fix
* Merge branch 'main' into litellm_sameer_oct_staging_2
* Add Prometheus metric to track callback logging failures in S3 (#16102)
* Add proxy support to container apis
* Add logging support
* prometheus metric measures how often s3_v2 is failing
* remove not needed files
* remove not needed files
* remove not needed files
* fix mypy errors
* Use logging_callback_manager to get all the callbacks
---------
Co-authored-by: Ishaan Jaffer <ishaanjaffer0324@gmail.com>
* feat(llm_passthrough_endpoints.py): support milvus passthrough api
* fix(llm_passthrough_endpoints.py): move streaming request value to the top of the function
* docs: document new milvus vector store passthrough flow
* feat: change guardrail_information to list type to support displaying multiple guardrails
* fix: add missing commit and revert auto-format changes in utils.py
---------
Co-authored-by: Krish Dholakia <krrishdholakia@gmail.com>
* streaming support in langfuse otel
* Added testing for Langfuse Otel tracing in the response API
---------
Co-authored-by: eycjur <eycjur@example.com>
* Add v1 cut of container api
* fix lint errors
* Add proxy support to container apis & logging support (#16049)
* Add proxy support to container apis
* Add logging support
* Add cost tracking support for containers and documentation
* Add new constant documentation
* Add container cost in model map
* fix failing azure tests
* Update tests based on model map changes
* fix model map tests
* fix model map tests
* Container modeshould be container
* Container tests fix
* Merge branch 'main' into litellm_sameer_oct_staging_2
---------
Co-authored-by: Ishaan Jaffer <ishaanjaffer0324@gmail.com>
- Access model_fields on class instead of instance to avoid deprecation warnings
- Add warning filter to suppress Pydantic instance attribute access warnings
- Fix affects streaming operations where warnings accumulate over time
- Updated cost_calculator.py, core_helpers.py, and model_response_utils.py
The previous implementation accessed model_fields on Pydantic model instances,
which triggers deprecation warnings in Pydantic 2.11+. These warnings accumulate
during streaming operations, causing memory leaks. Now accessing model_fields
via type(instance).model_fields to prevent warning generation.
* fix model error for apis which don't need model
* fix print statments:
* fix mypy lint errors
---------
Co-authored-by: Ishaan Jaff <ishaanjaffer0324@gmail.com>