Systemic Artificial Reasoning & Intelligent Networked Assistant
A local AI assistant that runs on your own computer: a helper and companion for Labyrinth OS (a gaming-focused system based on CachyOS, with its own desktop, Yggdrasil) and for LykanOS (the security edition, formerly Chymaera OS). She talks to any OpenAI-compatible model server (Ollama by default; vLLM, LiteLLM, llama.cpp), calls tools, keeps sessions and notes on disk, and can move to a bigger machine or to Claude when the local model is not enough. The core is one Rust binary (since 2026-11-18; it was Go until then).
Sarina is optional: on Labyrinth OS she is installed from Agora, the app store, never forced on anyone.
How it is tested. Every change to the core runs the rust workflow: formatting, clippy and the tests, then the Rust
build and the Go build it replaced (kept as the reference) get the same command lines, service requests and console
requests, and must answer the same. The voice programs and helpers have their own workflow. How the port was proven is in
docs/RUST_PORT.md and docs/VOICE_RUST_PORT.md; what she can do with a real
model is measured by the evals (Evals), which need a graphics card and run on my PC, not in CI.
What she does today:
- Answers by voice and text. Super+S (or Ctrl+Alt+S) on the Labyrinth desktop: hold for one question, tap for a conversation; short plain answers, read aloud by her own voice.
- Troubleshoots the computer. She reads how it is doing (performance, network, disks, logs, failed services, boot, sound, kernel, temperatures) and explains it; her spoken answers come with that report already looked up.
- Looks after the gaming side. Labyrinth is a gaming machine first: she reads the gaming setup check, Proton versions, the installed games, and who holds the graphics card's memory (her own model included), and answers from guide notes about Proton, launch options, mods, controllers and anti-cheat. Her background jobs stay off the card while a game runs.
- Does a few repairs when allowed a shell.
system_fixrestarts the audio or Bluetooth for the user: named, fixed commands from a table, reversible, each reported with its check; nothing else can be run through it, and a spoken question never has it. - Helps with crashes as they happen. For a program that crashed she names the function, the source file and line and quotes it when the source is on the computer; Labyrinth's crash helper offers to ask her.
- Studies programs without running them. Static analysis with REA and Ghidra in a sandbox (no network, no home folder); an installed program is copied read-only into the analysis folder first. On Labyrinth OS the tools this needs (Java for Ghidra, Node for REA, bubblewrap, binutils) come with Sarina's install (since 2026-11-05).
- Remembers in a vault of notes (an Obsidian folder): she searches it by words and by meaning and writes lessons into it through a safety gate.
- Writes her own small programs ("agents") and runs them only inside Limbo's disposable virtual machines; you approve an agent at a terminal, and any change voids the approval (see docs/AGENT_FORGE.md).
- Follows skills, long ones too. A skill is a Markdown file of instructions. One up to 4 MiB is split into
sections of at most 12 KiB, and she reads only the part she needs (
skill_section, orskill_searchby meaning or words). A skill can have its evidence looked up before she starts (prefetch: [status],prefetch: [security]). Packaged skills:desktop-fix(find and fix what is broken on the desktop),security-advisor,security-audit(your own code),static-analysis,ecosystem-troubleshoot,labyrinth-engineer,quantum-tutor,ios-app-builder. - Reviews security with Heimdall.
system_status securityreads what Heimdall finds open (its local API: packages and kernels with known holes, settings that could be safer, and files it holds in quarantine with the report it made by reading them). Thesecurity-advisorskill judges each finding and proposes what to do, in order, with the exact commands; you run them. On Labyrinth the daily check-up (labyrinth-sarina-checkup, in the Labyrinth_OS repo) runs it when Heimdall reports something new and saves her proposal in the vault (Security/DATE.md). She never releases a held file herself. - Works with the Argus App and firmware (Flipper Zero tooling) through read-only advisory commands.
Sarina began as a fork of ClawCode
(itself a port inspired by the Claude Code npm CLI). ClawCode has no license; the
current tree is licensed MPL 2.0 (see
LICENSE). The core has been rewritten from
scratch in Go (go/) from behaviour specs (docs/spec/), without reference to
the old code, and the derived Python has been deleted from the tree; see
docs/PROVENANCE.md and NOTICE.md for the audit. That clean-room Go core was then ported
to Rust (rust/) and proved against it case by case (docs/RUST_PORT.md); the Rust build is the one
installed since 2026-11-18, and the Go code left the tree on 2026-11-26 (its last commit is the tag go-final, which the
side-by-side tests build their Go referee from). Credit
to the ClawCode project and contributors for the original implementation this
grew from. Sarina is not affiliated with or endorsed by Anthropic.
- Rust (stable, 1.87 or newer) and cargo to build. The crates are pinned in
rust/Cargo.lock. - A model server that speaks the OpenAI chat-completions API with tool calling.
Tested with Ollama and
qwen3. Ollama defaults to a 4096-token context, which is too small: Sarina needs at least 8k tokens (16k recommended). Raise it with a Modelfile linePARAMETER num_ctx 16384orOLLAMA_CONTEXT_LENGTH=16384, or tell Sarina the real size with--context-window. - For finding notes by meaning: the small
nomic-embed-textmodel in Ollama (about 270 MB, loaded only while searching). - Optional, for the ML/voice helper (
sarina-helpers, Rust):onnxruntime-cpu(loaded at run time), and forvoice-chatwhisper-cpp,espeak-ngandalsa-utils. - Linux is the reference platform.
rust/scripts/nicecargo.sh build --release --locked --bin sarina-rs # nice 15: never competes with a game
rust/scripts/nicecargo.sh test --locked
cp rust/target/release/sarina-rs ./sarina
export OPENAI_BASE_URL=http://127.0.0.1:11434/v1 # Ollama
export OPENAI_API_KEY=local-token
export OPENAI_MODEL=qwen3
./sarina chat "Summarise the layout of this directory." --cwd .
./sarina chat --interactive --cwd .
./sarina chat "Create NOTES.md with one line" --cwd . --allow-writeThe same binary answers to sarina-gui and sarina-service when started under
those names (the Arch package installs them as symlinks), or run
sarina gui / sarina service.
Read from the environment (Labyrinth keeps them in ~/.config/labyrinth/sarina.env):
| Variable | What it does |
|---|---|
OPENAI_BASE_URL, OPENAI_MODEL, OPENAI_API_KEY |
the model server and model |
SARINA_TEMPERATURE |
sampling temperature; 0.6 for Qwen3 (at 0 thinking models repeat themselves until they time out) |
SARINA_REQUEST_MAX_TOKENS |
the most one reply may produce, so a runaway reply ends instead of timing out (6000) |
SARINA_VAULT |
her notes folder |
SARINA_SEMANTIC=on |
find notes by meaning as well as by words (needs nomic-embed-text) |
SARINA_SYSTEM=on |
the system_status and crash_detail tools (read-only), and system_fix (named, reversible user-level repairs; needs --allow-shell) |
SARINA_REVERSE=on |
the sandboxed reverse_engineer and stage_binary tools (needs labyrinth-rea) |
SARINA_FORGE=on |
the agent forge tools (needs Limbo and its agent-run profile) |
SARINA_LIMBO_SOCKET |
Limbo's agent socket (/run/limbo/agent.sock) |
SARINA_PRIVATE_DIRS |
folders no file tool may read, list, search or write (:-separated, ~ allowed) |
SARINA_HELPERS_BIN |
another ML/voice helper program instead of /usr/lib/sarina/sarina-helpers |
sarina --help lists everything; sarina <command> -h shows flags.
| Command | What it does |
|---|---|
chat, resume |
run a prompt once, hold a conversation, or continue a saved session |
gui |
web console on 127.0.0.1:8765 |
service |
HTTP integration service on 127.0.0.1:8899 |
doctor [--json] |
read-only checkup of the whole setup (model backend, sessions, tiers, config files, Limbo, Heimdall); exit 1 on any FAIL; the model can call it as the sarina_doctor tool |
council QUESTION, council status [--probe] |
ask several models the same question and compare the answers; local members answer directly, online ones (Claude, Gemini, ChatGPT, ...) only after you confirm the exact text; also the council_ask tool when a council is configured; see docs/ECOSYSTEM.md section 9 |
tiers status |
show compute tiers and whether each is reachable |
skill list, skill run NAME [ARGS] |
skills: list them (with their source and whether the model may start them), or run one |
mcp list, agents list |
show configured MCP servers and subagent profiles |
memory-status, memory-show, memory-review* |
curated memory and its review queue |
session-search, memory-search |
lexical and semantic search over saved sessions |
limbo-profiles, limbo-validate |
run commands in a disposable Limbo guest |
system-status TOPIC, crash-detail PROGRAM |
how the computer is doing (performance, network, disk, logs, services, hardware, crashes, boot, audio, kernel, gaming, security), and the latest crash of one program (read-only) |
system-fix --list, system-fix ACTION |
the named repairs the system_fix tool can do (restart the audio, restart Bluetooth): fixed commands at user level, each with a check afterwards |
route QUESTION |
what to look up before answering a spoken question, decided by meaning |
vault-init, vault-search, vault-lint |
her notes: starting folders, search (words and meaning), broken links |
forge-list, forge-approve NAME, forge-remove NAME |
the agents she wrote; approving needs you at a terminal |
chymaera-console, chymaera-device-info, chymaera-merge-report, chymaera-analyze |
Argus App and Argus firmware (Flipper Zero) advisories, read-only (the command names predate the rename from Chymaera Zero) |
fleet-usage, fleet-status, fleet-launch |
agent-fleet usage and a confirm-first launcher |
desktop-audit |
audit and repair the application menu (report only unless --apply) |
voice-chat |
push-to-talk voice conversation (needs the helper) |
- Nothing mutating by default. File writes need
--allow-write, shell commands need--allow-shell; every state-changing tool declares what it needs and is checked in one place.--unsafeis separate and explicit. - Destructive-command guard. Shell commands are parsed (separators,
subshells, substitutions, wrappers,
curl | sh) before running. It is a guard-rail, not a sandbox; use Limbo for real isolation. - Secret-file guard covers every file tool; child processes get a filtered environment.
- Plan mode. In plan mode only read-only tools are offered to the model at all. Only the operator can approve, revise or reject a plan.
- Operator-controlled extensions. Skills, MCP servers, hook policy and
tiers load only from your own files (
~/.sarina/...). A workspace can add skills or MCP servers only with an explicit--trust-workspace-*flag, and a workspace policy file can only tighten. - Her behaviour files can require the owner's signature. Heimdall keeps a signed list of the files that
decide how she behaves (rules, tool connections, skills, agents). In
enforcemode she checks each one before using it: an unapproved skill, section, agent or tool connection is not used, and an unapprovedpolicy.jsonstops her. Files under/usrbelong to packages and are not checked. The mode is off by default (rust/sarina/src/trust.rs; Heimdall's docs/TRUST.md). - Heimdall can contain her. While Heimdall's lock
/etc/heimdall/containedexists she does not start (onlyversionandhelpanswer) and says how the owner releases her (Settings > Security, orsudo heimdalld contain release). The lock survives a restart (Heimdall's docs/CONTAIN.md). - Skills she may read. The section tools only open skills the model may start, or one the operator started; an operator-only skill stays closed to her.
- Troubleshooting is read-only first.
sarina doctorchanges nothing and never prints keys or tokens. The packagedecosystem-troubleshootskill (installed in/usr/share/sarina/skills, a root-owned directory a workspace cannot shadow) walks the agent from a doctor finding to a plan the operator approves; it cannot touch Heimdall, Limbo or Sarina's own safety settings on its own. - Honesty checks in code, not only in the prompt. Before an answer is accepted it is checked once against what actually happened in the task: a file it says changed that no tool changed (or a change it leaves out), tool work it describes when no tool ran, text it quotes that no tool output contained, or advice to turn off a security piece. Secret values read from files are blanked from answers.
- File tools protect your files. A file is never replaced unread, never erased or emptied, a binary
file is never written as text, and private folders (
SARINA_PRIVATE_DIRS) stay closed, also to searches. - Spoken questions change nothing. By voice she has read-only tools and her vault only; she gives you
the command instead of running it. The one tool that changes the real system,
system_fix, is a table of named user-level repairs behind--allow-shell. - Her agents run only in Limbo. No network, none of your files, no sudo; output is capped and labelled as untrusted evidence; you approve exact versions; there is no tool that approves anything.
- Tool-less sessions.
tool_allowlist: []on the service creates a session with zero tools and reports"tools": 0; the model request carries no tools.
python3 evals/run_evals.py runs about seventy checks against the real agent: understanding, honesty,
safety (injections, secrets, private folders), writing files, her vault, reverse engineering, Limbo,
troubleshooting and crash help, gaming (the setup check, Proton, mods, graphics memory, the repair tool),
spoken answers and companion talk. It writes a Markdown report and a JSON file; the
reports of my own runs are kept with my private plans, not in a repository. tools/training/ turns her real answers into
a review sheet you tick, and exports the ticked ones for fine-tuning (nothing is trained by itself).
Sarina runs on the local model first, moves to your desktop when the local one
is unavailable, too small or under pressure, and uses Claude as a last resort.
Configure ~/.sarina/tiers.json (or SARINA_TIERS_FILE):
{
"tiers": [
{"name": "local", "kind": "openai_compat", "base_url": "http://127.0.0.1:11434/v1", "model": "qwen3"},
{"name": "desktop", "kind": "openai_compat", "base_url": "http://192.0.2.20:11434/v1", "model": "qwen3:32b",
"allow_data": ["no_secrets"]},
{"name": "claude", "kind": "claude_cli"}
],
"resource": {"max_memory_percent": 90}
}Kinds: openai_compat, claude (Anthropic API, key from the environment variable
named in api_key_env) and claude_cli (hands the task to the local claude
executable). allow_data controls what may be sent to a tier: secret-shaped text
is redacted, and capture data is refused outright for no_captures. Each
escalation is printed and recorded in the session file. The old flags
(--escalate-to-claude-code, --claude-code-cli-path, --escalation-trigger,
--disable-resource-check) still work (rust/sarina/src/tiers/).
Long sessions stay usable on small context windows: a running notes file per
session is reused as the compaction summary when fresh, old large tool results
are cleared by size, and summarising compaction retries on overflow. Each piece
has a --no-... switch. The context window is read from the backend where it
reports one.
sarina service implements the integration contract other repos depend on
(bearer auth, /healthz, POST /v1/sessions, /chat, DELETE); see
docs/spec/05-gui-service.md. Callers cannot raise shell/write/backend
permissions above what the operator allowed, and a non-loopback bind needs a
token. sarina gui is loopback-only with Host/Origin checks and a per-launch
token, streams events, supports cancel, and asks for approval before write or
shell tools.
| Repository | What it is | Sarina's part |
|---|---|---|
| Labyrinth_OS | the gaming-focused OS (CachyOS base) | packages her (optional), voice, crash helper, daily check-up |
| Yggdrasil | the desktop (panel, Fylgja, Settings, Agora, Minos, compositor) | Super+S, Settings > Sarina's agents |
| LykanOS | the security edition (formerly Chymaera OS) | hosts her for security work |
| Heimdall | the security watcher | watches her sessions, reviews what she keeps, signs her behaviour files, can contain her; she reads its findings |
| Limbo | disposable virtual machines | where her validation runs and agents execute |
| Argus_App, Argus_Firmware | Flipper Zero desktop console and firmware (formerly Chymaera Zero) | read-only advisories, local control API |
| Kairos | frame generation for games | none (works without Sarina) |
| Daedalus_CAD, Icarus | CAD and vehicle tuning apps | none today |
The integration contract, ports and rules are in docs/ECOSYSTEM.md and
docs/spec/00-must-preserve.md. Hardware writes always need a human;
fleet-launch is CLI-only and never a model tool.
packaging/arch/ is the source of truth for the Arch package: the Rust binary as /usr/bin/sarina,
the sarina-gui / sarina-service symlinks, sarina-tone, the ML/voice helper (/usr/lib/sarina/sarina-helpers), the
systemd unit, sysusers and env template. See its README. Labyrinth OS and LykanOS install sarina-git, built by Labyrinth_OS's own
recipe (packages/pkgbuilds/sarina-git), which also installs sarina-voice and sarina-voiced.
The voice programs, the voice service, the ML/voice helper and the core are ported to Rust: a spoken question takes 4.2-7.1 ms instead of 52-80, a chat turn 24 ms instead of 68 (11 MB instead of 23). Every program, its numbers and where Rust is worse: docs/RUST_MIGRATION.md.
rust/ the agent (sarina-rs, installed as sarina; sarina-tone), its proofs against Go (rust/parity, testdata/parity;
the Go referee is built from the tag go-final)
docs/RUST_PORT.md the Rust port: what was proved, the differences on purpose
docs/spec/ behaviour specs the Go core was built from
docs/ECOSYSTEM.md cross-repo contract
docs/PROVENANCE.md licensing audit and rewrite progress
docs/AGENT_FORGE.md the agent forge: Sarina's own agents, run in Limbo
docs/ACCESS_LADDER.md what Sarina may do, tier by tier, and how the evals decide it
evals/ capability evals (run_evals.py)
tools/training/ review sheet and export of Sarina's answers for fine-tuning
tools/voice_clone/ the tools that train Sarina's own voice (their tests are in tests/)
packaging/arch/ Arch package, systemd unit, env template
packaging/helpers/ sarina-helpers (Rust): the ML and voice helper; PROTOCOL.md is the helper protocol
packaging/voice/ sarina-voice (Rust): the spoken-question programs, side-by-side tests with the Python
packaging/voiced/ sarina-voiced (Rust): the voice service
VERSION is Sarina's own version (1.0.0 since 2026-11-11, her first numbered release); her package is sarina-git VERSION-<build number>. How the numbers work and how to make a release: Labyrinth_OS docs/VERSIONING.md.
MPL 2.0. See LICENSE. The licence covers the current tree, which is a clean-room rewrite (see NOTICE.md).
Sarina can run shell commands and edit files when you allow it. Review what it proposes, keep it away from systems you do not own, and do not expose the service beyond loopback without a token.