Architecture deep dive

How ModelRiver works

Choose the request pattern that fits your architecture. See exactly how data flows from your frontend to AI and back.

Event-driven async flow

Step-by-step interactive data flow visualization

1
User prompt
Frontend interaction
2
Your backend
API call to MR
3
ModelRiver
Orchestration
4
AI providers
Auto-failover flow
Async workflow triggered
6
Webhook delivery
Callback to your server
5
ModelRiver
Message orchestration
7
User's browser
Real-time WS update
Your code
ModelRiver
AI providers
Async / WebSocket

Why event-driven async?

Fast Acknowledgment

Immediate response with channel ID. No waiting for AI completion.

Background Execution

AI runs in background. Your server stays responsive.

Automatic Fallback

Automatic retries with fallback providers. Built-in reliability.

Real-time

WebSocket delivery to frontend. Users see results instantly.

Ready to get started?