Skip to content

feat: support guardrail config option streamProcessingMode#12815

Open
dlew wants to merge 1 commit intodanny-avila:devfrom
newjersey:dlew/guardrail-stream-processing-mode
Open

feat: support guardrail config option streamProcessingMode#12815
dlew wants to merge 1 commit intodanny-avila:devfrom
newjersey:dlew/guardrail-stream-processing-mode

Conversation

@dlew
Copy link
Copy Markdown
Contributor

@dlew dlew commented Apr 24, 2026

Summary

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).

Related documentation change here: LibreChat-AI/librechat.ai#564

Change Type

Testing

I added streamProcessingMode to an existing test to make sure it's processed by the guardrail configuration code.

I also verified that setting it to async in my librechat.yaml would result in a faster streaming response from Bedrock.

Checklist

Please delete any irrelevant options.

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • I have made pertinent documentation changes
  • My changes do not introduce new warnings
  • I have written tests demonstrating that my changes are effective or that my feature works
  • Local unit tests pass with my changes
  • A pull request for updating the documentation has been submitted (here: Added documentation for guardrail config's streamProcessingMode LibreChat-AI/librechat.ai#564)

`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).
@dlew dlew force-pushed the dlew/guardrail-stream-processing-mode branch from 6193d0d to 9182d9e Compare April 29, 2026 16:21
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