All plugins

perf-lab

Proof for speed-ups. When you ask Hermes to make code faster, Perf Lab times it before and after, fingerprints the output so a faster-but-wrong change is rejected, profiles Python with a flame graph, and enforces it with hooks: no code edits before a baseline, no finishing before a re-measure, and the plugin's own measured result appended under the reply. Disclosure — perf_bench and perf_profile run the command the agent passes on your machine, so every run first goes to Hermes' approval prompt (in any chat; "always" trusts one project folder; it fails closed and is skipped only when Hermes approvals are off); the command runs without a shell and with a minimal environment (PATH, HOME, locale, temp and interpreter/venv variables, no API keys), must be an interpreter running a script, and inline code is refused, but an approved script runs with your permissions as it would in the terminal. In chats about speed, its hooks add a short rules note to the turn, block write_file/patch on code files until a baseline exists (at most twice per file), ask for one re-measure if code changed, and append a clearly labelled Perf Lab section under the reply without rewriting the agent's text; a Gatekeeper switch in the pane turns the hooks off. It stores commands, timings, output fingerprints, the first 200 KB of each run's stdout, profiles and per-chat state under plugin-data/perf-lab, makes no network calls and sends no telemetry.

Murali-lnsToolsv0.1.0Updated 5 days ago

About

Proof for speed-ups. When you ask Hermes to make code faster, Perf Lab times it before and after, fingerprints the output so a faster-but-wrong change is rejected, profiles Python with a flame graph, and enforces it with hooks: no code edits before a baseline, no finishing before a re-measure, and the plugin's own measured result appended under the reply. Disclosure — perf_bench and perf_profile run the command the agent passes on your machine, so every run first goes to Hermes' approval prompt (in any chat; "always" trusts one project folder; it fails closed and is skipped only when Hermes approvals are off); the command runs without a shell and with a minimal environment (PATH, HOME, locale, temp and interpreter/venv variables, no API keys), must be an interpreter running a script, and inline code is refused, but an approved script runs with your permissions as it would in the terminal. In chats about speed, its hooks add a short rules note to the turn, block write_file/patch on code files until a baseline exists (at most twice per file), ask for one re-measure if code changed, and append a clearly labelled Perf Lab section under the reply without rewriting the agent's text; a Gatekeeper switch in the pane turns the hooks off. It stores commands, timings, output fingerprints, the first 200 KB of each run's stdout, profiles and per-chat state under plugin-data/perf-lab, makes no network calls and sends no telemetry.

Perf Lab for Hermes

Proof for speed-ups. When you ask Hermes to make code faster, Perf Lab measures the
code before and after, checks the output did not change, shows where the time goes as a
flame graph, and makes the measuring unskippable with hooks. The numbers under the reply
come from the plugin, not from the model.

Community plugin, not an official Nous Research product. MIT licence.

Faster, same output

Rejected: faster, but the output changedWhere the time goes
RejectedFlame graph

Screenshots are frames from a live Hermes Desktop session (real agent, real measurements) on the bundled
demo script. In the rejected frame the footer appears twice: that was a bug, fixed in this version.

What it does

MomentWithout Perf LabWith Perf Lab
Agent edits the code straight awayNothing to compare against laterEdit is blocked until a baseline is measured
Agent says "done, 10× faster"You take its wordThe turn is held until it re-measures; you see the plugin's number (say 6.8×) and a correction
The faster code gives different resultsYou may never noticeRejected: "output changed", with the first differing lines
The difference is just noiseReported as a win"No real change": 90 % of before/after run pairs must agree

In the Desktop pane (⌘K → Perf Lab: Open / close, or the status-bar chip):

  • a verdict card: before → after, speed-up, output identical ✓ / changed ✗
  • every timed run as a dot, so you can see for yourself whether the speed-up is more than noise
  • a flame graph (click a bar to zoom) with the hottest function in red, and a top-5 list
  • history of median times per script

How it works

Tools the agent calls

  • perf_bench(command, cwd, runs=5, warmup=1, ignore_patterns=[], compare_files=[], set_baseline=false)
    runs the command N times without a shell, records the median and a fingerprint of the
    output (stdout + exit code + any compare_files). The first run of a command is the
    baseline; later runs are compared with it.
  • perf_profile(command, cwd) samples a Python command's call stack. Uses py-spy if it is
    installed, otherwise a built-in stdlib sampler (no native code, nothing to install).
  • perf_skip(reason) turns the gate off for one chat when code truly cannot be timed. The
    reason is printed under the reply, so skipping is never silent.

