Streaming slows down as responses get longer #24
Labels
No labels
needs/docs
needs/research
needs/upstream
type/bug
type/external
type/feature
type/refactor
urgency
high
urgency
immediate
urgency
low
urgency
medium
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
ScottyLabs/cmugpt-agent#24
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Every piece of text the model streams goes through a safety check for prompt leaks and secrets before it's sent on. That check re-reads the whole response so far each time, so it gets slower with every chunk, from a fraction of a millisecond at the start to about 5 ms per chunk once the answer is a few thousand characters long. It also runs in a way that holds up every other request on the same server while it works.
We want long responses to stream just as smoothly at the end as at the start, and one long response shouldn't slow anyone else down. The leak and secret protection should stay.