All Questions
Guardrails And Safety easy

You stream LLM responses to the browser over SSE and must add a safety classifier on the output. Product wants the first token to appear quickly. Which approach best balances safety and latency?

  1. A Run the classifier only on the user's input, since output checks would add too much latency.
  2. B Classify the stream in small buffered chunks, accepting tens to hundreds of ms of added delay.
  3. C Stream tokens unfiltered and run the classifier asynchronously after the response is complete.
  4. D Wait for the full response, classify it once, then send it all, so nothing unsafe ever leaks.

One system design question a day, with spaced repetition so the ones you miss come back.

Get the app

Related questions