Hooks (only in chats about speed, only while the Gatekeeper switch is on)

HookWhat it does
pre_llm_callSpots a speed request ("slow", "faster", "optimise", ...) and gives the agent the rules
pre_tool_callBlocks write_file / patch on code until the project has a baseline
post_tool_callRecords edited files so earlier numbers become "out of date"
pre_verifyKeeps the turn going if code changed after the last measurement (max 2 nudges)
transform_llm_outputAppends the measured result and corrects speed claims that disagree by more than 20 %

Every hook catches its own errors and fails open: a Perf Lab bug never blocks your work.

Verdict rules (deterministic, perf_core.compare)

  • faster: output identical and at least 90 % of before/after run pairs favour the new code and it is at least 5 % quicker. It compares the quickest half of each set of runs, because background load only ever adds time (the reasoning in Python's timeit docs), so a slow outlier cannot hide a real speed-up and one lucky run cannot invent one
  • changed_output: output differs from the baseline, whatever the speed
  • no_change: the before and after times overlap too much to call
  • inconclusive: the median moved, but the machine was too noisy to prove it (more runs, quieter machine)
  • slower, failed, unstable_output (output differs between runs of the same code; add ignore_patterns for timing or date lines)

Install

hermes plugins install Murali-lns/perf-lab --enable

Then in Hermes Desktop: Settings → Plugins → turn on the Perf Lab desktop half (package
halves start off). Restart the Hermes gateway once so the tools and the pane backend load.

For development: ln -sfn ~/hermes/perf-lab ~/.hermes/plugins/perf-lab && hermes plugins enable perf-lab.

Try it

examples/backtest/backtest.py is a deliberately slow moving-average backtest (about 1.3 s).
In a chat: "examples/backtest/backtest.py is slow, make it faster without changing results."

Safety and privacy

  • Asks before every run. perf_bench and perf_profile run the command on this machine, so
    Perf Lab's pre_tool_call hook sends each run to Hermes' approval prompt, whether or not the
    chat is about speed. Answering "always" trusts Perf Lab runs in that one project folder. If the
    approval cannot be prepared, the run is blocked. With Hermes approvals turned off
    (approvals.mode: off or yolo), runs go ahead without a prompt, like every other approval.
  • No secrets in the child. The command runs with a minimal environment: PATH, HOME, locale,
    temp dirs, and the virtualenv, conda, uv, node, ruby, julia and R variables it may need. API
    keys, tokens and anything else in the Hermes environment are not passed on.
  • Runs only a script through an interpreter. The program must be an interpreter (python,
    node, ruby, uv run <interpreter or .py>, ...), never a shell, checked by its file name.
    Inline code is refused anywhere in the command, including joined and bundled forms (-c, -e,
    -cprint(1), -uc, --eval=, node --run), as are deno eval, bun x and remote URLs. These
    checks keep the command honest; the approval prompt is the safety gate. An approved script can
    do anything you can, exactly as when the agent runs it in the terminal.
  • Local only. No network calls, no telemetry, no credentials read.
  • What is stored in $HERMES_HOME/plugin-data/perf-lab/: commands, run times, output
    fingerprints, the first 200 KB of each run's normalised stdout (to show what changed),
    profiles (function names and file paths), and per-chat gate state keyed by a hash of the
    chat id. Forget in the pane deletes a script's data.
  • Edits replies. transform_llm_output appends a clearly labelled Perf Lab section to the
    agent's reply. It never rewrites the agent's own text.

Development

~/.hermes/hermes-agent/venv/bin/python -m unittest discover -s tests -v
hermes plugins validate . && hermes plugins doctor .

The tests are written against the behaviours above (faster + same output, changed output,
noise, wrong claims, blocked edits, held "done", command allowlist, fail-open hooks).

README from the reviewed commit 5fd7214; it updates when the author re-pins.

More by Murali-lns

2 plugins by Murali-lns in the catalog.

Developer Mode

Explore built-in Hermes toolsets and actions.

HermesAgent

Developer?

Create a Hermes extension for Desktop or agent workflows.

Developer Section