Labtasker
Labtasker is a small, Python-native task queue for running independent ML inference, evaluation, and experiment jobs in parallel.
Documentation: https://luocfprime.github.io/labtasker/
LLM Documentation: https://luocfprime.github.io/labtasker/latest/llms.txt
Source Code: https://github.com/luocfprime/labtasker
Labtasker distributes independent ML jobs across multiple processes and
machines. It adds dynamic control, failure recovery, and structured Task
records without requiring each project to build its own task system.
The key features are:
- Effortless and flexible parallelism: Run the same Task queue with multiple
Workers. Submit new Tasks, change priorities, or cancel Tasks without
interrupting the Workers.
- Resumable and failure-resistant experiments: Retry failed Tasks
automatically and recover work when a Worker stops. Restart Workers without
rerunning completed Tasks. These lifecycle behaviors are covered by unit and
end-to-end tests.
- Structured task records: Keep each Task's arguments, metadata, status,
errors, and structured result in one place for inspection. Archive finished
Tasks to keep their results outside daily lists.
- Lightweight Worker observability: Inspect where Workers run and their
latest user-reported resource telemetry without turning Labtasker into a
resource scheduler or metrics database.
- Easy to adopt and use: Add Labtasker to existing Python code in fewer than
10 lines, or wrap an existing command with no code changes. The API,
non-interactive CLI, Agent Skill, and
agent-readable documentation allow an agent to operate
Labtasker end to end.
See Labtasker in action
This visual overview shows Workers sharing a Queue, failed Tasks returning for
another attempt, live experiment changes, structured results, and agent-driven
operation.
https://github.com/user-attachments/assets/a09d1113-97d1-4e19-b0ce-2a71a12f9a42
[!TIP]
Hand Labtasker operations over to your coding agent. Install the bundled
Agent Skill, then let your agent handle the
Labtasker workflow end to end through its documented interfaces. You only
need to tell your agent which Tasks to run and how they should run in
parallel.
Installation
Labtasker requires Python 3.10 or newer. Install the complete package for local use:
python -m pip install labtasker
Or add it to a uv project:
uv add labtasker
The labtasker package installs matching Client and Server releases. A remote
Worker environment can install only the lightweight Client, avoiding the Server
dependency tree:
python -m pip install labtasker-client
You can also install labtasker-server separately when the Server runs in its
own environment.
Example
Suppose an existing evaluation program accepts a checkpoint, benchmark task,
and seed:
python evaluate.py \
--checkpoint checkpoints/model.pt \
--task pick-cube \
--seed 0
Submit each evaluation case as a Labtasker Task:
labtasker --auto-start-local-server task submit \
--name pick-cube-seed-0 \
--args '{"checkpoint":"checkpoints/model.pt","task":"pick-cube","seed":0}' \
--route robotwin
The explicit startup flag is needed only when this local Server is not already
running. Later commands connect to the same root-derived Unix socket without
starting a process.
Then run the existing program through a command Worker:
labtasker loop --route robotwin -- \
python evaluate.py \
--checkpoint '%{checkpoint}' \
--task '%{task}' \
--seed '%{seed}'
Start one Worker process on each GPU you want to use. All Workers claim from the
same Queue and process one Task at a time. The route name robotwin labels which
Worker implementation can run the submitted Task.
To save evaluation metrics as the Task result, report them from the evaluation
program:
import labtasker