Skip to content

Commit 3ba0ce2

Browse files
committed
.
1 parent 5e897ea commit 3ba0ce2

File tree

5 files changed

+79
-72
lines changed

5 files changed

+79
-72
lines changed

docs/agent.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
## Running an Agent
2+
3+
Next we will see how this can be run with an AI agent system.
4+
We will use [Aider](https://aider.chat/) which is a nice
5+
command-line oriented agent system.
6+
7+
To setup Aider first set your api key.
8+
We recommend using Claude Sonnet.
9+
10+
```bash
11+
# Work with Claude 3.5 Sonnet on your repo
12+
export ANTHROPIC_API_KEY=your-key-goes-here
13+
```
14+
15+
Once this is setup you can run Aider with the following command.
16+
This will edit the files locally in your branch, but
17+
run the tests inside the environment.
18+
19+
```bash
20+
aider --model sonnet --file repos/minitorch/operators.py --message "fill in" \
21+
--auto-test --test \
22+
--test-cmd 'commit0 test minitorch branch=mychange tests/test_operators.py::test_relu' \
23+
--yes
24+
```
25+
26+
This will run an LLM agent that will try to fill in the
27+
functions in one file of the minitorch library.
28+
29+
For a full example baseline system that tries to solve
30+
all the tests in the library see the [baseline](baseline) documentation.

docs/index.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ The [commit0 tool](setup) allows you to:
1919
* Distribute testing and development across cloud systems
2020
* Track and log all changes made throughout.
2121

22+
To install run:
23+
24+
```bash
25+
pip install commit0
26+
```
27+
28+
2229
| | Name | Repo | Commit0 | Tests | |
2330
|--|--------|-------|----|----|------|
2431
| <img src='https://avatars.githubusercontent.com/u/69814924?s=280&v=4' width='100px'/> | [minitorch](https://minitorch.github.io/) | [[orig](http://github.com/minitorch/minitorch)] | [[commit0](http://github.com/commit-0/minitorch)] | 230 | <img src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAABkCAQAAADtJZLrAAAAD0lEQVR42mNkYGAcRcQhADxaAGWhD8eHAAAAAElFTkSuQmCC'/> |

docs/setupdist.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
## Distributed Mode
2+
3+
Commit0 is a command-line tool that allows you to run unit-tests on a
4+
variety of libraries in isolated environments.
5+
6+
Commit0 uses [modal](https://modal.com/) as a distributed
7+
test runner.
8+
9+
```bash
10+
pip install modal
11+
modal token new
12+
```
13+
14+
To get started, run the `setup` command with the dataset
15+
split that youare interested in working with.
16+
We'll start with the `lite` split.
17+
18+
```bash
19+
commit0 setup lite
20+
```
21+
22+
This will clone a set of skeleton libraries in your `repos/` directory.
23+
Commiting changes to branches in this directory
24+
25+
26+
27+
28+
29+
You can pass this configuration file as an argumnet to clone.
30+
31+
```bash
32+
commit0 setup lite
33+
```
34+
35+
Next to run tests you can run the standard test command.
36+
37+
```bash
38+
commit0 test simpy tests/test_event.py::test_succeed
39+
```
Lines changed: 1 addition & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
# Quickstart
1+
## Local Mode
22

3-
## Install
43

54
First be sure that you have docker tools installed.
65

@@ -10,11 +9,6 @@ apt install docker
109

1110
To install the benchmark run,
1211

13-
```bash
14-
pip install commit0
15-
```
16-
17-
## Commands
1812

1913
The system is a command-line tool that allows you to run unit-tests on a
2014
variety of libraries in isolated environments. To get started with the full
@@ -73,67 +67,3 @@ a branch and the environment will sync and run.
7367
```bash
7468
commit0 test minitorch branch=mychange tests/test_operators.py::test_relu
7569
```
76-
77-
## Running an Agent
78-
79-
Next we will see how this can be run with an AI agent system.
80-
We will use [Aider](https://aider.chat/) which is a nice
81-
command-line oriented agent system.
82-
83-
To setup Aider first set your api key.
84-
We recommend using Claude Sonnet.
85-
86-
```bash
87-
# Work with Claude 3.5 Sonnet on your repo
88-
export ANTHROPIC_API_KEY=your-key-goes-here
89-
```
90-
91-
Once this is setup you can run Aider with the following command.
92-
This will edit the files locally in your branch, but
93-
run the tests inside the environment.
94-
95-
```bash
96-
aider --model sonnet --file repos/minitorch/operators.py --message "fill in" \
97-
--auto-test --test \
98-
--test-cmd 'commit0 test minitorch branch=mychange tests/test_operators.py::test_relu' \
99-
--yes
100-
```
101-
102-
This will run an LLM agent that will try to fill in the
103-
functions in one file of the minitorch library.
104-
105-
For a full example baseline system that tries to solve
106-
all the tests in the library see the [baseline](baseline) documentation.
107-
108-
109-
## Distributed Tests
110-
111-
One of the main advantages of `commit0` is that it can run
112-
a range of unit tests in distributed environments.
113-
114-
By default, the library is configured to work with [modal](https://modal.com/).
115-
116-
```bash
117-
pip install modal
118-
modal token new
119-
```
120-
121-
To enable distributed run, first
122-
create a file called `distributed.yaml`
123-
124-
```yaml
125-
backend: modal
126-
base_dir: repos.dist/
127-
```
128-
129-
You can pass this configuration file as an argumnet to clone.
130-
131-
```bash
132-
commit0 clone lite --cfg=distributed.yaml
133-
```
134-
135-
Next to run tests you can run the standard test command.
136-
137-
```bash
138-
commit0 test simpy master tests/test_event.py::test_succeed --cfg=distributed.yaml
139-
```

mkdocs.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ site_name: ""
33
docs_dir: docs
44
nav:
55
- Home: index.md
6-
- Setup: setup.md
6+
- Distributed: setupdist.md
7+
- Local: setuplocal.md
78
- Extending: repos.md
89
- About: about.md
910
theme:

0 commit comments

Comments
 (0)