BlackBull framework runs HTTP/SSE and MQTT broker in one Python process on edge hardware
Developer Joren Vranckaert has built BlackBull, a pure-Python ASGI framework that consolidates HTTP/1.1, HTTP/2, WebSocket, gRPC, and an MQTT 5 broker into a single process. The project targets edge devices such as Raspberry Pi and Jetson boards, where running multiple daemons — a web server, reverse proxy, and separate MQTT broker — adds provisioning complexity and cross-compilation overhead. BlackBull allows browser clients to receive token-by-token streamed responses via Server-Sent Events over HTTP/2, while IoT sensors and devices communicate concurrently over MQTT on the same box. To prevent blocking the async event loop during CPU-bound model inference, the framework offloads computation to a worker thread and drains tokens through an asyncio queue. The framework is designed to be dependency-free for basic demos, with support for real model backends such as llama-cpp and ONNX through its threading pattern.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in