All Questions
Guardrails And Safety medium

Your chat product streams tokens to the browser over SSE. Safety requires a moderation classifier on model output, and product requires that time to first token stays low. Which design best balances both?

  1. A Buffer the full response, classify it once, then send it; total completion time is unchanged so users see no real difference.
  2. B Classify sentence-sized windows in the stream path, accepting tens to hundreds of ms of delay, and cut the stream on a violation.
  3. C Classify asynchronously after delivery and flag violating conversations for review, keeping all latency out of the response path.
  4. D Skip output classification and rely on a strict input classifier, since a policy-compliant prompt yields policy-compliant output.

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

Get the app

Related questions