Commit graph

1168 commits

Author SHA1 Message Date
hxomer
b85df0b1fb
Better handle anonymization (#17207)
* Better handle anonymization

* Fix tests
2025-11-28 08:22:19 -08:00
yuneng-jiang
25e2331510 Merge remote-tracking branch 'origin' into litellm_ui_callback_fix 2025-11-27 17:29:29 -08:00
Ishaan Jaffer
01fd4d7cef fix fireworks test 2025-11-26 18:58:32 -08:00
Ishaan Jaffer
0429ca4fd0 test_package_dependencies 2025-11-22 11:20:40 -08:00
Ishaan Jaffer
1b88cfbe60 test_router_get_deployment_credentials_with_provider 2025-11-22 10:46:12 -08:00
Ishaan Jaffer
badbadba0d fix img URL for tests 2025-11-22 09:41:15 -08:00
Ishaan Jaffer
8fbf060ac5 ArizePhoenixConfig 2025-11-22 09:28:37 -08:00
Chesars
88ee7c507b refactor: Remove redundant backup file for model pricing
- Removed litellm/model_prices_and_context_window_backup.json
- Updated get_model_cost_map() to read from single source
- Refactored _load_local_model_cost_map() to support:
  * Package resources (production/pip install)
  * Project root (development)
- Updated CI/CD workflows:
  * .circleci/config.yml: Copy to litellm/ before publishing
  * .github/workflows/simple_pypi_publish.yml: Same approach
  * ci_cd/check_files_match.py: Updated file paths
- Updated test_get_model_file.py to use project root
- Renamed test_get_backup_model_cost_map → test_get_local_model_cost_map

Benefits:
- Eliminates file duplication
- Single source of truth for model pricing
- No need for PRs like #16460 to sync backup files
- Simpler maintenance

The backup was unnecessary because CI copies the file to the package before publishing.
2025-11-13 12:43:25 -03:00
yuneng-jiang
5853dbafc8
Merge branch 'main' into litellm_ui_callback_fix 2025-11-10 16:50:58 -08:00
Krish Dholakia
06906534b3
feat(audio_transcriptions/): calculate duration of audio file for cost calculation + feat (image_generations): cost tracking accuracy improved with output_format, quality, size values fixed per openai model
* feat(audio_transcriptions/): calculate duration of audio file for cost calculation

Fixes https://github.com/BerriAI/litellm/issues/11846

Closes https://github.com/BerriAI/litellm/issues/14605

* fix(cost_calculator.py): correctly use base model, when set

Fixes issue where azure base model was being ignored

* feat(cost_calculator.py): fix default cost tracking quality param for image generation

* feat(image_generations/): return output_format, quality, size

aligns response to openai spec and improves cost tracking accuracy

* fix(cost_calculator.py): refactor cost calculation for image generation to use image response instead of hidden params

* build: update build

* fix: fix cost calculation

* build: update poetry lock

* fix: fix ruff checks

* fix: fix aembedding

* fix: fix ruff errors

* fix: modify to catch errors

* fix: test

* fix: loosen test to handle openai lib out of sync

* fix: fix base models

* fix: fix usage object
2025-11-08 16:24:31 -08:00
Krish Dholakia
202eaeb1a2
Revert "(feat) Audio transcription - cost tracking + (feat) image generation …" (#16409)
This reverts commit c96da44265.
2025-11-08 15:38:16 -08:00
Krish Dholakia
c96da44265
(feat) Audio transcription - cost tracking + (feat) image generation - accurate cost tracking based on output_format/quality/size
* feat(audio_transcriptions/): calculate duration of audio file for cost calculation

Fixes https://github.com/BerriAI/litellm/issues/11846

Closes https://github.com/BerriAI/litellm/issues/14605

* fix(cost_calculator.py): correctly use base model, when set

Fixes issue where azure base model was being ignored

* feat(cost_calculator.py): fix default cost tracking quality param for image generation

* feat(image_generations/): return output_format, quality, size

aligns response to openai spec and improves cost tracking accuracy

* fix(cost_calculator.py): refactor cost calculation for image generation to use image response instead of hidden params

* build: update build

* fix: fix cost calculation

* build: update poetry lock

* fix: fix ruff checks

* fix: fix aembedding

* fix: fix ruff errors

* fix: modify to catch errors

* fix: test

* fix: loosen test to handle openai lib out of sync
2025-11-08 15:30:46 -08:00
yuneng-jiang
3a96c700b4 Adjusted based on comments 2025-11-07 15:02:41 -08:00
Ishaan Jaff
bd7d653bae
Revert "Update perplexity cost tracking (#15743)" (#16345)
This reverts commit ad6a0f4d44.
2025-11-06 19:00:45 -08:00
Aliaksandr Kuzmik
d14a637b16
OpikLogger: fix the bug with not incorrect attachment to existing trace & refactor (#15529)
* Fix bug, add new unit test

* Extract payload builder code to a separate namespace

* Update opik.py to use logic from the new namespace

* Code cleanup, type hints improvements

* Run linter

* Log model name as span field

* Reformat arguments in payload builders

* Use dataclasses for payloads, use opik native client if it's available

* Add cost and provider

* Add provider mapping
2025-11-05 16:29:50 -08:00
Sameer Kankute
ad6a0f4d44
Update perplexity cost tracking (#15743)
* Update perplexity cost tracking

* fix lint errors

* fix code

* fix tests in perplexity

* fix test realted to api call

* fix exception test
2025-11-03 08:45:34 -08:00
Krish Dholakia
74ae7aed44
build: Squashed commit of the following: (#16176)
commit bb0b050fb0
Author: Krrish Dholakia <krrishdholakia@gmail.com>
Date:   Sat Nov 1 20:00:01 2025 -0700

    test: update tests

commit b2da4bdac2
Author: Krrish Dholakia <krrishdholakia@gmail.com>
Date:   Wed Oct 22 14:58:01 2025 -0700

    fix(langfuse_otel_attributes.py): log tools and other optional params

commit 75bee1f274
Author: Krrish Dholakia <krrishdholakia@gmail.com>
Date:   Wed Oct 22 14:42:05 2025 -0700

    feat(langfuse_otel/): working request/response logging on spans

    Closes https://github.com/BerriAI/litellm/issues/13764

commit a3e4fa5b81
Author: Krrish Dholakia <krrishdholakia@gmail.com>
Date:   Wed Oct 22 14:20:39 2025 -0700

    fix: initial commit fixing langfuse request/response logging with OTEL

commit 09fc9deac8
Author: Krrish Dholakia <krrishdholakia@gmail.com>
Date:   Wed Oct 22 13:33:52 2025 -0700

    fix(litellm_logging.py): for responses api - return a unified usage object for logging

    ensures logging integrations all pull the right usage information
2025-11-02 09:46:40 -08:00
Ishaan Jaffer
3c0d530197 test_async_vertexai_response_basic 2025-11-01 10:58:48 -07:00
Ishaan Jaffer
a188e5f8e4 test_litellm_anthropic_prompt_caching_system 2025-11-01 10:51:15 -07:00
Ishaan Jaffer
2608d37e8e test prompt caching ant 2025-11-01 10:36:22 -07:00
Ishaan Jaffer
b41ad66e38 ant test prompt caching 2025-11-01 10:09:01 -07:00
Ishaan Jaffer
bf934c0799 test_anthropic_api_prompt_caching_basic_with_cache_creation 2025-11-01 09:21:42 -07:00
Ishaan Jaffer
2f1e947c44 test_anthropic_api_prompt_caching_basic 2025-10-31 19:32:46 -07:00
Ishaan Jaffer
c918dafb32 test_router_fallbacks_with_custom_model_costs 2025-10-31 19:23:08 -07:00
Ishaan Jaffer
6e46824939 test_streaming_response 2025-10-31 19:10:38 -07:00
Ishaan Jaffer
7f79abb552 test_aastreaming_tool_calls_valid_json_str 2025-10-31 19:05:31 -07:00
Ishaan Jaffer
22eb2f8033 Revert "Python entry-point for CustomLLM subclasses (#15881)"
This reverts commit 559ae96e38.
2025-10-31 18:24:39 -07:00
Ishaan Jaffer
94c2c28f3d claude-sonnet-4-5-20250929 fix 2025-10-31 18:20:52 -07:00
Ishaan Jaffer
159db27d5c fix test claude-sonnet-4-5-20250929 2025-10-31 18:13:29 -07:00
Ishaan Jaff
99feefd614
[Feat] Add FAL AI Image Generations on LiteLLM (#16067)
* add fal-ai provider

* fix image_generation_handler

* init FalAIImageGenerationConfig

* init cost_calculator

* init FAL AI

* TestFAL_AI_ImageGeneration

* fix load_custom_provider_entrypoints

* TestFAL_AI_ImageGeneration

* add imagen4 transform FAL AI

* add FAL AI imagen 4 transform

* BaseImageGenTest

* test_fal_ai_image_generation_basic

* add BRIA + Recraft img gen

* add recraft + BRIA

* test_fal_ai_image_generation_basic

* tests for flux PRO v11

* Add FAL AI SD

* test FAL AI SD

* docs FAL AI

* docs fal ai

* Using Model-Specific Parameters

* add fal ai model prices

* add fall_ai JPG logo

* ui fixes FAL AI

* fix linting

* fix linting

* fix bedrock test_get_request_body_stability3

* test_custom_llm_provider_entrypoint
2025-10-29 13:10:51 -07:00
Albert DeFusco
559ae96e38
Python entry-point for CustomLLM subclasses (#15881)
* load entrypoints

* mock loading entry-point in pyproject.toml

* simpler group name

* create CustomLLM subclass instance after load
2025-10-28 19:39:14 -07:00
Ishaan Jaffer
33371d18f4 test fix claude-sonnet-4-5-20250929 2025-10-28 19:05:13 -07:00
Ishaan Jaffer
1b49dba1dd fix claude-sonnet-4-5 2025-10-28 17:37:08 -07:00
Ishaan Jaffer
a3d64fb843 fix omni-moderation-latest 2025-10-27 17:48:35 -07:00
Ishaan Jaffer
1acc321eb3 test_router_amoderation 2025-10-27 13:50:32 -07:00
Ishaan Jaffer
bbfddd00e4 test fix 2025-10-25 16:46:29 -07:00
Ishaan Jaffer
a9c7fbbb60 test_router_init 2025-10-25 15:14:18 -07:00
Ishaan Jaffer
679374fe79 test_img_gen_on_router 2025-10-25 15:11:52 -07:00
Ishaan Jaffer
ab0fc0a30d test_aimg_gen_on_router 2025-10-25 15:11:21 -07:00
Ishaan Jaffer
20d8345a7c test: fixes because azure deactivated our account 2025-10-25 15:10:45 -07:00
Ishaan Jaffer
e878f2b1ef test_router_get_available_deployments 2025-10-25 15:09:08 -07:00
Ishaan Jaffer
5cca4c8b4f test_image_generation_openai 2025-10-25 14:57:40 -07:00
Ishaan Jaffer
2c52791b83 test_model_function_invoke 2025-10-25 14:56:12 -07:00
Ishaan Jaffer
964e683c85 test_databricks_anthropic_function_call_with_no_schema 2025-10-25 12:29:15 -07:00
Ishaan Jaffer
0bf3d1f226 test_aaaaazure_tenant_id_auth 2025-10-25 12:26:06 -07:00
Ishaan Jaffer
e6b61213ca test_completion_azure_deployment_id 2025-10-25 12:26:06 -07:00
Ishaan Jaffer
762053a8e9 test_model_function_invoke 2025-10-25 12:26:06 -07:00
Ishaan Jaffer
6350c20d9f test_azure_streaming_and_function_calling 2025-10-25 12:19:26 -07:00
Ishaan Jaffer
cff70ece5a test_azure_astreaming_and_function_calling 2025-10-25 12:18:53 -07:00
Ishaan Jaffer
214c10f6ef test_completion_cost_databricks_embedding 2025-10-25 11:47:03 -07:00