Skip to content

fix: stream package files instead of reading them into memory#99

Open
grische wants to merge 1 commit into
mainfrom
fix/server-stream-files
Open

fix: stream package files instead of reading them into memory#99
grische wants to merge 1 commit into
mainfrom
fix/server-stream-files

Conversation

@grische

@grische grische commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

The server read every requested artifact fully into memory via path.read_bytes() before writing it to the client. With multi-gigabyte distributions (e.g. torch or CUDA wheels) and the threading server, concurrent downloads could easily exhaust memory. Stream the file to the client in chunks and send a Content-Length header so clients can show download progress.

The server read every requested artifact fully into memory via
path.read_bytes() before writing it to the client. With multi-gigabyte
distributions (e.g. torch or CUDA wheels) and the threading server,
concurrent downloads could easily exhaust memory. Stream the file to
the client in chunks and send a Content-Length header so clients can
show download progress.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@grische
grische requested a review from shamilbi July 10, 2026 10:33
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.

1 participant