RLM in this repository follows a simple loop:
- A root model produces Python code.
- Code executes in a persistent REPL environment.
- Code can call a sub-model (
llm_query) for delegated work. - The run terminates when
Finalis assigned.
Run the minimal deterministic demo (no model downloads):
cd rlm
python run_minimal.pyExpected output includes:
answer: ...iterations: 2sub_lm_calls: 1
docs/LEARN_RLM.mddocs/PAPER_TO_CODE.md
rlm/core/rlm_engine.py: core recursive execution enginerlm/core/llm_client.py: client interfaces and local model clientrlm/run_minimal.py: minimal paper-loop demorlm/run_local_rlm.py: optional local model runnerrlm/tests/test_rlm_engine.py: behavioral tests for core loop
Install test dependencies and run tests:
cd rlm
python -m pip install -r requirements.txt
python -m pytest -qFor local inference with Hugging Face models:
cd rlm
python -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements-local.txt
python run_local_rlm.py \
--fast \
--device auto \
--max-iterations 6 \
--max-output-tokens 256 \
--query "What is the project codename and release version?" \
--context-file examples/quickstart_context.txtNotes:
- On Apple Silicon,
--device autodefaults to CPU for stability. --device mpsis available, but MPS stability can vary by model/runtime versions.
MIT (LICENSE).