| Install | Upgrade | Remove | |
|---|---|---|---|
| Pi | pi install npm:@hicaru/pi-rlm |
add --force |
pi uninstall npm:@hicaru/pi-rlm |
| oh-my-pi | omp plugin install @hicaru/pi-rlm |
add --force |
omp plugin uninstall @hicaru/pi-rlm |
- Install the plugin.
- Type
/reload, or restart Pi. - Make sure that
/rlm,/rlm-configand/rlm-stopshow under [Extensions]. - Push
Ctrl+Shift+Ror type/rlm. Your prompts now go to the RLM engine.
you ──► prompt ──► RLM engine ──► main model (Python in repl(), one turn at a time)
│ ├─► search / grep / outline (no tokens)
│ ├─► llm_query ──► cheap workers
│ └─► rlm_query ──► child RLMs (depth limit)
└──► state Σ + validation + limits (tokens, time, errors)
- The context stays in a Python sandbox. The model sees only an index.
- The main model writes Python code. The code finds the data that the model needs.
- Cheap worker models read and summarize. Your main model does not read the full text.
- A child RLM solves a difficult sub-task. It gets the full sandbox at no token cost.
- The engine keeps the run state
Σand validates each change to it. /compactmakes a digest of the session. It does not use an LLM.
The benchmark is OOLONG (oolong-synth): 24 tasks, context up to 65,536 tokens, temperature 0.
| Model | OOLONG | Tokens/task | Cost/task |
|---|---|---|---|
zai/glm-5.3 |
95.8% (23/24) | ~28k | ~$0.00 * |
b-ai/qwen3.8-27b |
91.7% (22/24) | ~37k | ~$0.00 * |
openrouter/google/gemma-4-31b-it:free |
pending | — | — |
The model list is in bench/panel.json. Each model has its own
results folder: bench/runs/<model>/. To run all models:
export ZAI_API_KEY=... BAI_API_KEY=... OPENROUTER_API_KEY=...
bun run bench --oolong-max-cl 65536 --oolong-limit 24For more data, see bench/README.md.
| Command | Shortcut | Function |
|---|---|---|
/rlm |
Ctrl+Shift+R |
Set RLM mode on or off |
/rlm-stop |
Stop the current run | |
/rlm-config |
Set sampling, budgets and limits |
The model can use only these retrieval and delegation functions:
search("needle", k=10) # BM25 hits in the context
grep_context(pattern, k=50) # regex hits with line numbers
outline(path) # definitions in a file
add_context("report.pdf") # add a PDF, DOCX, XLSX, EPUB, CSV or HTML file
llm_query(prompt) # send text to a cheap worker
map_files(paths, prompt) # ask one question about many files
rlm_query(task, paths=...) # start a child RLM
answer["content"] = "..." # write the final answer
answer["ready"] = True # end the run- The engine does not write to the disk. The answer is the only output of a run.
- API keys do not go into the sandbox. The host sends all sub-LLM calls.
- Python runs in a guarded subprocess with a list of reserved names.
MIT © hicaru contributors
