1 · Install Hermes
curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash
Don't let it jump straight into the setup wizard. At the end of the install, the installer automatically launches hermes setup — the full setup wizard with model/provider selection. Quit it now (Ctrl+C, or pick "cancel/exit") and come back here. The ppq provider isn't installed yet, so anything you pick in that wizard would just have to be redone. Finish steps 2–5 first, then select the ppq model in step 5. (Non-interactive or headless installs skip the wizard automatically.)
2 · Install the ppq plugin (from its GitHub repo)
The plugin is not yet in the Hermes plugin catalog, so install it manually from the repository. This copies the plugin files into Hermes' plugin directory:
git clone https://github.com/thepurpose-npub/ppq-hermes-provider
mkdir -p ~/.hermes/plugins/model-providers/ppq
cp ppq-hermes-provider/model-providers/ppq/{__init__.py,plugin.yaml} \
~/.hermes/plugins/model-providers/ppq/
3 · Get a PayPerQ account + API key
Pay-per-use, no subscription: top up from $0.10 (crypto or card), then grab a key.
- Fastest:
curl -X POST https://api.ppq.ai/accounts/create→ returns acredit_id+api_keyimmediately. Top up that credit_id at ppq.ai. - Or sign up in the browser at ppq.ai and create the key under API Docs.
Your key = sk-…. Keep it private.
⚠️ Save the credit_id the moment you fund it — it IS your ppq account. With the API path, the credit_id returned at account creation is the only thing identifying your account. If you fund it and then lose it, you can lose the funds and be locked out of the account. Either save the credit_id somewhere safe, or bookmark the ppq page URL (it contains the credit_id) so you can always return to the funded account. Do this before you top up, not after.
4 · Store the API key
Easiest (recommended): use Hermes' built-in credential manager. It prompts for the key, stores it in the credential pool, and shows a confirmation — no file editing, no risk of typos in a hidden file:
hermes auth add ppq
# → prompts: "Paste your ppq API key:"
# paste the sk-... key you got in step 3, press Enter, done.
Confirm it saved:
hermes auth list # should list a credential under "ppq"
Fallback if hermes auth add ppq isn't recognized on your install: run hermes config env-path | xargs nano and add the line PPQ_API_KEY=sk-... (your real key) at the bottom, then save.
Verify it loaded:
hermes plugins list # should show "ppq — PayPerQ — v0.3.0"
hermes auth status # should show ppq as ready (not missing/expired)
5 · Pin glm-5.3-flash as your only pinned model
The plugin's picker resolves pins in layers: your pins.json wins over any live/static defaults, so write exactly one entry.
mkdir -p ~/.hermes/ppq-plugin
cat > ~/.hermes/ppq-plugin/pins.json <<'EOF'
[
"z-ai/glm-5.3-flash"
]
EOF
Then launch hermes --tui, run /model and select the ppq provider — z-ai/glm-5.3-flash should be the only entry under its pinned section. Select it so it becomes the default.
glm-5.3-flash is not a trial/free model, so no bootstrap-credit fallback is configured here. If you'd rather browse the live catalog first, delete pins.json and the plugin falls back to a curated list of top chat models.
⚠ Before your first message — cost-rail check
If you skip model selection, Hermes does not guard you: its default model slot ships empty, and whatever the picker surfaces first gets billed at its full price. A fresh Hermes can land on a very expensive model — one missed /model step is all it takes. Verify all three rails before your first real message:
- Check the model line in the TUI header. On a fresh
hermes --tuilaunch the header shows the active model. It must readz-ai/glm-5.3-flash— if it shows anything else, run/model, open theppqprovider section, and select it as default. - Check the reasoning level. Run
/reasoningin the TUI. Hermes' default effort is medium — that is the recommended level: it balances quality against the per-request output cost. Raising it to high means noticeably more billed output tokens on every turn. - Check the cost. The TUI does not show a per-reply price. The status bar's cost field (opt-in via
display.show_cost) is only a running session estimate — and relay endpoints like ppq can shown/athere. The authoritative per-request cost is the ppq.ai account activity page: glm-5.3-flash should land at roughly $0.002–$0.01 per exchange. If you see single-digit-dollar numbers there instead of fractions of a cent, stop — you are on the wrong model.
Extra rails: keep a session per topic (/new between topics — long sessions bill more input tokens each turn — see the cost cheatsheet at the bottom); glance at ppq.ai's usage dashboard if something feels expensive; and never paste your sk-… key anywhere except hermes auth add ppq.
6 · Smoke test
hermes -z "Say hello in one sentence."
Should return a reply billed at roughly $0.002–$0.01 from your credit balance (glm-5.3-flash is $0.16/M input, $0.53/M output — very cheap). Check the ppq.ai account activity page afterwards: the request should show there, billed in the fractions-of-a-cent range.
This is a one-shot run — it prints the answer and exits, so it proves the key and model work without opening a full session. For daily use, run hermes --tui instead of -z.
7 · LLM handover — from here on, talk to Hermes
Once the smoke test works, you're done — hermes --tui starts Hermes, and from here on you just talk to it: vibe, explore, ask, build, work. The agent itself is the LLM interface. From here on you can:
- Just type questions/commands — Hermes plans and executes using its built-in tools (web search, files, terminal, etc.).
- Hand over any concrete task in plain language — e.g. "summarize this URL", "research X and give me 3 options", "write a script that does Y".
- Use
/newwhen switching topics, to keep sessions clean and cheap. /modelto switch models later (the plugin also exposes a live list from ppq's/v1/models).
Troubleshooting
| Symptom | Likely fix |
|---|---|
| /model shows nothing under ppq | pins.json malformed → fix or delete it; check hermes plugins list shows ppq |
| Auth error 401 | wrong API key → hermes auth list, re-add if needed |
| Insufficient balance | top up at ppq.ai (credit_id → Add Funds) |
| Cost shows unknown | the TUI status bar only estimates session cost (opt-in via display.show_cost) and stays n/a for relay endpoints — check the ppq.ai account activity page for the real billed amount |
💡 What to build first — a h launcher
Now that your Hermes instance is running, give it its first small job: a launcher so you don't have to type the full command to enter the TUI. Instead of hermes --tui, you just type h in the terminal and the TUI starts.
Hand this prompt to your running Hermes — it can build and install the tool itself:
Build a small tool so I can start the Hermes TUI by typing `h` in the terminal
instead of the full command. Install it so it works in new shells too.
Why this is a good first build: it's tiny and low-risk — and it proves the step-7 handover end-to-end: you asked in plain language, Hermes planned and built, no manual steps left for you.
Context & cost cheatsheet — how to keep sessions cheap
Running long sessions costs more than the model's sticker price suggests: every turn re-bills the whole accumulated context, so cost grows with cadence and carried context, not with how much you “did.” This sheet gives the mental model, the key numbers, and a handful of levers — cadence, delegation, and forking — that keep the bill predictable. Read sections 1–3 if you only have a minute; the rest is reference.
Use by hand or to teach someone. Re-verify the price anchor before big decisions. Written from the author's own Hermes workflow — levers, thresholds, and numbers are author-measured, not vendor documentation.
1 · The mental model (3 sentences)
- Every turn re-sends the whole conversation to the model — accumulated context is a recurring cost, not a one-time cost.
- The re-send is billed at cache price (1/5 of fresh) only if the previous turn is recent; after a gap of minutes the cache dies and everything re-bills at full fresh price.
- Output is the premium dimension: ~3.3× fresh input price; output+reasoning typically dominate the realized bill.
2 · Teaching version (one paragraph)
"Every conversation turn re-bills the whole accumulated context. Cache makes that 5× cheaper, but only if you don't pause for minutes. So: keep the main session lean (terse turns, batched calls, short outputs), push any big read into a throwaway subagent that returns a summary, and when the session has grown past ~10–15k tokens beyond its brief, split it at a natural break point with a written handover brief — the split costs cents, the carried context costs dollars. Measure real sessions in state.db instead of guessing, and re-verify prices before trusting the thresholds."
3 · The three decisions
(a) Inline — do it now in the main session: ≤ ~10 tool calls, no single read > ~35k chars (~8k tokens; ~44k chars if the child baseload is ~20k), low risk, no user input needed mid-flight.
(b) Delegate — push to a subagent: any bulk read > ~8k tokens (~35k chars) when ≥10 turns remain.
- Inline pays R fresh once + R × T × carrying-rate recurrence.
- Child pays R fresh once in its own short-lived context; parent carries only the ~2–3k-token summary.
- Worked example: 50k-char read over 20 turns → inline $0.0396 vs delegate $0.0109 — 3.6× cheaper.
- Delegate rules: self-contained goal+context (children see nothing of your conversation), verifiable handle for any external effect, ONE call with a tasks array for parallel items, children return SHORT results (≤ ~2k tok).
(c) Fork — /new with a handover brief: when context beyond the brief exceeds ~10–15k tokens with several turns remaining. The fork itself is nearly free; the real costs are human /new effort and working-state loss — both minimized by the brief convention.
- Fork only at natural break points: completed deliverable, topic switch, or all remaining items user-gated.
- Fork procedure: write
YYYY-MM-DD-handover-<slug>.mdwith Status+reason, bold kick-off formula ("read <file> and execute"), numbered open items with exact commands/paths, evidence paths. Then ask the user to /new and kick off. - Exception: do NOT fork a deliberate big read-only reference context queried in a tight loop — warm big-context loops are cheap.
Risk beats size: a tiny item touching secrets, destructive ops, or outward-facing sends is user-GO territory, never a cheap inline item.
4 · The numbers (ppq list prices)
| Thing | Value |
|---|---|
| Fresh input | $0.15825 /M tokens |
| Cache-read input | $0.03165 /M (= exactly 1/5 of fresh) |
| Output | $0.5275 /M list (realized rate can exceed list) |
| Cache-write fee | none (ppq) |
| Carrying cost of 1M context per turn (worked example @ f=0.66) | ≈$0.075/turn |
| Cache share f, interactive sessions | varies — measure yours |
| Cache share f, tight loops | high — measure yours |
| Fork (/new + brief) one-time cost | small — measure yours |
| Min-billing floor on tiny calls | ~1.8× list input rate |
state.db estimated_cost_usd | unreliable: excludes reasoning output |
f = cache_read / (fresh + cache_read) per session — computable from ~/.hermes/state.db, table session_model_usage.
5 · Cache TTL rule
- No published TTL (Z.ai: only "reasonable time limits, will recalculate after expiration"). Empirically minutes-scale.
- Treat any user gap > a couple of minutes as a full cache miss: the whole accumulated context re-bills fresh on the next turn.
- Consequence: dense bursts beat spread-out pacing — answer back-to-back, then fork at the break instead of idling inside a heavy session.
- Want a measured bound for your account? Needs per-call timestamps from the ppq usage CSV (the Hermes DB records none).
6 · Output discipline
- Terse main-session turns; require children to return short results.
- Batch tool calls into single turns — keeps the cache warm AND dodges the min-billing floor that makes tiny calls pay ~1.8× input rate.
- Output+reasoning is typically the largest share of the realized bill → the #1 lever after cadence.
7 · Anti-patterns
- Pre-summarizing a big file inline "to save tokens" — burns the context you are protecting. Delegate the read.
- Manual /new between every round — forks are cheap but each needs a brief; route work instead, fork only at natural breaks.
- Idling/polling in a heavy session waiting for a timer or a user test — time-gated work belongs to the NEXT session's kickoff.
- Trusting the DB cost estimate for billing — add ~10–15% for reasoning-heavy sessions; for € figures, use the CSV.
- Forking a warm big-context read-only loop.
- Sending a child a huge
contextblock duplicating your whole session — self-contained ≠ everything; give the goal, the exact paths, and the acceptance criteria.
8 · Measure, don't predict
sqlite3 ~/.hermes/state.db \
"SELECT session_id, input_tokens, cache_read_tokens, output_tokens,
reasoning_tokens, api_call_count
FROM session_model_usage ORDER BY rowid DESC LIMIT 10;"
# f = cache_read / (input + cache_read)
A task's context size cannot be assumed in advance — query what IS before tuning thresholds. Also check sessions.parent_session_id for actual child baseloads.
9 · Open caveats (honest unknowns)
- Thresholds are a snapshot — re-verify prices; no repricing alert exists.
- Child baseload ~15k unverified — measure it.
- Cache TTL unpublished; minutes-scale inferred from measured f, not from a vendor number.
- This sheet covers size/cost/risk routing only — privacy-sensitive work needs separate handling layered on top.