Metadata-Version: 2.5
Name: localswarm
Version: 0.1.0
Summary: Parallel AI agents on your own machine: approval gates, checkpoints, live dashboard, tamper-evident audit log. No cloud.
License: MIT
License-File: LICENSE
Requires-Python: >=3.10
Requires-Dist: fastapi>=0.115
Requires-Dist: langchain-core>=0.3
Requires-Dist: langchain-openai>=0.3
Requires-Dist: langgraph-checkpoint-sqlite>=2.0
Requires-Dist: langgraph>=0.4
Requires-Dist: uvicorn[standard]>=0.30
Provides-Extra: dev
Requires-Dist: httpx>=0.27; extra == 'dev'
Requires-Dist: pytest>=8; extra == 'dev'
Description-Content-Type: text/markdown

# localswarm

Parallel AI agents, entirely on your own machine. No cloud, no external services.

```
pip install localswarm
localswarm run demo
# → dashboard at http://127.0.0.1:8391 (localhost only)
```

From source: `pip install -e .` (or `uv sync`). Start Ollama or LM Studio first and
localswarm uses it automatically; set `"context_files"` in the swarm file to give
every agent the project files it should read.

## What you get

| Feature | How |
|---|---|
| **Parallel agents** | Each agent is a LangGraph thread, run in its own worker thread |
| **Human approval gates** | `interrupt()` pauses any agent before risky actions; approve/deny in the dashboard |
| **Checkpoints** | `SqliteSaver` persists every step to a local file; resume from any checkpoint |
| **Live dashboard** | FastAPI + WebSocket in the same process, bound to 127.0.0.1 |
| **Tamper-evident audit log** | Hash-chained, append-only ledger (SQLite); edit or delete any record and the chain breaks. `localswarm audit verify` walks it in one click |

## The stack (all local)

- **LangGraph** (MIT, pip) — orchestration, checkpoints, interrupts
- **SQLite** (stdlib) — one local file for checkpoints + audit log
- **FastAPI/uvicorn** (pip) — localhost dashboard
- **Ollama or any local OpenAI-compatible model** — the only external process, and it's yours

If no model endpoint is reachable, localswarm falls back to a deterministic
offline stub so the swarm (and its gates, dashboard and audit log) still runs.

## Verify your audit trail

```
$ localswarm audit verify localswarm.db
{ "ok": true, "count": 23, "first_bad_seq": null, "reason": "" }
```

## Layout

```
src/localswarm/audit.py    # hash-chained append-only ledger + verify_chain()
src/localswarm/swarm.py    # parallel agents, approval gates, event bridge
src/localswarm/server.py   # FastAPI + WebSocket dashboard (127.0.0.1)
src/localswarm/cli.py      # localswarm run / audit verify
tests/                     # chain-integrity + full swarm lifecycle tests
```

MIT. Your data never leaves the machine.
