Sabi

Per-round model, effort and provider routing that reserves strong capacity for the rounds that earn it.

Source repo
vizuh/sabi
Stars
★ 17
Last updated
26d ago
License
MIT
Primary language
TypeScript

At a glance

How it runs
CLISelf-hosted serviceAgent plugin / skill
Works with
Portable with changesOpenAI API · Claude APICodex · Claude Code (Partial support)
Cost
Free software; you pay for model usage
Setup effort
Medium · a few setup steps
You'll need
Node.js 22npm@vizuh/sabi-controller (controller-v0.1.8)Shell / CLINetwork accessLocal filesystem
Typical use
A developer on a Claude Code or Codex subscription who wants exploration and verification rounds to drop to cheaper tiers while failures and recovery keep strong models.
Not a fit if
  • Teams on hosts without a Sabi adapter and unwilling to build one
  • Teams expecting a proven universal cost or quality guarantee
  • Air-gapped setups that cannot call any hosted model
Source review
77/100 · Good

What does this agent do, and when should you use it?

Sabi is a routing layer that sits between a coding harness and the models it can call; it is not another agent harness and does not take over the host's loop, tools, permissions, history or approvals. Through adapters it reads trajectory evidence — tool calls, results, failures, context pressure, capability declarations and provider state — and decides per inference round whether the cheap, mid or strong tier should serve. It ships in two families: inference adapters (a Command Code in-process mod and a local OpenAI-compatible proxy) and controller adapters (hooks that continue, delegate or spawn bounded targets across Claude Code, Codex, OpenCode and Orca). Installation is a global npm package, @vizuh/sabi-controller, with sabi serve exposing a proxy at http://127.0.0.1:8787/v1 and sabi setup installing user-scoped hooks and a daemon. Every served round records a route receipt showing the planned tier, the model that actually served, and why they differ, and a local /dashboard reports free-lane hit rate, cost, latency and per-model health. Sabi is MIT licensed and requires Node.js ≥22.

Sabi accepts host events or HTTP requests on POST /v1/chat/completions, POST /v1/messages and POST /v1/responses. A deterministic policy classifies the round (exploration, implementation, verification, failure, stuck/context-pressure, transport, capability, output-capacity), applies capability and transport gates, and selects a cheap/mid/strong tier. On ambiguous proxy rounds only, an optional Jev judge picks among valid choices, falling back to deterministic policy on timeout, invalid answers or missing credentials. With auth: passthrough, Sabi holds no credential: it rewrites only the model field and forwards streaming frames to the provider the harness credential belongs to. Refusals are handled by kind — a missing key variable yields a 502 naming the variable and never its value, 401 moves off that provider, a 402/403 plan restriction is remembered for six hours, a 429 skips the shared quota pool, and cross-tier retry requires transportFallback.enabled. The proxy dashboard reports free-lane hit rate, rounds recovered by fallback, known cost, latency and per-model health over 24h, 48h or 7 days, and sabi surplus review runs read-only shadow QA over a bounded tracked diff with receipts storing hashes and counts rather than the diff.

  1. A developer on a Claude Code or Codex subscription who wants exploration and verification rounds to drop to cheaper tiers while failures and recovery keep strong models.
  2. A team plugging OpenRouter or Ollama credentials into any client that accepts a baseURL and speaks the OpenAI-compatible API.
  3. Command Code users who want native per-round model and reasoning-effort switching without provisioning a separate provider key.
  4. An engineering lead who wants to inspect per-round cost, latency, free-lane hits and fallback counts locally before committing to a budget.
  5. A maintainer coordinating continue/delegate/spawn handoffs across Claude Code, Codex, OpenCode and Orca through controller hooks.
  6. A team running a zero-cost fixed lane as explicit, read-only shadow QA against its own tracked diff without touching primary work.

How do you install or deploy this agent?

Sabi installs at user scope, not per worktree. You need Node.js ≥22 and npm.

npm install --global @vizuh/sabi-controller
sabi setup
sabi doctor
sabi serve

sabi serve starts the local proxy at http://127.0.0.1:8787/v1. To run the daemon without touching host configuration:

sabi setup --no-hooks

For native per-round model and effort switching inside Command Code, install the mod separately (no Sabi provider key needed):

cmd mods add -g npm:@vizuh/sabi-commandcode
cmd mods list

To let a host AI do the install, add the skill first:

npx skills add vizuh/sabi --skill sabi

How do you use this agent?

On the proxy path you declare upstreams and tier models in config and supply your own OpenRouter, Ollama or other credentials. To opt into the zero-priced quality lane, set OPENROUTER_API_KEY and run:

sabi setup --free-quality

To borrow the harness's own credential, repoint its baseURL at Sabi; Sabi opens no credential file and writes nothing to disk:

ANTHROPIC_BASE_URL=http://127.0.0.1:8787 claude
{
  "upstreams": { "anthropic": { "baseURL": "https://api.anthropic.com", "auth": "passthrough" } },
  "models": { "cheap": { "upstream": "anthropic", "model": "claude-haiku-4-5" },
              "mid": { "upstream": "anthropic", "model": "claude-sonnet-4-5" },
              "strong": { "upstream": "anthropic", "model": "claude-opus-4-1" } },
  "passthrough": { "alias": "sabi-code" }
}

