Building high-frequency monitoring systems for web services often reveals a tough architectural tradeoff: cloud API rate limits and token costs quickly erode margins when running continuous polling loop tasks.
When designing event-driven automation for city-scale municipal platforms and real-time alerts, I needed an architecture that could analyze raw data payloads continuously with zero per-request fee structure.
I'm Roby Karti S., a fullstack developer building digital services in Pekanbaru, Indonesia. In this post, I detail how running quantized open-source AI models alongside lightweight event-driven TypeScript loops creates high-throughput, low-latency alerting systems.
The Challenge: Real-Time Event Processing at Scale
When polling third-party endpoints or monitoring public service databases for real-time status updates, standard scraping methods encounter several roadblocks:
- Anti-Bot and Rate Limits: Rapid HTTP requests trigger IP blocks or Cloudflare challenge pages if request headers are unhandled.
- Dynamic DOM and Payload Structures: Traditional CSS selector parsers break whenever the target application updates its frontend build artifacts.
- High Operational Overhead: Sending thousands of raw DOM or JSON payloads to proprietary cloud LLMs for content parsing incurs unsustainable API fees.
The solution lies in decoupling data ingestion from intelligence parsing using lightweight local AI models running on edge nodes.
System Architecture: Event Polling + Local AI Intelligence
The automated pipeline operates on a concurrent two-phase architecture:
- Ingestion Fiber: An asynchronous polling service with dynamic jitter and exponential backoff fetching structured data payloads.
- Local AI Parsing Fiber: A local open model (such as
qwen2.5-coder:3borllama3.2:3b) running via local inference engine, evaluating changes and classifying anomalies in under .