File size: 3,080 Bytes
637f42c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# Setup Guide (VS Code)

## Prerequisites
- Python 3.11 or higher β€” download from [python.org](https://python.org)
- Git β€” download from [git-scm.com](https://git-scm.com)
- VS Code β€” download from [code.visualstudio.com](https://code.visualstudio.com)

---

## Step 1 β€” Open the project

1. Unzip `teamforge.zip`
2. In VS Code: **File β†’ Open Folder** β†’ select the `teamforge` folder
3. Open the terminal: **View β†’ Terminal** (or `Ctrl + `` ` ``)

---

## Step 2 β€” Create virtual environment

**Windows:**
```
python -m venv venv
venv\Scripts\activate
```

**Mac / Linux:**
```
python3 -m venv venv
source venv/bin/activate
```

You should see `(venv)` appear at the start of your terminal prompt.

> **If `python -m venv venv` hangs or errors:**
> - Try `py -m venv venv` (Windows)
> - Try `python3 -m venv venv` (Mac/Linux)
> - Or skip venv and just run `pip install -r requirements.txt` directly

---

## Step 3 β€” Install dependencies

```
pip install -r requirements.txt
```

This installs: pydantic, openai, rich, pytest, ruff

---

## Step 4 β€” Run the demo (no API key needed!)

```
python demo.py
```

You will see a beautiful step-by-step agent trace in your terminal.

---

## Step 5 β€” Run the tests

```
pytest tests/test_environment.py -v
```

All 21 tests should pass (green).

---

## Step 6 β€” Get a free Groq API key

1. Go to [console.groq.com](https://console.groq.com)
2. Sign up (free, no credit card)
3. Create an API key
4. Copy `.env.example` β†’ `.env` and paste your key:
   ```
   cp .env.example .env
   ```
   Then open `.env` and set:
   ```
   GROQ_API_KEY=gsk_your_key_here
   ```

---

## Step 7 β€” Run the benchmark

**Windows:**
```
set GROQ_API_KEY=gsk_your_key_here
python benchmark.py --model llama3-8b-8192
```

**Mac / Linux:**
```
export GROQ_API_KEY=gsk_your_key_here
python benchmark.py --model llama3-8b-8192
```

---

## Common Issues

| Problem | Fix |
|---------|-----|
| `python` not found | Use `python3` or `py` instead |
| `venv` command hangs | Skip it, run `pip install -r requirements.txt` directly |
| `ModuleNotFoundError: rich` | Run `pip install -r requirements.txt` |
| `git: command not found` | Install Git from git-scm.com |
| Terminal shows `>>>` | You're in Python REPL β€” press `Ctrl+Z` then Enter to exit |

---

## File Structure

```
teamforge/
β”œβ”€β”€ demo.py               ← run this first
β”œβ”€β”€ benchmark.py          ← model comparison
β”œβ”€β”€ baseline_inference.py ← single agent run
β”œβ”€β”€ environment.py        ← core environment
β”œβ”€β”€ models.py             ← data models
β”œβ”€β”€ grader.py             ← scoring
β”œβ”€β”€ reward.py             ← reward function
β”œβ”€β”€ tasks/                ← easy / medium / hard / bonus
β”œβ”€β”€ sandbox/              ← git isolation
β”œβ”€β”€ tests/                ← test suite
β”œβ”€β”€ results/              ← benchmark output
β”œβ”€β”€ requirements.txt      ← dependencies
β”œβ”€β”€ .env.example          ← copy to .env with your API key
└── README.md             ← full documentation
```