Open http://127.0.0.1:8787/dashboard for route receipts and cost. Shadow QA and upgrade checks:

sabi surplus inventory
sabi surplus review --intent=bug-hunt
sabi updates --check
sabi upgrade

What are this agent's strengths and limitations?

Pros
  • Decides per round rather than per request: the README shows a round table where failures and recovery go strong while a passing verification drops back to mid.
  • Keeps two boundaries explicit and refuses to conflate them — a hook install is not native model switching and a catalog listing is not plan entitlement.
  • On the borrowed-auth path Sabi holds no credential, opens no credential file, writes nothing to disk, and only calls the provider the harness would have called.
  • Refusal handling is typed per case: missing key returns a 502 naming the variable but never its value, 402/403 is remembered for six hours, 429 skips the quota pool.
  • The local dashboard and route receipts expose planned tier, actual serving model and the reason they differ, alongside cost and latency.
  • MIT licensed, with several documented entry points: CLI, local OpenAI-compatible proxy, Command Code mod and multi-host controller hooks.
Limitations
  • The README explicitly ships no universal savings claim; its 71.7% figure is an allocation estimate at fixed rates, not a measured quality or cost result.
  • Native reasoning-effort switching exists only on the Command Code mod path; the proxy only routes model and provider.
  • Controller hooks do not switch the model inside an existing host session, and Claude Code/Codex support is limited to continue/delegate/spawn coordination.
  • The proxy path requires your own OpenRouter, Ollama or other provider credentials plus explicit tier configuration, which is more work than a one-command install.
  • Some documented rates were verified on 2026-09-18 and the worked example ignores cache discounts, provider minimums and retries, so figures need rechecking.
  • Support is reported in evidence layers (source/tests, protocol test, live smoke, completed-task evaluation), so most adapters' strongest claims still need independent verification.

How does this agent compare with similar options?

The README frames Sabi against a fixed router: a fixed router decides once from the request for the whole task, whereas Sabi decides each round from what actually happened in the trajectory. It also notes that an all-mid fixed model would cost about $0.0242 on its worked example versus about $0.0605 for the adaptive mix, so the goal is reserving strong capacity for evidence-backed rounds rather than being cheaper on every task.

Key facts side by side with the most closely related agents.

Agent Source review Form / cost Stars Updated Language Full support on
Sabi This agent 77 · Good CLIFree + model costs ★ 17 26d ago TypeScript OpenAI API · Claude API
Pilotfish Multi-Model Orchestration 81 · Good Agent plugin / skillFree + model costs ★ 710 17d ago Python Claude Code
Klaat Code 61 · Some gaps CLIFreemium ★ 353 1mo ago TypeScript —
Pi Dynamic Workflows 88 · Good Agent plugin / skillFree + model costs ★ 556 20d ago TypeScript —

How does FollowAgents rate this agent?

FollowAgents source review · FARS-2.1
Good
77/ 100 5-point scale 3.9 / 5
Trust 19/29
Reliability 11/14
Adaptability 15/18
Convention 16/18
Effectiveness 9/13
Verifiability 7/8
Why each dimension lost points
Trust19 / 29 · 3.3/5

The evidence shows unusual candor about security boundaries: docs/security.md openly admits the inference proxy has no credential auth (origin check only), the controller daemon uses a 256-bit bearer token with timingSafeEqual, logs use allowlists with 0600/0700 modes, the install flow requires stating exact files and obtaining confirmation before host changes, and connect scripts default to refusing paid upstreams in non-interactive runs. Deductions: least_privilege — the proxy remains callable by any local process to spend paid credits and SABI_HOST can bind off-loopback; external_effects — real third-party egress (OpenRouter, TypeSafe Jev judge) and a terminal dispatch path exist, fixed but with blast radius depending on an unconfirmed external host; sensitive_data_handling — keys rely on file permissions only, no at-rest encryption, and saveOpenRouterKey has a TOCTOU window; dependency_security — zero runtime deps and read-only CI permissions, but no lockfile audit or dependency scanning evidence; rollback — backups and uninstall notes exist but no unified rollback script; source_attribution — MIT with author attribution, but publisher identity is unverified by the FollowAgents registry.

Reliability11 / 14 · 3.9/5

self_consistency — docs largely match code and the security review even records its own fixes being superseded and corrected, but README and install docs differ slightly on whether the controller package contains the proxy server (README says sabi serve is available; install says the controller package does not contain the proxy server), a minor inconsistency; dependency_availability — requires Node 22.6+, a global npm package, and several optional hosts, with external dependencies (OpenRouter, TypeSafe, Hermes, Command Code) outside repo control; failure_messages — strong, with documented ECONNREFUSED, 403 MODEL_NOT_IN_PLAN, 400 modality refusals, and config-not-found listing every searched path, hence 3.

Adaptability15 / 18 · 4.2/5

