Architecture overview
Choose the right AI request pattern
ModelRiver provides three distinct ways to handle your AI traffic, designed to match the specific needs of your application's architecture. Compare their capabilities below, or dive into their interactive flow diagrams.
1
Recommended
Event-driven async
Real-time updates via WebSocket. Backend callbacks for processing. Best for interactive apps.
Learn more2
Async (Dual-Delivery)
Fire and forget. Results delivered simultaneously to your webhook and browser. Best for reliable background ops.
Learn more3
Sync
Simple request/response. Blocks until complete. Best for quick operations.
Learn moreDetailed Comparison
A side-by-side break down of scaling properties and best use cases for each method.
| Capability | Event-driven Async | Async Webhooks | Synchronous |
|---|---|---|---|
| Difficulty Level | Medium | Moderate | Easy |
| Scaling Level | Auto-scales infinitely | Scales horizontally | Limited by connection threads |
| Best For | Real-time apps plus background/bulk tasks with proper webhook event notification. | Background processing, bulk operations. | Internal tools, quick one-off calls. |
| Latency Added | ~120ms (Socket handshake) | < 50ms (Direct push) | Absolute zero |
| Reliability against drops | Perfect | Perfect | Vulnerable to timeouts |
| Delivery Method | WebSocket frames + REST Webhook execution data | Delivery to webhook and websocket simultaneously | Blocking HTTP Response |
| Provider Retries / Failovers | Fully unblocked with automatic callback to ModelRiver and user notification. | Robust background error handling. | Handled in the single HTTP transaction window. |