# Join the pool: steps for a coding agent

You are an agent asked to join this machine to the MeshKore LLM pool. Run
the one command for this OS, then check "Done". There is no account, form,
window or prompt; no administrator rights are needed. The machine lends
part of its GPU memory to a shared open-weights model and gets an
OpenAI-compatible endpoint on `http://127.0.0.1:17080` in return.

## 1. Check the machine

Lending needs one of: Apple silicon (M1 or later) with 16 GB of memory or
more; an NVIDIA GPU with 8 GB of VRAM or more; an AMD or Intel GPU with a
current Vulkan driver. About 32 GB of free disk for the model. A machine
with none of these still installs and can use the pool, without lending.

## 2. Install

macOS (Apple silicon):

```bash
curl -fsSL https://llm.meshkore.com/install.sh | sh
```

Linux (x86_64):

```bash
curl -fsSL https://llm.meshkore.com/install.sh | sh
```

Windows (x64), in PowerShell:

```powershell
irm https://llm.meshkore.com/install.ps1 | iex
```

On Linux and Windows the installer picks a GPU build when it finds a
supported GPU, else the CPU build. Building from source stays possible:
the "Command line" steps of [Join](https://llm.meshkore.com/docs/join.md).

That is all. The installer downloads, verifies, installs, starts the node,
keeps it running at login, switches lending on, and waits until the node
reaches the hub. Running it again updates; it is safe to repeat.

Options (append after `sh -s --` on macOS/Linux; on Windows run
`& ([scriptblock]::Create((irm https://llm.meshkore.com/install.ps1))) -Option`):

| macOS / Linux | Windows | Effect |
|---|---|---|
| `--no-lend` | `-NoLend` | install and use the pool, lend nothing |
| `--share 0.6` | `-Share 0.6` | share of GPU memory to lend, 0.1 to 0.9 |
| `--name NAME` | `-Name NAME` | label on the dashboard |
| `--headless` | (always) | macOS: background node instead of the desktop app |
| `--uninstall` | `-Uninstall` | stop and remove (keeps `~/.hyverk`) |
| `--uninstall --purge` | `-Uninstall -Purge` | also delete identity, settings and models |

On macOS the default is the signed desktop app (installed into
/Applications from the dmg, started hidden, no clicks); `--headless` installs
a background node (LaunchAgent) instead. Linux uses a `systemd --user` unit,
Windows a Scheduled Task at logon.

## 3. Done

```bash
curl -s http://127.0.0.1:17080/status
```

Done means `"lending": true` and `"engine": {"connected": true, ...}`.
`engine.role` is `"head"` or `"worker"` once the hub places the machine in a
copy of the model, with `engine.state` going `downloading` → `starting` →
`ready` (the first model download is 29 GB). `role: null` while connected
is normal: the hub forms a copy when at least two machines lend, and keeps
spare machines in reserve. `hyverk-node ctl wait` blocks until connected.

## 4. Operate it without a GUI

Everything the desktop app does, through the node's local API (loopback
only) or its CLI. The CLI is `~/.hyverk/node/hyverk-node` (headless),
`/Applications/MeshKore LLM.app/Contents/MacOS/hyverk-node` (macOS app) or
`%LOCALAPPDATA%\MeshKore\node\hyverk-node.cmd` (Windows).

| Do | CLI | HTTP |
|---|---|---|
| status | `hyverk-node ctl status` | `GET /status` |
| lend on / off | `hyverk-node ctl lend on` | `POST /control/settings {"lending": true}` |
| memory share | `hyverk-node ctl share 0.6` | `POST /control/settings {"memory_fraction": 0.6}` |
| RAM next to the GPU | `hyverk-node ctl ram 0.5` | `POST /control/settings {"ram_fraction": 0.5}` |
| pause on battery | `hyverk-node ctl battery off` | `POST /control/settings {"pause_on_battery": false}` |
| update now | `hyverk-node ctl update` | `POST /control/update` |
| logs | `hyverk-node ctl logs` | `GET /status` → `logs` |
| wait for the hub | `hyverk-node ctl wait 120` | poll `GET /status` |

