🚧 feat: Support Guardrail Config Option streamProcessingMode#12815
Merged
danny-avila merged 1 commit intoMay 13, 2026
Merged
Conversation
6193d0d to
9182d9e
Compare
9182d9e to
4ce64d8
Compare
`streamProcessingMode` affects how guardrail processes the stream from the model. If it's in "sync" mode, it chunks up the response and processes them before returning them to the user. If it's in "async" mode, it both processes the chunk & sends it to the user at the same time, allowing for smoother streaming (at the cost of guardrail only reacting *after* offending content starts to stream, in some cases).
4ce64d8 to
19e6753
Compare
streamProcessingModestreamProcessingMode
Owner
|
@dlew lgtm, can we maybe make async the default behavior? seems better for most use cases |
Contributor
Author
@danny-avila The issue is that it's inherently less safe to use async, since it could (briefly) let through content that should've been blocked. So for something like content filtering, I think the default should be whatever is safest (and let people opt into a less safe mode). Though if you feel strongly about it, I'm fine setting the default the other way. |
Owner
|
fair enough, merged! |
fuuuzzy
pushed a commit
to fuuuzzy/LibreChat
that referenced
this pull request
May 15, 2026
…-avila#12815) `streamProcessingMode` affects how guardrail processes the stream from the model. If it's in "sync" mode, it chunks up the response and processes them before returning them to the user. If it's in "async" mode, it both processes the chunk & sends it to the user at the same time, allowing for smoother streaming (at the cost of guardrail only reacting *after* offending content starts to stream, in some cases).
patricia2510
pushed a commit
to lexaeon-org/libre-chat
that referenced
this pull request
May 21, 2026
…-avila#12815) `streamProcessingMode` affects how guardrail processes the stream from the model. If it's in "sync" mode, it chunks up the response and processes them before returning them to the user. If it's in "async" mode, it both processes the chunk & sends it to the user at the same time, allowing for smoother streaming (at the cost of guardrail only reacting *after* offending content starts to stream, in some cases).
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
streamProcessingModeaffects how guardrail processes the stream from the model. If it's in "sync" mode, it chunks up the response and processes them before returning them to the user. If it's in "async" mode, it both processes the chunk & sends it to the user at the same time, allowing for smoother streaming (at the cost of guardrail only reacting after offending content starts to stream, in some cases).Related documentation change here: LibreChat-AI/librechat.ai#564
Change Type
streamProcessingModeLibreChat-AI/librechat.ai#564)Testing
I added
streamProcessingModeto an existing test to make sure it's processed by the guardrail configuration code.I also verified that setting it to
asyncin my librechat.yaml would result in a faster streaming response from Bedrock.Checklist
Please delete any irrelevant options.
streamProcessingModeLibreChat-AI/librechat.ai#564)