Skip to content

Do not cache fully empty completion responses or those with empty contents#465

Draft
caufieldjh wants to merge 2 commits into
mainfrom
455-do-not-cache-fully-empty-responses
Draft

Do not cache fully empty completion responses or those with empty contents#465
caufieldjh wants to merge 2 commits into
mainfrom
455-do-not-cache-fully-empty-responses

Conversation

@caufieldjh
Copy link
Copy Markdown
Member

Caching empty responses can be an issue when we're running numerous documents.
This adds two cases where an error may be raised after prompt completion:

  • Fully empty response
  • Slot only, like result:

@caufieldjh caufieldjh linked an issue Oct 25, 2024 that may be closed by this pull request
@caufieldjh
Copy link
Copy Markdown
Member Author

Need a newer litellm version to be able to do more cache manipulation - see https://github.com/BerriAI/litellm/blob/81157aa13593a02e8d34ec1ef47a777f347a5b68/litellm/caching/caching.py#L722C15-L722C32

@caufieldjh caufieldjh changed the title Do not catch fully empty completion responses or those with empty contents Do not cache fully empty completion responses or those with empty contents Oct 25, 2024
@caufieldjh
Copy link
Copy Markdown
Member Author

This is being actively changed in litellm so I'm actually going to hold off on further updates to this PR
https://github.com/BerriAI/litellm/blame/main/litellm/caching/disk_cache.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Do not cache fully empty responses

1 participant