audience_and_scenarios covers Command Code, OpenCode, Hermes, Claude Code, Codex, Orca with native vs proxy paths distinguished, hence 3; capability_boundaries clearly separates Class A/B, states hooks are not model switching and catalog listing is not plan entitlement, hence 3; trigger_precision has a clear routing rule table (exploration→cheap, failure→strong, etc.) but Jev judge trigger conditions and ambiguity handling are scattered across docs and depend on host signals, hence 2; environment_fit defaults to loopback and supports WSL/containers with explicit warnings about off-loopback binding, and POSIX permission bits do not apply on Windows, hence 2.

Convention16 / 18 · 4.4/5

information_architecture has a clear repo map, multilingual READMEs, llms.txt and layered docs, hence 3; install_notes separate user-level install, maintainer checkout, per-host commands and completion checks, hence 3; naming_stability — aliases like sabi-code/sabi-cheap are stable, but dual package lines @vizuh/sabi and @vizuh/sabi-controller with separate controller-v* and v* tags are confusing, hence 2; examples_and_faq include a 60-second mental model, round table, cost estimate example and troubleshooting table, hence 3; known_limitations are extensive with dedicated decisions and security docs listing non-claims and open gaps, hence 3; license is full MIT, hence 3; versioning_changelog mentions controller-v0.1.8 and has release workflows but no standalone CHANGELOG file, hence 2; maintenance_responsibility has a SECURITY.md reporting channel and maintainer contract, but publisher identity is unverified and the line is 0.x pre-stable, hence 2.

Effectiveness9 / 13 · 3.5/5

output_usability — the proxy returns OpenAI-compatible responses and rewrites the model field back to the alias, with readable decision logs and report/dashboard, hence 2 (no full end-to-end output sample shown); marginal_value — the author concedes adaptive tiering does not guarantee beating fixed mid, and the cost example shows savings vs all-strong but higher cost than all-mid, so the value proposition is conditional, hence 2; cost_benefit — transparent rate examples and separately accounted judge overhead exist, but no universal savings claim and no completed-task cost/quality measurement, hence 2.

Verifiability7 / 8 · 4.4/5

claim_traceability — most README claims map to docs/security.md, docs/install.md, the security review and test files, with verification dates, hence 3; cross_source_corroboration — the security review and security.md corroborate each other, but the review is self-conducted and some conclusions (e.g. Orca host reachability) are explicitly unconfirmed, with no independent external corroboration, hence 2; fact_inference_separation — docs repeatedly separate evidence layers (source/tests/protocol tests/live smoke/completed-task evals) and state mock success is not savings, hence 3.

Risks and how to mitigate them
  • The inference proxy has no credential authentication, only a Host/Origin loopback check; any local process can spend configured paid credits, so never bind SABI_HOST off-loopback.
  • The Jev judge sends last_instruction and tool-result excerpts to api.typesafe.ai; set judge.enabled: false explicitly if third-party egress is unwanted.
  • Publisher identity is unverified by the FollowAgents registry and the project is 0.x pre-stable; verify versions and changes before upgrading.
  • The security review is self-conducted and some conclusions (e.g. Orca dispatch host reachability) are explicitly unconfirmed; do not treat it as an independent audit.
  • Keys are protected by file permissions only with no at-rest encryption, and saveOpenRouterKey has a TOCTOU window; be cautious on shared hosts.
Evidence confidence: Low Reviewed Oct 26, 2026 Reviewed revision d8c2a103f4c6
See the full review method →

FAQ

Does Sabi replace my coding agent?
No. Sabi is a host-agnostic routing layer; the harness keeps its own loop, tools, permissions, history and approvals. Sabi makes one bounded decision at the seam the host exposes and does not fork the host loop, replay tools or silently rewrite permissions.
Will it actually save money?
There is no universal savings claim yet. The README's roughly 71.7% reduction is a routing allocation estimate at illustrative rates, and in the same example a fixed mid model is cheaper. The production claim would need cost per completed task, success rate, escalation precision and router overhead measured on a fixed task set.
Does it need my API keys?
It depends on the path. The BYOK proxy needs your own OpenRouter, Ollama or other credentials. On the borrowed-auth path Sabi holds nothing: it forwards the credential the harness already sends to the provider that credential belongs to, and an upstream declared auth: passthrough may not declare an apiKey.
What happens when a provider refuses a request?
Handling is typed. A missing key variable means no call and a 502 naming the variable; 401 leaves that provider for the next tier; a 402/403 plan restriction is remembered for six hours and routed around; 429 skips that quota pool for the round; anything else retries the next tier for that round only. Cross-tier movement needs transportFallback.enabled.
Which hosts are supported?
Documented paths are the Command Code native mod (per-round model and reasoning effort), the local OpenAI-compatible proxy, a DeepSeek Harness adapter that is inference-only with no lifecycle claim, and controller hooks for Claude Code, Codex, OpenCode and Orca task/session coordination. Other hosts require writing an adapter against the maintainer contract.
View on GitHub ↗ Install ↓

Compare agents like this one

The same FARS review applied across the shortlist this agent qualifies for.

Related agents