Skip to main content
Use streaming for responsive UIs that display text as it’s generated, providing a better user experience for longer responses.

Basic Streaming

Streaming with Metrics

Get both the token stream AND final metrics:

LLMStreamingResult

Example: Chat UI with Streaming

Example: Jetpack Compose Integration

Performance Tips

Streaming provides better perceived performance for long generations: - Time to First Token (TTFT): ~50-100ms - Users see immediate feedback instead of waiting for the full response