File size: 1,788 Bytes
072246b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# banana-harness integration

The companion banana-harness adapter uses benchmark name `klein-code-bench`, creates an empty native workspace, and keeps evaluator scenarios in `Task.grading`, outside `Task.public()` and the model prompt. It grades the complete generated project using this package's evaluator. It requires Python 3.11+ and POSIX. No Docker/rootfs backend is used.

From a banana-harness checkout with the Klein adapter:

```bash
# Both checkouts are local; the benchmark evaluator has no runtime dependencies.
python -m pip install -e /path/to/klein-code-bench
python -m pip install -e '/path/to/banana-harness[models,datasets]'

# Endpoint options use the harness's --model-options JSON file.
printf '%s\n' '{"api_base":"http://127.0.0.1:8000/v1","api_key":"local","temperature":0}' > local-model.json
banana run klein-code-bench --allow-downloads --dataset-config easy \
  --backend native --model openai/your-local-model \
  --model-options local-model.json --output jobs/klein-easy
```

Use the CLI's `--help` to confirm endpoint/model options for the installed harness. The source-loading path also accepts a single subset JSONL file from `klein_code_bench/data/` through `--source`, avoiding dataset downloads. Use `--dataset-config intermediate`, `hard`, `max`, or `default` for the other subsets or all tasks. Pin `--revision` to the HF commit for remote loading. Record generation settings and use one attempt per task.

Generation uses the harness's existing agent and local-model providers. Grading imports `klein_code_bench.runner` lazily; installing or importing banana-harness alone does not download the benchmark. A missing evaluator gives an actionable install error. The optional `klein` dependency installs a wheel pinned to a benchmark dataset commit.