ModelQ is a lightweight, battle-tested Python library for scheduling and queuing machine learning inference tasks. It's designed as a faster and simpler alternative to Celery for ML workloads, using Redis and threading to efficiently run background tasks.
Repo ModelsLab/modelq, read from GitHub 2 d ago. ModelsLab has not joined Take My Repo.
Give a caller-built Redis client the same socket timeout, keepalive and health check as ModelQ's own pool, so a silently dropped connection no longer parks a worker until restart (#23).
Full Changelog: v1.0.21...v1.0.21-new
Full Changelog: v1.0.20...v1.0.21
Full Changelog: v1.0.19...v1.0.20
Fixes a release-blocking incompatibility in 1.0.17/1.0.18.
BLMOVE needs Redis ≥ 6.2. Every GPU worker container in production is still on Redis 6.0.16, where 1.0.17+ crash-looped at ~30 restarts/second: the worker never registered, the queue never drained, and the process still looked healthy from outside.
Nothing had hit this yet only because every deployed container still ran an older ModelQ — but worker requirements.txt files already pin 1.0.17, so the next rebuild would have.
Changes
BLMOVE once and cache the result. On unknown command, claim tasks with an atomic Lua LPOP+RPUSH polled on a short interval — same atomicity, same FIFO order, only the blocking is emulated.BRPOPLPUSH was deliberately not used: it pops the tail, which turns an rpush-fed queue LIFO.ResponseError (LOADING, …) leaves a capable server on the fast path.Also includes 1.0.18's Task.stage_timings() queue/run split.
PR: #21
Adds a queue-wait / run-time split that a producer can actually read.
Why: a generation API answered a request in 37.7s while the only timer in its response read generationTime: 5.55. That timer starts after enqueue, so it hid the handler's work and merged queue wait into the run. ModelQ already recorded the timestamps but never surfaced them.
Changes
created_at/queued_at onto the Task object it returns (previously written only into the Redis blob, so task.queued_at was always None).Task.get_result() absorbs queued_at/started_at/finished_at from the terminal blob, before it can raise — so a failed or cancelled task still reports where its time went.Task.stage_timings() → {queue_time, run_time, total_time}. Stages that cannot be measured are omitted, never reported as 0.0.Compatibility: fully additive. Result blobs from older workers leave existing timestamps untouched and stage_timings() returns {}.
PR: #20