https://github.com/nosistech/nosis-harness
Metered, multi-model terminal agent for open-weight models, written in Rust.
https://github.com/nosistech/nosis-harness
ai-agent cli llm metering multi-model rust terminal
Last synced: 4 months ago
JSON representation
Metered, multi-model terminal agent for open-weight models, written in Rust.
- Host: GitHub
- URL: https://github.com/nosistech/nosis-harness
- Owner: nosistech
- License: mit
- Created: 2026-07-28T04:35:04.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2026-08-10T02:54:50.000Z (4 months ago)
- Last Synced: 2026-08-10T03:14:11.512Z (4 months ago)
- Topics: ai-agent, cli, llm, metering, multi-model, rust, terminal
- Language: Rust
- Homepage:
- Size: 1.07 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Security: SECURITY.md
- Agents: AGENTS.md
Awesome Lists containing this project
- Awesome-AI-Agents - nosis-harness - A terminal agent written in Rust that runs open-weight models across several providers and records the reported usage of each task.  (Applications / Autonomous Agent Task Solver Projects)
README
# Nosis Harness
**nh** is a metered terminal agent for open-weight models, written in Rust. It supports DeepSeek V4,
Kimi K2.x, MiMo V2.5, GLM, and local runtimes that you configure.
You select the execution route. The program never selects one for you. The `nh why` command
estimates the **cheapest capable API** route from the catalog, and it does not dispatch the task.
Every accepted run writes a local receipt. The receipt records the token usage that the provider
reported, and the cost that catalog prices give for that usage.
## What this program does on your computer
This section is for all readers.
- **It runs on your computer.** There is no account, no sign-up, and no server that we operate.
- **It sends no usage data to us.** There is no telemetry. We cannot see what you do.
- **It speaks only to the services that you configure.** These are your AI providers, and any tool
servers that you add yourself. It contacts nothing else. Price data ships with the program; it is
not fetched.
- **Your API keys go into the operating system credential store.** The program does not write them
to files. It does not print them. It removes key-shaped text from what it shows you.
- **It asks before it runs a command.** The default answer is no. Piped input cannot approve a
command for you.
- **It shows the cost of each call.** When a provider does not report a number, the program says so.
It does not guess and it does not fill in a zero.
- **Files stay on your computer.** Receipts and run records go into a local `.nosis/` folder that
you can delete at any time.
- **The optional MCP server is off by default.** When you start it, it listens only on your own
machine and it needs a token.
- **Windows is supported. macOS is in testing. Linux is not yet verified.** See
[Platform status](#platform-status) below. We do not claim what we have not tested.
For the technical detail behind each point, read [SECURITY.md](./SECURITY.md) (the security model,
the audits, and how to report a problem) and [PRIVACY.md](./PRIVACY.md) (what leaves your machine).
## Install (from source)
`nh` is a source install. This release attaches no prebuilt binaries.
Prerequisites: the Rust toolchain, **1.96.0 or newer**. Get it from [rustup.rs](https://rustup.rs).
One command builds `nh` and puts it on your `PATH`:
```sh
cargo install --locked --git https://github.com/nosistech/nosis-harness nh-cli
```
The binary lands in `~/.cargo/bin`, which `rustup` already added to your `PATH`. Note that
`cargo install` uses your default toolchain and does not read this repo's `rust-toolchain.toml`.
Check `rustc --version` first if the build fails.
To work on the code instead, clone the repo and build in place. Here `rust-toolchain.toml` does
apply, so `rustup` selects **1.96.0** for you:
```sh
cargo build --release
```
That binary lands at `target/release/nh` (`target\release\nh.exe` on Windows).
## Quickstart
- `nh init` - scaffold `.nosis/` in the current repo: the receipts dir, a `.gitignore`, a secret-pattern pre-commit hook, and the trusted bundled `catalog.toml`. A changed repository catalog is refused unless the operator has placed an exact reviewed copy at `~/.nosis/catalog.toml`. Existing Git hooks are preserved and reported for manual chaining.
- `nh doctor` - report what is set up and what is not. It needs no API key. It names the running binary, whether `nh` is on your `PATH`, where the route catalog was read from, how many routes and providers are available, which key entries are stored, and where configuration lives. On Windows it also reports the console code page. It then lists only the things that are wrong, and each line states the fix. It never prints a key value. It exits 0 whenever it can produce a report, because it is a report and not a test.
- `nh why "review the diff"` - explain the cheapest capable route for a rough token estimate of the task; add `--model ` to compare a specific route against it. It needs no API key, and it does not run the task. Prices come from the catalog that ships with the program.
- `nh key add deepseek` - prompt for your DeepSeek API key and store it in the OS-native vault (never echoed, never written to files). For CI/headless use, the env fallback is `NH__KEY` with the entry uppercased - here, `NH_DEEPSEEK_KEY`.
- `nh key remove deepseek` - remove that entry from the OS-native vault. Environment fallbacks must be unset separately.
- Local Ollama and llama.cpp routes are user-filled, loopback-only, and selected only through
`--model` or `/model`; they never become cheapest-capable candidates. See
[Local models](./docs/LOCAL_MODELS.md) for setup, the Ollama truncation warning, model
verification, licensing, and hardware sizing.
- `nh run "fix the failing test" --model deepseek-v4-flash` - run one agent task. Every shell command stops at a y/N approval prompt (default **deny**), and each turn is logged to `.nosis/receipts.jsonl`. Defaults: `--model deepseek-v4-flash`, `--max-turns 20`, `--profile balanced`. Optional: `--think none|low|high|max` (absent = per-route-dialect default: High on always-thinking dialects, None on non-thinking) `--autonomy ask|auto` (absent = the law-file default), and `--image ` to attach a PNG or JPEG (repeatable, maximum 4) on a route whose catalog entry declares image support.
- `nh chat` - interactive session. `/model` and `/provider` switch routes mid-session (history and cumulative usage preserved); `/price` evaluates the catalog price at the current clock time and flags stale data.
- `nh profile` - list the execution profiles (frugal / balanced / max-quality) and their effective caps for a model.
- `nh tui` - full-screen terminal UI (`--model `, `--budget `, `--profile
`).
- `nh resume` - resume an interrupted chat or TUI session. Pass a session id, or omit it to list the interrupted sessions.
- `nh fleet run tasks.json` - run independent tasks in a durable, resumable worker fleet (`--max-workers `, required `--budget ` unless `budget_tokens` is in the file, `--escalate`, `--defer-offpeak`). The observed-token budget stops new dispatch after completed receipts reach it; already-running calls can finish. Off-peak deferral activates only for a trusted route whose catalog entry currently defines peak windows. `nh fleet resume` picks up the latest incomplete run.
- `nh mcp serve` - **PREVIEW**: serve the local MCP endpoint (default `--addr 127.0.0.1:8765`), loopback-only and bearer-token guarded (`--token-entry `). Tools: `why`, `route_cost`, and `receipts` (the metered-routing surface, with structured output), alongside `route_resolve`, budget-required `fleet_run`, and `fleet_status`. Do **not** expose it on a public interface - this is not a restriction that lapses on a date.
## Platform status
Windows is **supported**: CI is green and it is in daily use. macOS is **in testing**: CI is green,
but no one has used it day to day. Linux **builds from source and is not yet verified**.
## Privacy
`nh` has no Nosis-operated telemetry, analytics, beacons, or crash reporting. Model requests go directly to the provider route you select; approved MCP calls and shell commands can create additional network traffic. Receipts are local by default. Exact boundaries and deletion steps are in [PRIVACY.md](./PRIVACY.md).
## Runtime files
Apart from the configuration and Git hook created by an explicit `nh init`, the harness
does not generate source code or caches of its own. Normal runs append the intentional,
gitignored audit state in `.nosis/receipts.jsonl`; `nh chat` and `nh tui` additionally write
resumable session transcripts to `.nosis/sessions/`, and Fleet uses `.nosis/fleet/`.
These append-only records grow until the operator deletes them. Agent-requested edits and
approved shell commands can change other workspace files by design.
## License & contributing
MIT © nosistech LLC - see [LICENSE](./LICENSE). Security policy and reporting: [SECURITY.md](./SECURITY.md). How to contribute (including the workspace gate): [CONTRIBUTING.md](./CONTRIBUTING.md). Release history: [CHANGELOG.md](./CHANGELOG.md).
## Repository layout
- `crates/`: the Rust workspace. Each crate has one responsibility.
- `catalog.toml`: the route catalog. This file is data, not code.
- `docs/`: the architecture overview, the security model, and the local-model guide.