Streaming

SleekAI automatically detects whether your server supports streaming and uses the best method available. No configuration is required.

How It Works

When you first use SleekAI, it runs a quick test to check if your server supports Server-Sent Events (SSE). Based on the result:

  • Streaming supported: Responses stream in real-time, word by word, similar to ChatGPT
  • Streaming not supported: SleekAI falls back to polling mode automatically

Both methods provide the same user experience. The only difference is the underlying transport mechanism.

Streaming Mode

When streaming is supported, SleekAI uses Server-Sent Events to deliver responses as they are generated. This is the most efficient method and provides the lowest latency.

Polling Mode

When streaming is not supported (common on shared hosting), SleekAI automatically falls back to polling:

  1. The AI response is written to a temporary file on the server
  2. The browser polls this file for updates
  3. Once complete, the temporary file is cleaned up

This fallback ensures SleekAI works on any hosting environment, even those that do not support persistent connections.