Commit graph

87 commits

Author SHA1 Message Date
Marc Abramowitz
837a6948d8
Fix typo: Entrata -> Entra in code (#9922)
* Fix typo: Entrata -> Entra

* Fix a few more
2025-04-15 17:31:18 -07:00
Krish Dholakia
8faf56922c
Fix azure tenant id check from env var + response_format check on api_version 2025+ (#9993)
* fix(azure/common_utils.py): check for azure tenant id, client id, client secret in env var

Fixes https://github.com/BerriAI/litellm/issues/9598#issuecomment-2801966027

* fix(azure/gpt_transformation.py): fix passing response_format to azure when api year = 2025

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

* test: monkeypatch azure api version in test

* test: update testing

* test: fix test

* test: update test

* docs(config_settings.md): document env vars
2025-04-14 22:02:35 -07:00
Krish Dholakia
6ba3c4a4f8
VertexAI non-jsonl file storage support (#9781)
* test: add initial e2e test

* fix(vertex_ai/files): initial commit adding sync file create support

* refactor: initial commit of vertex ai non-jsonl files reaching gcp endpoint

* fix(vertex_ai/files/transformation.py): initial working commit of non-jsonl file call reaching backend endpoint

* fix(vertex_ai/files/transformation.py): working e2e non-jsonl file upload

* test: working e2e jsonl call

* test: unit testing for jsonl file creation

* fix(vertex_ai/transformation.py): reset file pointer after read

allow multiple reads on same file object

* fix: fix linting errors

* fix: fix ruff linting errors

* fix: fix import

* fix: fix linting error

* fix: fix linting error

* fix(vertex_ai/files/transformation.py): fix linting error

* test: update test

* test: update tests

* fix: fix linting errors

* fix: fix test

* fix: fix linting error
2025-04-09 14:01:48 -07:00
Krish Dholakia
6dda1ba6dd
LiteLLM Minor Fixes & Improvements (04/02/2025) (#9725)
* Add date picker to usage tab + Add reasoning_content token tracking across all providers on streaming (#9722)

* feat(new_usage.tsx): add date picker for new usage tab

allow user to look back on their usage data

* feat(anthropic/chat/transformation.py): report reasoning tokens in completion token details

allows usage tracking on how many reasoning tokens are actually being used

* feat(streaming_chunk_builder.py): return reasoning_tokens in anthropic/openai streaming response

allows tracking reasoning_token usage across providers

* Fix update team metadata + fix bulk adding models on Ui  (#9721)

* fix(handle_add_model_submit.tsx): fix bulk adding models

* fix(team_info.tsx): fix team metadata update

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

* (v0) Unified file id - allow calling multiple providers with same file id (#9718)

* feat(files_endpoints.py): initial commit adding 'target_model_names' support

allow developer to specify all the models they want to call with the file

* feat(files_endpoints.py): return unified files endpoint

* test(test_files_endpoints.py): add validation test - if invalid purpose submitted

* feat: more updates

* feat: initial working commit of unified file id translation

* fix: additional fixes

* fix(router.py): remove model replace logic in jsonl on acreate_file

enables file upload to work for chat completion requests as well

* fix(files_endpoints.py): remove whitespace around model name

* fix(azure/handler.py): return acreate_file with correct response type

* fix: fix linting errors

* test: fix mock test to run on github actions

* fix: fix ruff errors

* fix: fix file too large error

* fix(utils.py): remove redundant var

* test: modify test to work on github actions

* test: update tests

* test: more debug logs to understand ci/cd issue

* test: fix test for respx

* test: skip mock respx test

fails on ci/cd - not clear why

* fix: fix ruff check

* fix: fix test

* fix(model_connection_test.tsx): fix linting error

* test: update unit tests
2025-04-03 11:48:52 -07:00
Krish Dholakia
8ee32291e0
Squashed commit of the following: (#9709)
commit b12a9892b7
Author: Krrish Dholakia <krrishdholakia@gmail.com>
Date:   Wed Apr 2 08:09:56 2025 -0700

    fix(utils.py): don't modify openai_token_counter

commit 294de31803
Author: Krrish Dholakia <krrishdholakia@gmail.com>
Date:   Mon Mar 24 21:22:40 2025 -0700

    fix: fix linting error

commit cb6e9fbe40
Author: Krrish Dholakia <krrishdholakia@gmail.com>
Date:   Mon Mar 24 19:52:45 2025 -0700

    refactor: complete migration

commit bfc159172d
Author: Krrish Dholakia <krrishdholakia@gmail.com>
Date:   Mon Mar 24 19:09:59 2025 -0700

    refactor: refactor more constants

commit 43ffb6a558
Author: Krrish Dholakia <krrishdholakia@gmail.com>
Date:   Mon Mar 24 18:45:24 2025 -0700

    fix: test

commit 04dbe4310c
Author: Krrish Dholakia <krrishdholakia@gmail.com>
Date:   Mon Mar 24 18:28:58 2025 -0700

    refactor: refactor: move more constants into constants.py

commit 3c26284aff
Author: Krrish Dholakia <krrishdholakia@gmail.com>
Date:   Mon Mar 24 18:14:46 2025 -0700

    refactor: migrate hardcoded constants out of __init__.py

commit c11e0de69d
Author: Krrish Dholakia <krrishdholakia@gmail.com>
Date:   Mon Mar 24 18:11:21 2025 -0700

    build: migrate all constants into constants.py

commit 7882bdc787
Author: Krrish Dholakia <krrishdholakia@gmail.com>
Date:   Mon Mar 24 18:07:37 2025 -0700

    build: initial test banning hardcoded numbers in repo
2025-04-02 21:24:54 -07:00
Ishaan Jaff
acf920a41a
Merge branch 'main' into litellm_fix_azure_o_series 2025-04-02 20:58:52 -07:00
Krish Dholakia
053b0e741f
Add Google AI Studio /v1/files upload API support (#9645)
All checks were successful
Read Version from pyproject.toml / read-version (push) Successful in 16s
Helm unit test / unit-test (push) Successful in 23s
* test: fix import for test

* fix: fix bad error string

* docs: cleanup files docs

* fix(files/main.py): cleanup error string

* style: initial commit with a provider/config pattern for files api

google ai studio files api onboarding

* fix: test

* feat(gemini/files/transformation.py): support gemini files api response transformation

* fix(gemini/files/transformation.py): return file id as gemini uri

allows id to be passed in to chat completion request, just like openai

* feat(llm_http_handler.py): support async route for files api on llm_http_handler

* fix: fix linting errors

* fix: fix model info check

* fix: fix ruff errors

* fix: fix linting errors

* Revert "fix: fix linting errors"

This reverts commit 926a5a527f.

* fix: fix linting errors

* test: fix test

* test: fix tests
2025-04-02 08:56:58 -07:00
Ishaan Jaff
58b4e4b206 add AzureOpenAIO1Config for tools 2025-04-02 06:55:03 -07:00
Ishaan Jaff
9e7c67805b get_supported_openai_params 2025-04-02 06:52:07 -07:00
Krish Dholakia
9b7ebb6a7d
build(pyproject.toml): add new dev dependencies - for type checking (#9631)
* build(pyproject.toml): add new dev dependencies - for type checking

* build: reformat files to fit black

* ci: reformat to fit black

* ci(test-litellm.yml): make tests run clear

* build(pyproject.toml): add ruff

* fix: fix ruff checks

* build(mypy/): fix mypy linting errors

* fix(hashicorp_secret_manager.py): fix passing cert for tls auth

* build(mypy/): resolve all mypy errors

* test: update test

* fix: fix black formatting

* build(pre-commit-config.yaml): use poetry run black

* fix(proxy_server.py): fix linting error

* fix: fix ruff safe representation error
2025-03-29 11:02:13 -07:00
Krrish Dholakia
fe24b9d90b feat(azure/gpt_transformation.py): add azure audio model support
Closes https://github.com/BerriAI/litellm/issues/6305
2025-03-19 22:57:49 -07:00
Ishaan Jaff
65083ca8da get_openai_client_cache_key 2025-03-18 18:35:50 -07:00
Ishaan Jaff
f73e9047dc use common logic for re-using openai clients 2025-03-18 17:56:32 -07:00
Ishaan Jaff
55ea2370ba Union[TranscriptionResponse, Coroutine[Any, Any, TranscriptionResponse]]: 2025-03-18 14:23:14 -07:00
Ishaan Jaff
b20a69f9fc fix code quality 2025-03-18 12:58:59 -07:00
Ishaan Jaff
dc3d7b3afc test_azure_instruct 2025-03-18 12:56:11 -07:00
Ishaan Jaff
2cd49ef096 fix test_ensure_initialize_azure_sdk_client_always_used 2025-03-18 12:46:55 -07:00
Ishaan Jaff
b60178f534 fix azure chat logic 2025-03-18 12:42:24 -07:00
Ishaan Jaff
80a5cfa01d test_azure_embedding_max_retries_0 2025-03-18 12:35:34 -07:00
Ishaan Jaff
d4b3082ca2 fix azure embedding test 2025-03-18 12:19:12 -07:00
Ishaan Jaff
38e2dd00cc fix amebedding issue on ssl azure 2025-03-18 11:42:11 -07:00
Ishaan Jaff
dfd7a7d547 fix linting error 2025-03-18 11:38:31 -07:00
Ishaan Jaff
3458c69eb0 fix common utils 2025-03-18 11:04:02 -07:00
Ishaan Jaff
c1e0cb136e fix using azure openai clients 2025-03-18 10:47:29 -07:00
Ishaan Jaff
e34be5a3b6 use get_azure_openai_client 2025-03-18 10:28:39 -07:00
Ishaan Jaff
a0c5fb81b8 fix logic for intializing openai clients 2025-03-18 10:23:30 -07:00
Ishaan Jaff
0601768bb8 use ssl on initialize_azure_sdk_client 2025-03-18 10:14:51 -07:00
Ishaan Jaff
34142a1b62 _init_azure_client_for_cloudflare_ai_gateway 2025-03-18 10:11:54 -07:00
Ishaan Jaff
edfbf21c39 fix re-using azure openai client 2025-03-18 10:06:56 -07:00
Ishaan Jaff
f2026ef907 fix - correctly re-use azure openai client 2025-03-18 09:51:28 -07:00
Ishaan Jaff
b74f3cb76c _get_azure_openai_client 2025-03-18 09:38:27 -07:00
Ishaan Jaff
26be805ad3 rename to _get_azure_openai_client 2025-03-18 09:25:26 -07:00
Krrish Dholakia
5ffd3f56f8 fix(azure.py): track azure llm api latency metric 2025-03-13 14:47:35 -07:00
Krish Dholakia
2d957a0ed9
Merge branch 'main' into litellm_dev_03_10_2025_p3 2025-03-12 14:56:01 -07:00
Ishaan Jaff
39d391d8e7 Optional[Dict] 2025-03-12 12:29:13 -07:00
Krrish Dholakia
b8d590da0c fix(azure/audio_transcriptions.py): support azure cost tracking
extract content time and log correctly as duration
2025-03-11 22:25:13 -07:00
Krrish Dholakia
571d5ed62a fix(audio_transcriptions.py): fix setting client 2025-03-11 21:48:10 -07:00
Krrish Dholakia
16224f8db6 fix(o_series_handler.py): handle async calls 2025-03-11 21:22:13 -07:00
Krrish Dholakia
9351b45d0c fix: fix linting errors 2025-03-11 18:49:55 -07:00
Krrish Dholakia
145cd483b9 fix(handler.py): same as last commit 2025-03-11 18:48:12 -07:00
Krrish Dholakia
2469072c50 fix: remove unused imports 2025-03-11 18:15:10 -07:00
Krrish Dholakia
9b588f53f5 fix: fix linting error 2025-03-11 18:08:01 -07:00
Krrish Dholakia
58888f117c feat(azure.py): fix azure client init 2025-03-11 18:05:11 -07:00
Krrish Dholakia
3bc7c35cb5 fix: consistent usage of http_client across azure client init 2025-03-11 17:48:31 -07:00
Krrish Dholakia
9af73f339a test: fix tests 2025-03-11 17:42:36 -07:00
Krrish Dholakia
cbc2e84044 refactor(azure.py): refactor to have client init work across all endpoints 2025-03-11 17:27:24 -07:00
Krrish Dholakia
d99d60a182 refactor(batches/main.py): working refactored azure client init on batches 2025-03-11 14:36:38 -07:00
Krrish Dholakia
af71e14d79 refactor(azure/audio_transcriptions.py): support client init with common logic 2025-03-11 14:24:12 -07:00
Krrish Dholakia
2c2404dac9 refactor(azure.py): working client init logic in azure image generation 2025-03-11 14:22:25 -07:00
Krrish Dholakia
152bc67d22 refactor(azure.py): working azure client init on audio speech endpoint 2025-03-11 14:19:45 -07:00