Skip to main content

Overview

All models on AJ STUDIOZ Cloud Infra support streaming responses. With streaming, tokens are returned incrementally as they’re generated — giving users a much faster perceived response time.

Ollama-Compatible Streaming

Set "stream": true in the request body:
Each streamed chunk is a JSON object:
The final chunk has "done": true and includes timing metrics.

OpenAI-Compatible Streaming

Use stream=True with the OpenAI SDK:

Ollama Python SDK Streaming


Node.js Streaming


Streaming Metrics

The final message in an Ollama-compatible stream includes performance metrics:
Tokens per second = eval_count / (eval_duration / 1e9)