架构概览
选择合适的 AI 请求模式
ModelRiver 提供三种不同的方式来处理您的 AI 流量,旨在匹配您应用程序架构的特定需求。在下面对比它们的能力,或深入了解它们的交互式流程图。.
详细对比
各项模式的扩展属性和最佳使用场景的详细对比。.
| Capability | 事件驱动异步 | 异步 Webhook | Synchronous |
|---|---|---|---|
| 难度级别 | Medium | Moderate | Easy |
| 扩展级别 | 无限自动扩展 | 水平扩展 | 受限于连接线程 |
| 最佳适用场景 | 实时 apps plus background/bulk tasks with proper webhook event notification. | 后台处理,批量操作。. | 内部工具,快速一次性调用。. |
| 增加的延迟 | ~120毫秒 (Socket 握手) | < 50毫秒 (直接推送) | Absolute zero |
| 防掉线可靠性 | Perfect | Perfect | Vulnerable to timeouts |
| 交付方式 | WebSocket 数据帧 + REST Webhook 执行数据 | Delivery to webhook and websocket simultaneously | Blocking HTTP Response |
| 供应商重试 / 故障转移 | Fully unblocked with automatic callback to ModelRiver and user notification. | Robust background error handling. | Handled in the single HTTP transaction window. |