Allow configuration to set threshold before request entry in spend log gets truncated - #14042
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Wilson Britten seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
ishaan-jaff
left a comment
There was a problem hiding this comment.
suggested using constants instead of litellm_settings
| """ | ||
| from litellm.constants import LITELLM_TRUNCATED_PAYLOAD_FIELD | ||
|
|
||
| MAX_STRING_LENGTH = 1000 |
There was a problem hiding this comment.
instead - can you just make MAX_STRING_LENGTH a constant in constants.py and control it through a .env
that feels cleaner
you can call it something like MAX_STRING_LENGTH_PROMPT_IN_DB
There was a problem hiding this comment.
Sure thing. I'll note the big trade-off is control over the max limit size in the db with the current approach, while with this you could end up ~20x larger than what you configure if you have many large sub-prompts in your request. Still for the purposes I'm trying to unblock that works great.
There was a problem hiding this comment.
Done and looking good!
…quest content in db" This reverts commit 771052d.
|
can you please document this parameter in |
@krrishdholakia I have submitted another MR for this here: #14079 |
|
Thanks for working on that guys! Do you have an idea of when this will be released? |
…cation-threshold Allow configuration to set threshold before request entry in spend log gets truncated
Title
Relevant issues
Fixes #10988
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
tests/litellm/directory, Adding at least 1 test is a hard requirement - see detailsmake test-unitType
🆕 New Feature
Changes
Added a new litellm param of 'max_request_size_before_trunc` for number of characters in a request message before going through the normal truncation process
Tests passing