Metadata-Version: 2.5
Name: tqdaemon
Version: 0.11.3
Summary: Local resource-aware task queue daemon (CLI, web UI, MCP, remote workers)
Project-URL: Homepage, https://tqdaemon.dev/
Project-URL: Repository, https://github.com/wwylon/tqdaemon
Project-URL: Issues, https://github.com/wwylon/tqdaemon/issues
Project-URL: Documentation, https://github.com/wwylon/tqdaemon/tree/main/docs
Author: tqdaemon contributors
License-Expression: MIT
License-File: LICENSE
Keywords: ai-agents,cli,daemon,gpu,job-scheduler,local-first,mcp,resource-management,task-queue,web-ui,yaml
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.12
Requires-Dist: nvidia-ml-py>=12.0
Requires-Dist: psutil>=5.9
Requires-Dist: pyyaml>=6.0
Provides-Extra: toast
Requires-Dist: winotify>=1.1.0; extra == 'toast'
Description-Content-Type: text/markdown

# tqdaemon

[English](README.md) | [Polski](README.pl.md) | [中文](README.zh.md) | [العربية](README.ar.md)

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
[![Python 3.12+](https://img.shields.io/badge/python-3.12+-blue.svg)](https://www.python.org/downloads/)
[![CI](https://github.com/wwylon/tqdaemon/actions/workflows/ci.yml/badge.svg)](https://github.com/wwylon/tqdaemon/actions/workflows/ci.yml)
[![PyPI](https://img.shields.io/pypi/v/tqdaemon)](https://pypi.org/project/tqdaemon/)
[![Latest tag](https://img.shields.io/github/v/tag/wwylon/tqdaemon?label=version)](https://github.com/wwylon/tqdaemon/tags)

![tqdaemon — local jobs, agents, workers](https://raw.githubusercontent.com/wwylon/tqdaemon/main/docs/assets/demo.gif)

**tqdaemon** runs heavy jobs and AI agents on your workstation — without OOM crashes
or GPU collisions. Describe each job in YAML (or `tq run`). A local **daemon** starts
work only when there is enough CPU, RAM, and GPU memory. Watch progress in a **web UI**,
the **`tq`** CLI, or from an **AI coding agent** (MCP).

Site: [tqdaemon.dev](https://tqdaemon.dev/). How it compares with cron, Celery, Slurm,
Ray and others: [docs/comparison.md](docs/comparison.md).

## Why use it

- **VRAM & RAM guardrails** — live memory + historical peaks, settle windows for CUDA
  weight-loading, optional Ollama unload before training
- **Built for coding agents (MCP)** — submit, wait, structured `tq.*` diagnostics
- **Workstation-native** — SQLite home, web dashboard, Windows & Linux process trees,
  sleep prevention, cooperative checkpointing (`exit 75`)
- **Local-first** — no cloud SaaS account, no phone-home

## Architecture

```text
  CLI / MCP / Web UI
         │
         ▼
  Daemon + SQLite  ──►  admission (CPU / RAM / VRAM)
         │                    │
         ▼                    ▼
  process tree          optional LAN workers
  (Job Object / pgid)    (lease + bundle sync)
```

## Best start: ask your agent

Tell your coding agent (Cursor, Claude Code, …) to use **tqdaemon** for long jobs:
wire MCP (`tq mcp`), submit YAML tasks (or `tq run`), and `wait_for_task` instead of
blocking the chat. Drop-in skill: **[docs/agents/TQDAEMON_SKILL.md](docs/agents/TQDAEMON_SKILL.md)**.
Setup: **[docs/mcp.md](docs/mcp.md)**.

### Cursor MCP (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "tqdaemon": {
      "command": "tq",
      "args": ["mcp"],
      "env": {
        "TQDAEMON_HOME": "C:\\Users\\YOU\\.tqdaemon",
        "TQ_OPERATOR": "YOU"
      }
    }
  }
}
```

### Claude Code

```bash
claude mcp add tqdaemon --scope user \
  -e TQDAEMON_HOME="$HOME/.tqdaemon" -e TQ_OPERATOR=YOU -- tq mcp
```

## Install

**Need:** Python **3.12+**, [Git](https://git-scm.com/), [`uv`](https://docs.astral.sh/uv/).

**Platforms:** developed and tested on Windows 11; also verified on Linux (Ubuntu 24.04, daemon + task run, with and without an NVIDIA GPU path). On macOS the dependencies resolve (all wheels, including `nvidia-ml-py`, which is pure Python and only needs an NVIDIA driver when you actually have a GPU), but the daemon has not been run there yet; reports welcome.

**From PyPI:**

```bash
uv tool install tqdaemon    # preferred
pipx install tqdaemon
pip install tqdaemon
```

Or try once: `uvx --from tqdaemon tq doctor`. From source:

```powershell
git clone https://github.com/wwylon/tqdaemon.git
cd tqdaemon
uv sync
uv run tq doctor
uv run tq start
```

Open **http://127.0.0.1:8765**. Try the sample in
[`examples/minimal`](examples/minimal/) (register it as a project, then
`tq sync` / enable / `tq wait` — see that folder’s README).

One-off without writing YAML first:

```bash
tq run --project myproject --ram 8 --vram 4 -- python train.py --epochs 50
```

Optional Windows toasts: `uv sync --extra toast`. Autostart:
`scripts/install_tq_autostart.ps1`.

## Docs

| Audience | Start here |
|----------|------------|
| Humans | [docs/README.md](docs/README.md) · [Quickstart](docs/operators/quickstart.md) · [Web UI](docs/operators/web-ui.md) · [CLI](docs/operators/cli.md) |
| Agents | [AGENTS.md](AGENTS.md) · [MCP](docs/mcp.md) · [Skill pack](docs/agents/TQDAEMON_SKILL.md) · [Cookbook](docs/agents/task-script-cookbook.md) · [llms.txt](llms.txt) |

**Advanced:** [Project messages](docs/messaging.md) · [Security & privacy](docs/security.md) · [Task standards](docs/task_standards.md) · [Scheduler](docs/scheduler.md) · [Workers](docs/WORKER_SETUP.md)

## Transparency

We do **not** phone home. Public signals are GitHub stars (badge above) and,
after a PyPI release under a distinct package name, download counts you can
verify yourself. Maintainers may use GitHub Traffic Insights (clones ≠ installs).
Details: [docs/security.md](docs/security.md#privacy--telemetry).

Not Celery, Kubernetes, or CI. Unrelated to the 2011 AMQP/Debian
[rojkov/taskqueue](https://github.com/rojkov/taskqueue) (simpletaskqueue).

## License

MIT — see [LICENSE](LICENSE) · [Changelog](CHANGELOG.md)

## Verify

```bash
pwsh -File scripts/ci.ps1
```

Or: python -m manager verify tqdaemon --tier prereq. Contract: [project.manifest.yaml](project.manifest.yaml).
