Bidirectional | ❌ No | ❌ No | ✅ Yes |
Protocol | OS-level stdin/stdout over TCP | HTTP (one-way stream over HTTP/1.1) | HTTP (usually chunked transfer or HTTP/⅔) |
Data Format | Text (line-delimited), JSON | JSON/Text (EventStream) | Arbitrary bytes, JSON, binary, I/O streams |
Latency | 🟢 Low (no network) | 🟡 Medium (HTTP overhead, server push model) | 🟢 Low-to-medium (depends on server impl) |
Streaming Support | ⚠️ Simulated (by polling stdout) | ✅ Yes (server pushes tokens as events) | ✅ Yes (true duplex stream) |
Transport Overhead | 🟢 Minimal | 🟡 Medium (HTTP headers, reconnection) | 🟡 Higher (duplex control, buffers) |
Concurrency | ❌ Usually single process/thread | ✅ Supported with multiple HTTP connections | ✅ Natively concurrent |
Error Handling | ❌ Basic (process exit codes) | 🟡 Limited (need to parse events) | ✅ Custom error/status codes possible |
Tooling Complexity | 🟢 Simple subprocess | 🟡 Moderate (SSE client lib required) | 🔴 High (custom protocol or server code needed) |
Server Implementation | CLI app or local executable | Web server with SSE support | Custom backend (e.g., FastAPI with async streams) |
Ideal Use Case | Local models or CLI tools | Hosted LLMs with streaming (e.g., OpenAI) | Agent/toolchain with rich, stateful interaction |
Transport Type | IPC/OS process-based | Unidirectional HTTP stream | Bidirectional over HTTP |
Compression Support | ❌ None | ⚠️ Limited (gzip encoding possible) | ✅ Full control over compression |
Backpressure Handling | ❌ Minimal (buffer overflow risk) | ⚠️ Poor (SSE lacks flow control) | ✅ Good (can implement windowing/chunking) |