Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

NixAI — AI Agent Host

Purpose

nixai is the AI infrastructure host. It runs the AI agent, local inference via Ollama, Mnemosyne memory sync, and voice services.

Entry Point

Architecture / Services / Scope

AI Agent

  • Containerised AI agent with a web dashboard, an OpenAI-compatible API server, and a webhook platform.
  • Primary model runs on OpenCode Go (deepseek-v4.1-flash), with OpenRouter as the fallback provider.
  • Memory is enabled, backed by Mnemosyne sync.
  • Voice is enabled, using the local Wyoming STT server.
  • A hardened SSH daemon is provisioned inside the container for agent administration.

Local Inference

  • Runs local models on the host’s AMD iGPU (ROCm/Vulkan), loading a small set of chat and embedding models.
  • Used by the agent for local model access.

Mnemosyne (mnemosyne.nix)

  • Mnemosyne memory provider sync server, used by the agent for persistent memory. Served on its own vhost.

Voice (voice.nix)

  • Wyoming Piper (TTS) and faster-whisper (STT) servers exposed over TCP for local voice assistants.

Secrets

Declared secrets

Secret keyPurpose
AI_AGENT/OPENROUTER_API_KEYOpenRouter model API key (fallback and auxiliary models)
AI_AGENT/OPENCODE_GO_API_KEYOpenCode Go model API key (primary model)
AI_AGENT/DISCORD_BOT_TOKENDiscord bot token
AI_AGENT/API_SERVER_TOKENAgent API server auth
MNEMOSYNE_SYNC_KEYMnemosyne sync API key

Operational Notes / Assumptions

  • Ollama relies on the AMD iGPU; ROCm on the iGPU is noted as unreliable upstream, so the config pins an override and waits on a Vulkan fix.
  • The agent dashboard, Mnemosyne, and the voice/whisper endpoints are exposed through the IO Coordinator reverse proxy.
  • The agent’s SSH port is opened to the subnet for administration.
  • The gateway control directory (/var/lib/hermes/.hermes) is narrowed to 0750 by an appended systemd.tmpfiles rule in hermes/core.nix: the gateway client refuses a control directory another user can write, while the upstream module creates it 2770 so group members share it. The state directory and the .hermes subdirectories keep 2770, because the container relies on the setgid bit when it changes ownership.

References