Skip to content

Commit 7635144

Browse files
authored
add Makefile and README update (#43)
1 parent 625a69e commit 7635144

File tree

2 files changed

+68
-2
lines changed

2 files changed

+68
-2
lines changed

Makefile

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
.PHONY: help install install-dev install-modal run-all \
2+
quickstart docker-repl lm-repl modal-repl \
3+
lint format test check
4+
5+
help:
6+
@echo "RLM Examples Makefile"
7+
@echo ""
8+
@echo "Usage:"
9+
@echo " make install - Install base dependencies with uv"
10+
@echo " make install-dev - Install dev dependencies with uv"
11+
@echo " make install-modal - Install modal dependencies with uv"
12+
@echo " make run-all - Run all examples (requires all deps and API keys)"
13+
@echo ""
14+
@echo "Examples:"
15+
@echo " make quickstart - Run quickstart.py (needs OPENAI_API_KEY)"
16+
@echo " make docker-repl - Run docker_repl_example.py (needs Docker)"
17+
@echo " make lm-repl - Run lm_in_repl.py (needs PORTKEY_API_KEY)"
18+
@echo " make modal-repl - Run modal_repl_example.py (needs Modal)"
19+
@echo ""
20+
@echo "Development:"
21+
@echo " make lint - Run ruff linter"
22+
@echo " make format - Run ruff formatter"
23+
@echo " make test - Run tests"
24+
@echo " make check - Run lint + format + tests"
25+
26+
install:
27+
uv sync
28+
29+
install-dev:
30+
uv sync --group dev --group test
31+
32+
install-modal:
33+
uv pip install -e ".[modal]"
34+
35+
run-all: quickstart docker-repl lm-repl modal-repl
36+
37+
quickstart: install
38+
uv run python -m examples.quickstart
39+
40+
docker-repl: install
41+
uv run python -m examples.docker_repl_example
42+
43+
lm-repl: install
44+
uv run python -m examples.lm_in_repl
45+
46+
modal-repl: install-modal
47+
uv run python -m examples.modal_repl_example
48+
49+
lint: install-dev
50+
uv run ruff check .
51+
52+
format: install-dev
53+
uv run ruff format .
54+
55+
test: install-dev
56+
uv run pytest
57+
58+
check: lint format test

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,17 @@ uv init && uv venv --python 3.12 # change version as needed
5353
uv pip install -e .
5454
```
5555

56-
To run a quick test, the following will run an RLM query with the OpenAI client using your environment variable `OPENAI_API_KEY` (feel free to change this). This will generate console output as well as a log which you can use with the visualizer to explore the trajectories.
56+
### Makefile Usage
57+
This project includes a `Makefile` to simplify common tasks.
58+
59+
- `make install`: Install base dependencies.
60+
- `make install-dev`: Install development dependencies.
61+
- `make check`: Run linter, formatter, and tests.
62+
- `make quickstart`: Run the quickstart example.
63+
64+
To run a quick test, the following will run an RLM query with the OpenAI client using your environment variable `OPENAI_API_KEY` (feel free to change this). This will generate console output as well as a log which you can use with the visualizer to explore the trajectories.
5765
```bash
58-
uv run examples/quickstart.py
66+
make quickstart
5967
```
6068

6169
The default RLM client uses a REPL environment that runs on the host process through Python `exec` calls. It uses the same virtual environment as the host process (i.e. it will have access to the same dependencies), but with some limitations in its available global modules. As an example, we can call RLM completions using GPT-5-nano:

0 commit comments

Comments
 (0)