Repository navigation
Add file content streaming support for OpenAI and related utilities #25450
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
13 commits merged into
BerriAI:litellm_harish_april11
from
harish876:oom-file-fix-openai
Apr 11, 2026
Merged
Changes from 12 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
7ebc144
Add file content streaming support for OpenAI and related utilities
harish876 1310803
remove conftest patch. TODO: make a different PR for this
harish876 af4d4ab
Introduced Content-Length response headers into the streaming respons…
harish876 044d434
remove unused iterator imports
harish876 baba3eb
Refactor file content streaming implementation
harish876 1c74e17
E2E test to assert response headers from the openai files change
harish876 ccf3dc3
Code Comments incorporated.
harish876 4e5e739
resolve dependency cycle
harish876 d1dda3d
Enhance file content streaming handler to support custom LLM provider…
harish876 c5d93e6
Enhance error handling in FileContentStreamingHandler for custom LLM …
harish876 68bc6de
resolving dependency issues
harish876 f523ccb
Update import paths in tests for StorageBackendFileService
harish876 69eb345
Refactor file content streaming handling to improve routing and support
harish876 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this feels like a lot of duplicate code. Why can't we just add a stream=True/False on def file_content ?
That way you don't need this new function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Counterpoint here. I think keeping file_content_streaming() separate is the cleaner choice because this is not just a stream=True transport toggle on the existing API. The streaming path returns a different shape, carries headers alongside an iterator, and has iterator-specific logging and cleanup behavior like aclose() on disconnect. Keeping it separate preserves the existing file_content() contract, makes the rollout to other providers incremental, and keeps the streaming-specific behavior isolated and easier to test. The original function code can be removed once we migrate all paths to a streaming one.