Commit graph

100 commits

Author SHA1 Message Date
Krish Dholakia
f7e896bdc5 Add pyright to ci/cd + Fix remaining type-checking errors (#6082)
* fix: fix type-checking errors

* fix: fix additional type-checking errors

* fix: additional type-checking error fixes

* fix: fix additional type-checking errors

* fix: additional type-check fixes

* fix: fix all type-checking errors + add pyright to ci/cd

* fix: fix incorrect import

* ci(config.yml): use mypy on ci/cd

* fix: fix type-checking errors in utils.py

* fix: fix all type-checking errors on main.py

* fix: fix mypy linting errors

* fix(anthropic/cost_calculator.py): fix linting errors

* fix: fix mypy linting errors

* fix: fix linting errors
2024-10-05 17:04:00 -04:00
Ishaan Jaff
58682be62c (feat) openai prompt caching (non streaming) - add prompt_tokens_details in usage response (#6039)
* add prompt_tokens_details in usage response

* use _prompt_tokens_details as a param in Usage

* fix linting errors

* fix type error

* fix ci/cd deps

* bump deps for openai

* bump deps openai

* fix llm translation testing

* fix llm translation embedding
2024-10-03 23:31:10 +05:30
Krish Dholakia
94a05ca5d0 Litellm ruff linting enforcement (#5992)
* ci(config.yml): add a 'check_code_quality' step

Addresses https://github.com/BerriAI/litellm/issues/5991

* ci(config.yml): check why circle ci doesn't pick up this test

* ci(config.yml): fix to run 'check_code_quality' tests

* fix(__init__.py): fix unprotected import

* fix(__init__.py): don't remove unused imports

* build(ruff.toml): update ruff.toml to ignore unused imports

* fix: fix: ruff + pyright - fix linting + type-checking errors

* fix: fix linting errors

* fix(lago.py): fix module init error

* fix: fix linting errors

* ci(config.yml): cd into correct dir for checks

* fix(proxy_server.py): fix linting error

* fix(utils.py): fix bare except

causes ruff linting errors

* fix: ruff - fix remaining linting errors

* fix(clickhouse.py): use standard logging object

* fix(__init__.py): fix unprotected import

* fix: ruff - fix linting errors

* fix: fix linting errors

* ci(config.yml): cleanup code qa step (formatting handled in local_testing)

* fix(_health_endpoints.py): fix ruff linting errors

* ci(config.yml): just use ruff in check_code_quality pipeline for now

* build(custom_guardrail.py): include missing file

* style(embedding_handler.py): fix ruff check
2024-10-01 19:44:20 -04:00
Ishaan Jaff
c93364ab2e [Feat] Add max_completion_tokens param (#5691)
* add max_completion_tokens

* add max_completion_tokens

* add max_completion_tokens support for OpenAI models

* add max_completion_tokens param

* add max_completion_tokens for bedrock converse models

* add test for converse maxTokens

* fix openai o1 param mapping test

* move test optional params

* add max_completion_tokens for anthropic api

* fix conftest

* add max_completion tokens for vertex ai partner models

* add max_completion_tokens for fireworks ai

* add max_completion_tokens for hf rest api

* add test for param mapping

* add param mapping for vertex, gemini + testing

* predibase is the most unstable and unusable llm api in prod, can't handle our ci/cd

* add max_completion_tokens to openai supported params

* fix fireworks ai param mapping
2024-09-14 14:57:01 -07:00
Krrish Dholakia
5a2e54c44d fix(huggingface_restapi.py): fix tests 2024-08-23 21:40:27 -07:00
Krish Dholakia
6592de3ef9 Merge pull request #5292 from OgnjenFrancuski/main
Update SSL verification
2024-08-23 20:42:35 -07:00
Krrish Dholakia
2f69e254aa fix(factory.py): support 'add_generation_prompt' field for hf chat templates
Fixes https://github.com/BerriAI/litellm/pull/5178#issuecomment-2306362008
2024-08-23 08:06:21 -07:00
Ognjen Francuski
fe64805545 Update Huggingface provider to utilize the SSL verification through 'SSL_VERIFY' env var or 'litellm.ssl_verify'. 2024-08-20 14:55:12 +02:00
Krrish Dholakia
8637988bc0 fix(huggingface_restapi.py): support passing 'wait_for_model' param on completion calls 2024-08-09 09:25:19 -07:00
Krrish Dholakia
cac91dcae4 fix(huggingface_restapi.py): fix hf embeddings optional param processing 2024-08-09 09:10:56 -07:00
Krrish Dholakia
d382de7b74 fix(huggingface_restapi.py): fixes issue where 'wait_for_model' was not being passed as expected 2024-08-09 08:36:35 -07:00
Krrish Dholakia
cef1298d9d fix(huggingface_restapi.py): fix linting errors 2024-07-30 14:33:08 -07:00
Krrish Dholakia
17ac0f0636 feat(huggingface_restapi.py): Support multiple hf embedding types + async hf embeddings
Closes https://github.com/BerriAI/litellm/issues/3261
2024-07-30 13:32:03 -07:00
Krrish Dholakia
c69193c321 fix: move to using pydantic obj for setting values 2024-07-11 13:18:36 -07:00
Krrish Dholakia
4c88e917bd fix(huggingface_restapi.py): fix task extraction from model name 2024-05-15 07:28:19 -07:00
Krrish Dholakia
1b5a9a5c80 docs(huggingface.md): add text-classification to huggingface docs 2024-05-10 14:39:14 -07:00
Krrish Dholakia
4680f4e1db test(test_completion.py): reintegrate testing for huggingface tgi + non-tgi 2024-05-10 14:07:01 -07:00
Krrish Dholakia
ef72f25ab6 fix: fix linting errors 2024-05-09 17:55:27 -07:00
Krrish Dholakia
f660d21743 feat(predibase.py): add support for predibase provider
Closes https://github.com/BerriAI/litellm/issues/1253
2024-05-09 16:39:43 -07:00
Krrish Dholakia
f7c2f8313c fix(huggingface_restapi.py): fix hf streaming issue 2024-03-04 21:16:41 -08:00
Krrish Dholakia
a1ce24c5f0 fix(huggingface_restapi.py): fix huggingface streaming error raising 2024-03-04 09:32:41 -08:00
Krrish Dholakia
ed72005f52 fix(huggingface_restapi.py): return initial hf error 2024-02-24 10:46:59 -08:00
Krrish Dholakia
9c2cce56f7 fix(huggingface_restapi.py): return streamed response correctly 2024-02-16 13:25:13 -08:00
Krrish Dholakia
e5a444f69a fix(huggingface_restapi.py): fix hf streaming to raise exceptions 2024-02-15 21:25:12 -08:00
Krrish Dholakia
e4a5a3395c fix(huggingface_restapi.py): support timeouts for huggingface + openai text completions
https://github.com/BerriAI/litellm/issues/1334
2024-01-08 11:40:56 +05:30
Krrish Dholakia
79978c44ba refactor: add black formatting 2023-12-25 14:11:20 +05:30
ishaan-jaff
7a1e8b4bf3 (feat) show POST request for HF embeddings 2023-12-16 13:09:49 +05:30
Krrish Dholakia
726289cb49 fix(huggingface_restapi.py): add support for additional hf embedding formats 2023-12-15 21:02:41 -08:00
Krrish Dholakia
9ca06e2827 fix(huggingface_restapi.py): raise better exceptions for unprocessable hf responses 2023-12-05 07:28:21 -08:00
Ori Kotek
cc5dbbf53f Do not timeout when calling HF through acomplete 2023-11-23 15:56:59 +02:00
Krrish Dholakia
aad17a5479 fix(huggingface_restapi.pyu): fix linting errors 2023-11-21 10:05:35 -08:00
Krrish Dholakia
53d71c229f fix(huggingface_restapi.py): fixing formatting 2023-11-21 09:57:26 -08:00
Krrish Dholakia
c48e775908 fix(huggingface_restapi.py): fix huggingface response format 2023-11-21 09:57:26 -08:00
Krrish Dholakia
c425fb7eeb fix(huggingface_restapi.py): handle generate text output 2023-11-21 09:57:26 -08:00
ishaan-jaff
7bc28f3b1c (fix) pydantic errors with response.time 2023-11-20 18:28:19 -08:00
Krrish Dholakia
e28b9534e4 fix(huggingface_restapi.py): async implementation 2023-11-15 16:54:15 -08:00
Krrish Dholakia
b42cf80585 fix(utils): fixing exception mapping 2023-11-15 15:51:17 -08:00
Krrish Dholakia
6d1b8945dd fix(huggingface_restapi.py): fix linting errors 2023-11-15 15:34:21 -08:00
Krrish Dholakia
e35ce15a89 refactor(huggingface_restapi.py): moving async completion + streaming to real async calls 2023-11-15 15:14:21 -08:00
ishaan-jaff
84e931ce0f (feat) completion debug view HF POST request 2023-11-14 17:57:41 -08:00
Krrish Dholakia
4b74ddcb17 refactor: fixing linting issues 2023-11-11 18:52:28 -08:00
Krrish Dholakia
5efa3860da refactor(huggingface,-anthropic,-replicate,-sagemaker): making huggingface, anthropic, replicate, sagemaker compatible openai v1 sdk 2023-11-11 17:38:15 -08:00
Krrish Dholakia
7b4e21e574 refactor(bedrock.py-+-cohere.py): making bedrock and cohere compatible with openai v1 sdk 2023-11-11 17:33:19 -08:00
ishaan-jaff
edccfbb1da (fix) remove errant print from hf 2023-11-08 11:49:15 -08:00
ishaan-jaff
e7b6ef8f50 (fix) hf don't fail when logprob is None 2023-11-06 14:22:09 -08:00
Krrish Dholakia
9baafd7dbf fix(huggingface_restapi.py): output parsing chat template models 2023-11-06 11:43:12 -08:00
Krrish Dholakia
d53a0d9663 refactor(bedrock.py): better exception mapping for bedrock + huggingface 2023-11-04 16:12:12 -07:00
Krrish Dholakia
b1dcd0f1b9 fix(timeout.py): import errors 2023-11-04 16:05:14 -07:00
Krrish Dholakia
f7c5595a0d fix(main.py): fixing print_verbose 2023-11-04 14:41:34 -07:00
ishaan-jaff
d278417682 (fix) hf calculating usage non blocking 2023-11-03 18:03:19 -07:00