Metadata-Version: 2.4
Name: ants-worker
Version: 0.2.2
Summary: Distributed compute worker for Ants at Work colony
Author-email: Ants at Work <hello@ants-at-work.com>
Project-URL: Homepage, https://ants-at-work.com
Project-URL: Documentation, https://github.com/ants-at-work/worker
Project-URL: Repository, https://github.com/ants-at-work/worker
Project-URL: Issues, https://github.com/ants-at-work/worker/issues
Keywords: distributed,compute,gpu,npu,amd,ryzen-ai,kangaroo,ecdlp
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Mathematics
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: click>=8.0
Requires-Dist: rich>=13.0
Requires-Dist: httpx>=0.25.0
Provides-Extra: cuda
Requires-Dist: cupy-cuda12x>=12.0; extra == "cuda"
Provides-Extra: amd
Requires-Dist: torch>=2.0; extra == "amd"
Requires-Dist: pyopencl>=2023.1; extra == "amd"
Provides-Extra: npu
Requires-Dist: onnxruntime-directml>=1.16.0; extra == "npu"
Provides-Extra: gpu
Requires-Dist: cupy-cuda12x>=12.0; extra == "gpu"
Provides-Extra: agent
Requires-Dist: uagents>=0.6.0; extra == "agent"
Provides-Extra: typedb
Requires-Dist: typedb-driver>=3.0.0; extra == "typedb"
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21; extra == "dev"
Requires-Dist: black>=23.0; extra == "dev"
Requires-Dist: mypy>=1.0; extra == "dev"
Provides-Extra: all
Requires-Dist: ants-worker[agent,amd,cuda,dev,typedb]; extra == "all"

# Ants Worker

Join the colony. Share your compute.

```bash
pip install ants-worker
ants-worker join
```

That's it. You're now part of the swarm.

## Commands

```bash
ants-worker join           # Register and start working
ants-worker join -t wild   # Run as wild kangaroo (default: tame)
ants-worker status         # Check connection and worker ID
ants-worker leave          # Unregister (delete ~/.ants/config.json)
ants-worker info           # System/GPU info
ants-worker benchmark      # Test performance
```

## Hardware Acceleration

### AMD Ryzen AI (NPU)

```bash
# Auto-detects Ryzen AI and optimizes
ants-worker join

# Check detected hardware
ants-worker info --detailed

# Force specific backend
ants-worker join -b amd_npu
ants-worker join -b amd_rocm
ants-worker join -b parallel_cpu --workers 16
```

### NVIDIA GPU

```bash
pip install ants-worker[cuda]
ants-worker join
```

### High Performance Binary

```bash
# Linux with NVIDIA GPU
git clone https://github.com/JeanLucPons/Kangaroo.git
cd Kangaroo && make gpu=1 && cd ..
export KANGAROO_BIN=$(pwd)/Kangaroo/kangaroo

ants-worker join
```

## Run in Background

### Screen/tmux

```bash
screen -S ants
ants-worker join
# Ctrl+A, D to detach
```

### Systemd (Linux)

```bash
sudo tee /etc/systemd/system/ants-worker.service << 'EOF'
[Unit]
Description=Ants Worker
After=network.target

[Service]
Type=simple
ExecStart=/usr/local/bin/ants-worker join
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target
EOF

sudo systemctl enable --now ants-worker
```

## FAQ

**Is this safe?**
Yes. You get a unique token that can only submit work results.

**Resources?**
Minimal bandwidth (~KB/min). CPU/GPU usage configurable. Stop with Ctrl+C.

**Where's my config?**
`~/.ants/config.json` - contains your token and worker ID.

**Tame vs Wild?**
Both needed. Run one of each for maximum contribution:
```bash
ants-worker join -t tame &
ants-worker join -t wild &
```

## Development

```bash
git clone https://github.com/ants-at-work/worker
cd worker
pip install -e ".[dev]"
pytest
```

## Links

- Website: https://ants-at-work.com
- Issues: https://github.com/ants-at-work/worker/issues
