Metadata-Version: 2.5
Name: argus-iris
Version: 0.2.1
Summary: VRAM-aware GPU lease broker for the Argus suite: priorities, schedules, keepalive and idle-kill across GPU nodes
Project-URL: Repository, https://github.com/smk762/argus-iris
Project-URL: Changelog, https://github.com/smk762/argus-iris/blob/dev/CHANGELOG.md
Author: smk762
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: pydantic>=2.6
Requires-Dist: pyyaml>=6.0
Requires-Dist: structlog>=24.0
Provides-Extra: agent
Requires-Dist: argus-cortex[server]<0.17,>=0.16.1; extra == 'agent'
Requires-Dist: fastapi>=0.110; extra == 'agent'
Requires-Dist: httpx>=0.27; extra == 'agent'
Requires-Dist: nvidia-ml-py>=12.535; extra == 'agent'
Requires-Dist: prometheus-client>=0.20; extra == 'agent'
Requires-Dist: uvicorn>=0.27; extra == 'agent'
Provides-Extra: cli
Requires-Dist: rich>=13.0; extra == 'cli'
Requires-Dist: typer>=0.12; extra == 'cli'
Provides-Extra: dev
Requires-Dist: argus-cortex[server]<0.17,>=0.16.1; extra == 'dev'
Requires-Dist: fastapi>=0.110; extra == 'dev'
Requires-Dist: httpx2>=2.7; extra == 'dev'
Requires-Dist: httpx>=0.27; extra == 'dev'
Requires-Dist: nvidia-ml-py>=12.535; extra == 'dev'
Requires-Dist: prometheus-client>=0.20; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: rich>=13.0; extra == 'dev'
Requires-Dist: ruff==0.15.16; extra == 'dev'
Requires-Dist: typer>=0.12; extra == 'dev'
Requires-Dist: tzdata>=2024.1; extra == 'dev'
Requires-Dist: uvicorn>=0.27; extra == 'dev'
Provides-Extra: server
Requires-Dist: argus-cortex[server]<0.17,>=0.16.1; extra == 'server'
Requires-Dist: fastapi>=0.110; extra == 'server'
Requires-Dist: httpx>=0.27; extra == 'server'
Requires-Dist: prometheus-client>=0.20; extra == 'server'
Requires-Dist: tzdata>=2024.1; extra == 'server'
Requires-Dist: uvicorn>=0.27; extra == 'server'
Description-Content-Type: text/markdown

# argus-iris

[![CI](https://github.com/smk762/argus-iris/actions/workflows/ci.yml/badge.svg?branch=dev)](https://github.com/smk762/argus-iris/actions/workflows/ci.yml)
[![PyPI](https://img.shields.io/pypi/v/argus-iris)](https://pypi.org/project/argus-iris/)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue)](LICENSE)

**A GPU lease broker for a small fleet of mixed cards.** Image generation, LLMs, speech and training jobs share a few
GPUs, each assuming it owns the card, until one of them runs out of memory. iris decides whether a job may start now,
on which node, and which idle model must be unloaded first. It never runs the work.

```
 callers (argus-cortex client)          dashboard          Prometheus
       │ leases, heartbeats                │ SSE               │
       ▼                                   ▼                   ▼
 ┌───────────────────────── broker (:8120) ─────────────────────────┐
 │  queue and admission · VRAM ledger · residency policy · registry │
 │  adapters: ComfyUI · Ollama · argus-http · external              │
 └────────┬──────────────────────┬──────────────────────┬───────────┘
   agent @ rtx3090        agent @ rtx4060        agent @ gtx1070
   NVML, cgroups, allow-listed container start/stop/restart
```

## What it does

- **Reserves VRAM.** With `admission: enforce`, a lease that does not fit is queued, sent to another node that has
  room, or given room by evicting the least recently used idle models. Priority classes age, so nothing starves.
- **Checks the GPU, not the service.** An eviction counts only when NVML shows the memory came back. What a service
  keeps anyway (a CUDA context, an allocator cache) is measured and reported.
- **Survives clients that don't clean up.** Leases expire without heartbeats. A job that heartbeats but does no GPU
  work is flagged as stalled and asked to yield.
- **Fails open.** If the broker is down, the client falls back to its local lease and work continues.
- **Is adopted gradually.** Admission starts in `observe`, and each residency rule only reports until it says
  `enforce: true`.
- **Finds services itself.** Services register with a URL and a token; the node agents' container inventory says where
  they run. A caller can never name a host for the broker to contact.

## Try it

You need Docker with the NVIDIA container runtime, and Compose.

```bash
git clone https://github.com/smk762/argus-iris && cd argus-iris
cp deploy/.env.example deploy/.env               # set IRIS_AGENT_NODE, IRIS_AGENT_TOKEN and HOST_IP (this host's LAN IP)
cp deploy/iris.example.yaml deploy/iris.yaml     # set your nodes and services
docker compose build && docker compose up -d     # broker and agent on this host
```

Open `http://<HOST_IP>:8120/ui/`. Ports bind to localhost unless `HOST_IP` is set. Read [SECURITY.md](SECURITY.md) before exposing either port: the agent holds the
Docker socket.

Or from PyPI: `pip install 'argus-iris[server,cli]'` for the broker, `pip install 'argus-iris[agent,cli]'` for a node.

## Read more

- [DESIGN.md](DESIGN.md): the problem, admission, scheduling and eviction, and what is built or still planned.
- [docs/operating.md](docs/operating.md): deployment, adding services and GPU hosts, leases, the service directory.
- [SECURITY.md](SECURITY.md): what each port can do, and how it is guarded.

## Develop

```bash
make install   # venv + editable install with the "dev" extras
make test
make lint
```

The version comes from git tags (`hatch-vcs`). CI and release use the shared
[argus-ci](https://github.com/smk762/argus-ci) workflows; a `v*` tag publishes to PyPI and GHCR.

iris is part of the [Argus suite](https://github.com/smk762?tab=repositories&q=argus). The client and wire models live in
[argus-cortex](https://github.com/smk762/argus-cortex).
