Posts

Showing posts from June 18, 2026

Python code examples for implementing an ML ensemble using Redis

  Important Setup Note: RedisAI and RedisML are no longer actively maintained as of 2025/2026. Therefore, Pattern B has evolved into standard deployment patterns using lightweight modern tools (like ONNX Runtime or FastAPI workers coupled directly with Redis), ensuring your pipeline remains production-grade. Pattern A: Asynchronous Parallel Processing (Redis Streams) Best for: Heavy models (Deep Learning, large Random Forests) that need separate workers or hardware (GPUs) to compute in parallel without locking your main API. Architecture Flow [Client Request] │ ▼ ┌───────────┐ XADD ┌───────────────┐ │ FastAPI │ ────────────────>│ Redis Stream │──┐ (Model 1 Worker) │ Gateway │ │(ml:requests) │──┼─> [Model 2 Worker] └───────────┘ └───────────────┘──┘ (Model 3 Worker) │ │ │ (Polls responses via │ XADD │ ...