📈 GH Trending Explorer 🎲 Surprise me

← all repos

Chengjun023 / agent-smith

git clone https://github.com/Chengjun023/agent-smith.git

Token 超支?快给史密斯打电话! Better Call Smith. Adaptive model routing, a glassy Codex usage monitor, and reproducible benchmarks with receipts.

+0
stars, 24h · #32,535
+~0
stars, 7 days · #33,010
+301
stars, 30 days · #1,694
301
★ total
5
forks · 0 open issues

Star history (as recorded here)

2026-10-20 · 301 ★ 2026-10-21 · 301 ★
LanguagePython
LicenseMIT
Created2026-09-30 (22d ago)
Last push21d ago
Watchers4
OwnerUser

GitHub topics

Links

README excerpt
# Agent Smith · 史密斯专员
**Token overspending? Better Call Smith.** 
*The most expensive model need not appear in every court hearing.*
完整中文说明 · Architecture · Engineering notes · Roadmap
Still calling your most expensive model to fix a comma? Agent Smith takes the case.
Built by Chengjun, Agent Smith pairs a local Codex model router with a native floating usage monitor and reproducible benchmarks. Routine work gets a lighter model; difficult cases bring in the heavy hitters. Every claim comes with receipts.
Two components live here:
| Component | Current version | Job |
| --- | --- | --- |
| Adaptive Router | 0.3.0 | Local model selection, preferences, evidence-backed acceptance, and reproducible benchmarks |
| Codex Float | 0.5.0 | A native macOS floating window for local Codex tasks, agents, usage, and reference costs |
This is an independent personal project. The logo-head lawyer ad is an AI-generated Better Call Saul parody; artwork and source credits.
## See the bill of materials
*A native Float demonstration using synthetic task names and usage data; these rows are illustrative.*
Float keeps the useful bits in view: blue reasoning effort, green/yellow/red difficulty, orange token counts, and green Astra-equivalent savings. Resize the glass window, adjust transparency and text size, and switch between current-turn and cumulative usage. Expand a task to inspect its child agents and routing evidence.
The official Codex databases are opened read-only. Float writes its own numeric SQLite ledger, including thread/request IDs and read checkpoints, to deduplicate usage across restarts and log rotation. Conversation bodies and reasoning text stay out of that ledger. Missing usage or prices stay unknown; each metered request keeps its original price snapshot.
## Objection: the router has receipts
Difficulty is a local, uncalibrated 1.0–10.0 heuristic in 0.1 steps. Scoring, metering, and price comparisons add no model calls. Two optional preference questions cover your priority—quality, balance, cost, or speed—and your usual work.
The router can discover new entries from models.dev on a TTL, keep a last-good snapshot, and admit candidates using local price, capability, endpoint, and host evidence. Discovery does not grant execution access. Execution currently uses Codex; other providers are catalog metadata.
An enabled task routes independent work blocks through native subagents. A skill cannot switch the main task's model halfway through its generation. Dispatch and acceptance are separate: `accepted`, `rejected`, and `unknown` have explicit evidence semantics. Benchmark feedback stays outside production learning.
## The pilot: small enough to cross-examine
Six public synthetic tasks × three strategies × one attempt: **18/18 passed** the deterministic graders.
| Strategy | Accepted | Actual tokens | API Standard reference USD |
| --- | ---: | ---: | ---: |
| Fixed Astra | 6/6 | 102,162 | $1.237460 |
| Fixed 6.1 Sol | 6/6 | 105,285 | $0.1921092 |
| Loca