Settings are saved and survive restarts. Updates: a headless node checks
the signed manifest every ~6 hours and restarts itself into a new version,
one machine of a copy at a time; the desktop app updates itself; re-running
the installer also updates. Logs: `~/.hyverk/node/logs/node.log` (macOS
headless), `journalctl --user -u hyverk-node` (Linux),
`%LOCALAPPDATA%\MeshKore\node\logs\node.log` (Windows),
`~/Library/Logs/com.meshkore.hyverk/node.log` (macOS app); engine logs in
`~/.hyverk/logs/`.

Stop and start (lending off is usually enough: `ctl lend off` frees the
memory and keeps the endpoint):

| | Stop | Start |
|---|---|---|
| macOS app | `curl -X POST http://127.0.0.1:17080/control/shutdown` | `open -g -j -a "MeshKore LLM"` |
| macOS headless | `launchctl bootout gui/$(id -u)/com.meshkore.hyverk-node` | `launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/com.meshkore.hyverk-node.plist` |
| Linux | `systemctl --user stop hyverk-node` | `systemctl --user start hyverk-node` |
| Windows | `Stop-ScheduledTask "MeshKore LLM node"; Get-Process hyverk-node \| Stop-Process` | `Start-ScheduledTask "MeshKore LLM node"` |

## 5. Use the model

```bash
curl -s http://127.0.0.1:17080/v1/chat/completions -H 'content-type: application/json' \
  -d '{"model": "pool", "messages": [{"role": "user", "content": "Hello"}]}'
```

Any OpenAI client works with base URL `http://127.0.0.1:17080/v1` and any
API key. More in [Use](https://llm.meshkore.com/docs/use.md).

## 6. Credits and the public path

The node's key is its owner's account on the network, unless the owner
names a wallet shared by several machines (`--wallet mkw_...`, a public
id; see [Credits](https://llm.meshkore.com/docs/credits.md)). Joining gives it a
welcome package of 50,000 credits once, and lending adds more by itself
(1 credit = 1 token, prompt plus answer). Requests to `127.0.0.1:17080`
above are free and never touch that balance.

```bash
curl -s http://127.0.0.1:17080/status                 # this machine, its role, its version
```

`curl -s http://127.0.0.1:17080/credits` shows the
balance (granted, earned, spent) and `POST http://127.0.0.1:17080/network/ask`
with `{"prompt": "..."}` asks the public agent, paid in credits. That call goes out to `POST https://llm.meshkore.com/v1/ask`, signed
with the node's key: the same call any agent anywhere makes with its own
key. See [The network as an agent](https://llm.meshkore.com/docs/agent.md).

## What the installer guarantees

- Downloads come only from `https://data.meshkore.com/downloads/node/`.
- The release manifest is signed with Ed25519. Release key (public half):
  `4988add1fcc5f0fe36bf298b7daff8833503709e1198e1a05a5eb429dbd6c2f3` (also at https://llm.meshkore.com/release-key.pub and
  in the scripts). The installer refuses a manifest that does not verify,
  a package whose size or SHA-256 differs from it, and an engine file that
  does not match the pins packaged with it.
- macOS: every binary must be signed by our Apple Developer ID, Team
  `L8N2VZD89J`; the app must also pass Gatekeeper (notarized).
- The node listens on 127.0.0.1 only; its identity is an Ed25519 key it
  makes on first run (`~/.hyverk/identity.key`). It sends the hub its hardware
  summary and lending choice, never files. See
  [Security](https://llm.meshkore.com/docs/security.md).
- To read before running: `curl -fsSL https://llm.meshkore.com/install.sh -o install.sh`,
  read it, then `sh install.sh`.

Building from source, or a machine the installer does not cover: see the
long guide, [Join](https://llm.meshkore.com/docs/join.md).
