Skip to main content
Every format streams as it does with the provider directly. Ask for a stream the way the API you call expects, and the events arrive in that API’s format.

Errors in a stream

An error found before the first event comes back as an ordinary JSON error with its real status, so your SDK raises it as usual. See Errors. An error after the stream has started cannot change the status, which was already sent. It arrives as an error event, with the same body an ordinary error would have:
The official SDKs raise this as an error mid-stream. If you read the stream yourself, watch for event: error and stop.

Guardrails on replies

When a guardrail on replies can block or mask, Altrum holds the stream until the whole reply has been checked, then sends it. The first words arrive later, and unchecked text never reaches your application. When every guardrail on replies only logs, the reply streams as the model writes it and the last event waits for the check. See Guardrails at runtime.