Collectivenix fleet

30 machines · 4 platform classes · 1 registry

In use

Agents & AI

Coding agents are some of the fleet's busiest users. Collective installs them on every machine with the same credentials, skills and model gateway, keeps their configuration editable while they run, and recovers their logins from other machines when a token expires.

Agent CLIs everywhere

The ai.tools options in Home Manager select what each machine gets. Most are on by default, so a new machine is ready for agent work after its first switch.

OptionInstalls
ai.tools.piThe Pi coding agent, with its settings, skills, extensions, prompts and themes linked from standalone/pi
ai.tools.claude.codeClaude Code and wrappers: one routes it through the gateway, one asks before running outside tmux unless it is a one-shot -p call
ai.tools.openai.codex, ai.tools.gemini.cliCodex and Gemini CLI
ai.tools.herdrherdr, a terminal workspace manager for agent sessions across machines
ai.tools.mcp.*MCP servers; 21 are declared in one shared mcp.json, linked into every home
ai.tools.cacophonyThe agent orchestrator's daemon, and how many turns this node's agent daemon runs at once
ai.tools.vastai.cli, vllm, kittentts, openai.whisperRented GPUs, local model serving, offline speech

Agents also get worktree helpers. agent-checkout creates an agent branch in a separate worktree and runs a command there in tmux; pi-checkout, claude-checkout and codex-checkout specialise it, so parallel agents never share a working tree.

The model gateway

The model gateway on every nodeOn the left, clients: Claude Code, Codex, Pi, other agents and scripts. They call a gateway on their own node: four isolated LiteLLM processes on ports 4000 to 4003, one per GitHub Copilot account, all serving the same model list from a configuration file in the checkout. On the right, providers: GitHub Copilot for each account, Azure AI, and local speech models served by AudioML on a GPU host. Below, credentials: each proxy's Copilot token comes from an account map, and Azure requests carry Entra tokens from az-token, which uses the node's own Azure login or asks a token broker machine over SSH. login-via recovers lost logins from peers. Claude Code Codex Pi other agents TTS, scripts litellm one process per account :4000 account 1 :4001 account 2 :4002 account 3 :4003 account 4 81 model entries, shared GitHub Copilot per account Azure AI Entra tokens local speech AudioML on a GPU host credentials gh-auth-tokens: account map az-token: local az, else SSH to a token broker login-via recover a login from a peer
The gateway.Every node serves the same proxies, so a client never depends on another machine being up to reach a model.

Each node runs four isolated LiteLLM processes, one per GitHub Copilot account, on ports 4000 to 4003: systemd units on NixOS, launchd agents on the Mac and supervisord programs on Android. They share one model list of 81 entries in standalone/litellm, edited without a rebuild. Azure keys are disabled: a request hook swaps an entra placeholder for a fresh Entra token from az-token, which uses the node's own Azure login or, on machines that cannot sign in, asks one of ten token broker machines over SSH.

A Bifrost gateway module is still available, but it is opt-in and no machine enables it. LM Studio is reached directly by Pi as a dynamic provider rather than through the gateway.

Credentials and recovery

Agents need GitHub, Copilot and Azure credentials that expire. Three helpers recover a login from another machine instead of opening a browser:

gh-login-via                          # repair every configured GitHub identitycopilot-login-via --all               # every configured Copilot accountaz-login-via                          # a refreshable Azure CLI sessiongh-login-via --discover               # list valid sources; install nothing
  1. Look locally first

    A valid local credential is left alone.

  2. Then ask the fleet

    Sources are the registry's live machines, Azure preferring its token brokers, or an explicit list. Nothing else on the tailnet is scraped. SSH uses only already-trusted host keys, batch mode and short timeouts. A small read-only exporter runs on the source over SSH's standard input, so the source does not need the helpers installed.

  3. Validate before installing

    A GitHub token must answer /user as the right account. A Copilot credential must also mint a fresh token and list models: a recent file or an unexpired cached token is not proof.

  4. Report without secrets

    Standard output is a tab-separated table of account, source and result; errors are summarised and never include provider responses or credentials. Exit codes: 0 all recovered, 1 partial or failed, 2 misuse.

Account maps for Copilot and GitHub tokens live in standalone/gh-auth-tokens. Git over SSH picks a key per organisation through a multiplexing helper, so work and personal repositories keep separate identities.

Skills and plugins

ForWhatWhere
Claude CodeA plugin marketplace of 6 plugins and 65 skills: Git and GitHub, Nix, self-management such as hand-offs and compaction, utilities, meta-skills for writing skills, and workplugins/
Pi12 engineering skills (software, Android, Apple, frontend style, distributing software, static sites and more), extensions, prompts and themes, all live-linkedstandalone/pi
Every agentA shared MCP configurationstandalone/mcp.json

Because skills are linked out of the store, an agent that improves a skill changes it for every agent on that machine immediately, and for the fleet once the commit is pulled. cltv pi test checks that every Pi extension imports, exports a default function and registers against a mock Pi.

Local inference

Machines with large AMD GPUs serve models locally. These modules share one pattern of ownership:

ModuleServes
prismLLM inference on ROCm, from a pinned upstream build or entirely from source, with GPU, UI and host stages cached separately
audiomlText to speech with reference voices on audio.cpp, as named instances, published through the gateway
lmstudioLM Studio with a per-GPU ROCm policy
kittenttsSmall offline speech models

The agent fleet

Collective is also where the owner's agent infrastructure is installed and configured. Each has its own site:

ServiceCollective's part
CacophonyInstalls the orchestrator daemon through its Home Manager module, with its environment and per-node concurrency
pi-daemonRuns one owner instance, with a watchdog and web unit, on five devboxes from the rolling input. Admission is based on protocol capabilities and health, never on matching versions
ParatenicRuns one session host beside Pi, bound to the machine's tailnet address when it has one
ctxInstalls the shared context store's client and module everywhere
PebbleArchives audio from a wearable on a loopback receiver and forwards transcripts, never audio, to the orchestrator

The agent services' configuration (endpoints, workspaces, chat bridges) lives in standalone/ too, so adding a machine to the agent fleet is a configuration edit, not a rebuild.