lcode-cli 0.56.0__py3-none-any.whl → 0.57.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
lcode/__init__.py CHANGED
@@ -3,7 +3,7 @@
3
3
  From a program: `from lcode import Session` (see lcode.api).
4
4
  """
5
5
 
6
- __version__ = "0.56.0"
6
+ __version__ = "0.57.0"
7
7
 
8
8
  API = ("Session", "Result", "Options", "SetupError")
9
9
 
lcode/bench.py CHANGED
@@ -19,6 +19,7 @@ import subprocess
19
19
  import sys
20
20
  import tempfile
21
21
  import time
22
+ from collections import Counter
22
23
  from collections.abc import Callable, Iterator
23
24
  from contextlib import contextmanager
24
25
  from dataclasses import asdict, dataclass, field
@@ -38,6 +39,7 @@ from lcode.ollama import Ollama, OllamaError
38
39
  SCHEMA_VERSION = 1
39
40
  DEFAULT_CONTEXT = 32768 # the same everywhere, so results compare across machines
40
41
  DEFAULT_TIMEOUT = 300 # seconds per task
42
+ DEFAULT_ATTEMPTS = 3 # each task's attempts: one run is within the noise between runs
41
43
  CHECK_TIMEOUT = 60
42
44
  PROBE_WORDS = 3000 # about 4,000 tokens
43
45
  PROBE_TEXT = (
@@ -792,6 +794,46 @@ class TaskResult:
792
794
  errors_by_tool: dict[str, int] = field(default_factory=dict) # which tools failed, "malformed" for unreadable calls
793
795
  first_passed: bool | None = None # with --retry: whether the first try passed (None: no retry was needed)
794
796
  escalations: int = 0 # times the stronger model was asked (--escalate)
797
+ attempt: int = 1 # which of the task's attempts this was (--attempts)
798
+
799
+
800
+ @dataclass
801
+ class PassRates:
802
+ """How often the tasks passed, as `lcode bench --harbor` counts it (lcode.harbor_bench.summarize)."""
803
+
804
+ tries: int # k: each task's tries, its attempts (times the rounds of a --session)
805
+ pass_at_1: float | None # the share of tries that passed, averaged over the tasks
806
+ pass_all: float | None # pass^k: the share of tasks that passed every try (of those with all k)
807
+ attempts: list[tuple[int, int]] # (passed, tasks run) in each attempt, in order
808
+
809
+ @property
810
+ def runs(self) -> list[float]:
811
+ """The pass rate of each attempt that ran every task."""
812
+ full = max((ran for _, ran in self.attempts), default=0)
813
+ return [passed / ran for passed, ran in self.attempts if ran == full and ran]
814
+
815
+ @property
816
+ def spread(self) -> float | None:
817
+ runs = self.runs
818
+ return max(runs) - min(runs) if len(runs) > 1 else None
819
+
820
+
821
+ def pass_rates(results: list[TaskResult], attempts: int) -> PassRates:
822
+ tries: dict[str, list[bool]] = {}
823
+ for result in results:
824
+ tries.setdefault(result.id, []).append(result.passed)
825
+ per_attempt = Counter((result.id, result.attempt) for result in results)
826
+ k = max(1, attempts) * max(per_attempt.values(), default=1)
827
+ full = [passed for passed in tries.values() if len(passed) >= k]
828
+ by_attempt: dict[int, list[bool]] = {}
829
+ for result in results:
830
+ by_attempt.setdefault(result.attempt, []).append(result.passed)
831
+ return PassRates(
832
+ tries=k,
833
+ pass_at_1=statistics.fmean(statistics.fmean(passed) for passed in tries.values()) if tries else None,
834
+ pass_all=statistics.fmean(all(passed[:k]) for passed in full) if full else None,
835
+ attempts=[(sum(passed), len(passed)) for _, passed in sorted(by_attempt.items())],
836
+ )
795
837
 
796
838
 
797
839
  @dataclass
@@ -812,6 +854,10 @@ class ModelRun:
812
854
  session: bool = False # all tasks in one conversation (--session)
813
855
  pruned: int = 0 # times old tool output was removed to make room
814
856
  compacted: int = 0 # times the conversation was summarized
857
+ attempts: int = 1 # each task's attempts, each in a new folder and conversation (--attempts)
858
+
859
+ def rates(self) -> PassRates:
860
+ return pass_rates(self.tasks, self.attempts)
815
861
 
816
862
  @property
817
863
  def passed(self) -> int:
@@ -832,12 +878,19 @@ class ModelRun:
832
878
 
833
879
  def to_json(self) -> dict:
834
880
  data = asdict(self)
881
+ rates = self.rates()
835
882
  data.update(
836
883
  passed=self.passed,
837
884
  total=len(self.tasks),
838
885
  seconds=round(self.seconds, 1),
839
886
  generation_tps=self.generation_tps,
840
887
  tool_errors=self.tool_errors,
888
+ summary={
889
+ "pass_at_1": rates.pass_at_1,
890
+ f"pass^{rates.tries}": rates.pass_all,
891
+ "runs": rates.runs,
892
+ "spread": rates.spread,
893
+ },
841
894
  )
842
895
  return data
843
896
 
@@ -1034,12 +1087,19 @@ def run_model(
1034
1087
  verbose: bool = False,
1035
1088
  session: bool = False,
1036
1089
  retry: bool = False,
1090
+ attempts: int = 1,
1037
1091
  ) -> ModelRun:
1038
- run = ModelRun(name, settings.model, settings.context, settings.num_batch, settings.think, session=session)
1092
+ """Run the tasks `attempts` times: every task once, then every task again, each time in a new folder and
1093
+ conversation (with `session`, each attempt is one conversation for all the tasks)."""
1094
+ attempts = max(1, attempts)
1095
+ run = ModelRun(
1096
+ name, settings.model, settings.context, settings.num_batch, settings.think, session=session, attempts=attempts
1097
+ )
1039
1098
  shared: Agent | None = None # with --session, one conversation for all tasks
1040
1099
  console.print(
1041
1100
  f"\n[bold]{escape(settings.model)}[/] · {format_tokens(settings.context)} context · "
1042
1101
  f"reasoning {'on' if settings.think else 'off'} · {len(tasks)} task{'' if len(tasks) == 1 else 's'}"
1102
+ + (f" · {attempts} attempts each" if attempts > 1 else "")
1043
1103
  )
1044
1104
  options = {"num_ctx": settings.context, **({"num_batch": settings.num_batch} if settings.num_batch else {})}
1045
1105
  started = time.monotonic()
@@ -1065,30 +1125,40 @@ def run_model(
1065
1125
  console.print(f" [dim]Loaded in {run.load_seconds:.0f}s{where}{reads}[/]")
1066
1126
  elif reads: # the server loads the model itself
1067
1127
  console.print(f" [dim]{reads.removeprefix(' · ').capitalize()}[/]")
1068
- for task in tasks:
1069
- log = console if verbose else Console(file=io.StringIO(), width=120, force_terminal=False)
1070
- if session and shared is None:
1071
- shared = Agent(ollama, settings, Path(tempfile.gettempdir()), console=log)
1072
- if shared is not None:
1073
- shared.console = log
1074
- try:
1075
- if verbose:
1076
- console.rule(f"{task.id}: {task.title}")
1077
- result = run_task(ollama, settings, task, timeout, log, keep, run.usage, shared, retry)
1078
- else:
1079
- with console.status(Elapsed(f" {task.id:<13} {task.title}")):
1128
+ pruned = compacted = 0 # in the conversations of the earlier attempts (--session)
1129
+ for attempt in range(1, attempts + 1):
1130
+ if attempts > 1:
1131
+ console.print(f" [dim]Attempt {attempt} of {attempts}[/]")
1132
+ if shared is not None: # with --session, each attempt is a conversation of its own
1133
+ pruned, compacted = pruned + shared.pruned, compacted + shared.compacted
1134
+ shared = None
1135
+ for task in tasks:
1136
+ log = console if verbose else Console(file=io.StringIO(), width=120, force_terminal=False)
1137
+ if session and shared is None:
1138
+ shared = Agent(ollama, settings, Path(tempfile.gettempdir()), console=log)
1139
+ if shared is not None:
1140
+ shared.console = log
1141
+ try:
1142
+ if verbose:
1143
+ console.rule(f"{task.id}: {task.title}")
1080
1144
  result = run_task(ollama, settings, task, timeout, log, keep, run.usage, shared, retry)
1081
- except KeyboardInterrupt:
1082
- console.print(" [yellow]Stopped.[/]")
1083
- run.interrupted = True
1145
+ else:
1146
+ with console.status(Elapsed(f" {task.id:<13} {task.title}")):
1147
+ result = run_task(ollama, settings, task, timeout, log, keep, run.usage, shared, retry)
1148
+ except KeyboardInterrupt:
1149
+ console.print(" [yellow]Stopped.[/]")
1150
+ run.interrupted = True
1151
+ break
1152
+ result.attempt = attempt
1153
+ run.tasks.append(result)
1154
+ mark = "[green]✓[/]" if result.passed else "[red]✗[/]"
1155
+ console.print(
1156
+ f" {mark} {task.id:<13} {task.title:<32} {result.seconds:>5.0f}s [dim]{escape(result.detail)}[/]"
1157
+ )
1158
+ if shared is not None:
1159
+ run.pruned, run.compacted = pruned + shared.pruned, compacted + shared.compacted
1160
+ if run.interrupted:
1084
1161
  break
1085
- run.tasks.append(result)
1086
- mark = "[green]✓[/]" if result.passed else "[red]✗[/]"
1087
- console.print(
1088
- f" {mark} {task.id:<13} {task.title:<32} {result.seconds:>5.0f}s [dim]{escape(result.detail)}[/]"
1089
- )
1090
- if shared is not None:
1091
- run.pruned, run.compacted = shared.pruned, shared.compacted
1092
1162
  if run.memory_gb is None:
1093
1163
  run.memory_gb, run.gpu_percent = memory_use(ollama, settings.model)
1094
1164
  # lcode lowers the batch size or context if the GPU runs out of memory; report what was used.
@@ -1103,21 +1173,39 @@ def duration(seconds: float) -> str:
1103
1173
  return f"{int(seconds // 60)}m {seconds % 60:02.0f}s" if seconds >= 60 else f"{seconds:.0f}s"
1104
1174
 
1105
1175
 
1176
+ def percent(share: float | None) -> str:
1177
+ return "–" if share is None else f"{share * 100:.0f}%"
1178
+
1179
+
1106
1180
  def summary_rows(runs: list[ModelRun], tasks: list[Task]) -> list[tuple[str, list[str]]]:
1107
1181
  rows = []
1108
- for task in {t.id: t for t in tasks}.values(): # with --rounds a task runs several times: one row, a mark each
1182
+ for task in {t.id: t for t in tasks}.values(): # a task that ran several times: one row, a mark each
1109
1183
  cells = []
1110
1184
  for run in runs:
1111
1185
  results = [t for t in run.tasks if t.id == task.id]
1112
1186
  marks = "".join("✓" if r.passed else "✗" for r in results)
1113
- cells.append(f"{marks} {duration(sum(r.seconds for r in results))}" if results else "")
1187
+ each = sum(r.seconds for r in results) / len(results) if results else 0.0 # one try's time, on average
1188
+ cells.append(f"{marks} {duration(each)}" if results else "")
1114
1189
  rows.append((f"{task.id}: {task.title}", cells))
1115
1190
 
1116
1191
  def cell(run: ModelRun, value: str) -> str:
1117
1192
  return "—" if run.error else value
1118
1193
 
1194
+ rows.append(
1195
+ ("Passed", [cell(r, f"{r.passed}/{len(r.tasks)}" + (" (stopped)" if r.interrupted else "")) for r in runs])
1196
+ )
1197
+ rates = [(run, run.rates()) for run in runs]
1198
+ tries = max((rate.tries for _, rate in rates), default=1)
1199
+ if tries > 1:
1200
+ rows += [
1201
+ ("pass@1", [cell(run, percent(rate.pass_at_1)) for run, rate in rates]),
1202
+ (f"pass^{tries}", [cell(run, percent(rate.pass_all)) for run, rate in rates]),
1203
+ ]
1204
+ if any(len(rate.attempts) > 1 for _, rate in rates):
1205
+ rows.append(
1206
+ ("Each attempt", [cell(run, ", ".join(f"{p}/{n}" for p, n in rate.attempts)) for run, rate in rates])
1207
+ )
1119
1208
  rows += [
1120
- ("Passed", [cell(r, f"{r.passed}/{len(r.tasks)}" + (" (stopped)" if r.interrupted else "")) for r in runs]),
1121
1209
  ("Time", [cell(r, duration(r.seconds)) for r in runs]),
1122
1210
  ("Generation", [cell(r, f"{r.generation_tps:.1f} tok/s" if r.generation_tps else "?") for r in runs]),
1123
1211
  ("Prompt reading", [cell(r, f"{r.prompt_tps:,.0f} tok/s" if r.prompt_tps else "?") for r in runs]),
lcode/cli.py CHANGED
@@ -597,18 +597,27 @@ def cmd_bench(args) -> None:
597
597
  if args.harbor:
598
598
  from lcode import harbor_bench
599
599
 
600
+ if args.attempts is None:
601
+ args.attempts = harbor_bench.ATTEMPTS
600
602
  sys.exit(harbor_bench.command(args, console))
601
603
  if args.list:
602
604
  bench.print_tasks(console)
603
605
  return
606
+ rounds = max(1, args.rounds)
604
607
  try:
605
608
  cfg = config.load()
606
609
  context = parse_context(args.context) if args.context else bench.DEFAULT_CONTEXT
607
- tasks = bench.select_tasks(args.tasks) * max(1, args.rounds)
610
+ tasks = bench.select_tasks(args.tasks) * (rounds if args.session else 1)
608
611
  except (ConfigError, ValueError) as e:
609
612
  fail(str(e))
610
613
  if args.timeout <= 0:
611
614
  fail("--timeout must be a positive number of seconds")
615
+ if args.attempts is not None and args.attempts < 1:
616
+ fail("--attempts must be at least 1")
617
+ if args.session: # an attempt is one long conversation
618
+ attempts = args.attempts or 1
619
+ else: # --rounds is what --attempts was called before 0.57
620
+ attempts = args.attempts or (rounds if rounds > 1 else bench.DEFAULT_ATTEMPTS)
612
621
  ollama = connect(cfg)
613
622
  hw = detect()
614
623
  version = check_ollama(ollama, hw)
@@ -663,8 +672,9 @@ def cmd_bench(args) -> None:
663
672
  embed_model=cfg["embed_model"] if args.code_search else "off",
664
673
  )
665
674
  run = bench.run_model(
666
- ollama, name, settings, tasks, console, args.timeout, args.keep, args.verbose, args.session, args.retry
667
- )
675
+ ollama, name, settings, tasks, console, args.timeout, args.keep, args.verbose, args.session, args.retry,
676
+ attempts,
677
+ ) # fmt: skip
668
678
  runs.append(run)
669
679
  if run.interrupted:
670
680
  break
@@ -951,7 +961,12 @@ def build_subparsers() -> dict[str, argparse.ArgumentParser]:
951
961
  choices=["dev", "held-out"],
952
962
  help="public benchmarks instead: a slice of Terminal-Bench 2.0 and SWE-bench Verified, run with Harbor",
953
963
  )
954
- p.add_argument("--attempts", type=int, default=3, help="with --harbor: attempts per task (default: 3, for pass^3)")
964
+ p.add_argument(
965
+ "--attempts",
966
+ type=int,
967
+ help="attempts per task, each in a new folder and conversation (default: 3, for pass@1 and pass^3; "
968
+ "with --session: 1)",
969
+ )
955
970
  p.add_argument(
956
971
  "--agent",
957
972
  choices=["lcode", "claude-code", "opencode", "codex"],
@@ -969,7 +984,11 @@ def build_subparsers() -> dict[str, argparse.ArgumentParser]:
969
984
  help="run all tasks in one conversation, to test a long session and its context management",
970
985
  )
971
986
  p.add_argument(
972
- "--rounds", type=int, default=1, help="run the tasks this many times (with --session: a longer session)"
987
+ "--rounds",
988
+ type=int,
989
+ default=1,
990
+ help="with --session: the tasks this many times in the conversation, for a longer session "
991
+ "(without --session: the same as --attempts)",
973
992
  )
974
993
  p.add_argument("--repo-map", action="store_true", help="give the model the repository map (off by default)")
975
994
  p.add_argument("--code-search", action="store_true", help="index each task's folder and offer semantic code search")
lcode/docs/bench.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Benchmarking models
2
2
 
3
3
  `lcode bench` answers the most common question about local models: *which one works best for
4
- coding on my machine?* It runs a fixed set of small coding tasks against one or more models and
5
- reports how many they solved, how fast they ran and how much memory they used.
4
+ coding on my machine?* It runs a fixed set of small coding tasks against one or more models, three
5
+ times each, and reports how many they solved, how fast they ran and how much memory they used.
6
6
 
7
7
  To compare with other agents on public benchmarks (Terminal-Bench 2.0 and SWE-bench Verified),
8
8
  see [Public benchmarks](public-benchmarks.md).
@@ -11,6 +11,7 @@ see [Public benchmarks](public-benchmarks.md).
11
11
  lcode bench # the configured model
12
12
  lcode bench qwen3.6-35b qwen3.5-9b # compare models
13
13
  lcode bench --tasks fix-bug,rename # run some of the tasks
14
+ lcode bench --attempts 1 # each task once: quicker, but within the noise
14
15
  lcode bench --json results.json # also save machine-readable results
15
16
  lcode bench --markdown # also print a table to paste into a test report
16
17
  ```
@@ -20,23 +21,43 @@ Studio: `LCODE_BACKEND=llama.cpp lcode bench`. The server keeps the model loaded
20
21
  its memory use, so those columns stay empty.
21
22
 
22
23
  ```text
23
- lcode bench · NVIDIA GeForce RTX 4080 Laptop GPU (12 GB VRAM), 31 GB RAM · Ollama 0.32.15
24
+ lcode bench · NVIDIA GeForce RTX 4080 Laptop GPU (12 GB VRAM), 31 GB RAM · Ollama 0.40.13
24
25
 
25
- lcode-qwen3.6-35b · 32K context · reasoning on · 8 tasks
26
- Loaded in 16s · 22.3 GB, 45% on the GPU · reads prompts at 855 tok/s
26
+ lcode-qwen3.6-35b · 32K context · reasoning on · 8 tasks · 3 attempts each
27
+ Loaded in 18s · 10.4 GB, 98% on the GPU · reads prompts at 905 tok/s
28
+ Attempt 1 of 3
27
29
  ✓ fix-bug Fix a bug so the tests pass 22s the tests pass
28
- ✓ find-code Answer with file:line 9s next_wait at backoff.py:13
29
- ✓ write-script Write a script from a spec 13s correct output, also on data it hadn't seen
30
- ✓ rename Rename a function across files 26s its tests and extra checks pass
30
+ ✓ find-code Answer with file:line 8s next_wait at backoff.py:13
31
+ ✓ write-script Write a script from a spec 12s correct output, also on data it hadn't seen
32
+ ✓ rename Rename a function across files 22s its tests and extra checks pass
31
33
  ✓ precise-edit One-line edit in a long file 10s changed only service_087's timeout
32
- ✓ recover Recover from failing commands 30s used --source and dropped the invalid line
33
- ✓ spec-fix Fix a function to match its spec 55s follows the whole docstring
34
- ✓ feature Add a feature across files 71s priorities work, including old todos
34
+ ✓ recover Recover from failing commands 22s used --source and dropped the invalid line
35
+ ✓ spec-fix Fix a function to match its spec 78s follows the whole docstring
36
+ ✓ feature Add a feature across files 86s priorities work, including old todos
37
+ Attempt 2 of 3
38
+ …
35
39
  ```
36
40
 
37
41
  At the end it prints a table comparing the models (see [results](#results-on-a-12-gb-laptop) below).
38
42
 
39
- A model usually takes 4 to 12 minutes; each task stops after 5 minutes (`--timeout`).
43
+ A model usually takes 4 to 12 minutes per attempt; each task stops after 5 minutes (`--timeout`).
44
+
45
+ ### Three attempts at each task
46
+
47
+ Models sample their answers, so a task near the edge of a model's ability can pass in one run and
48
+ fail in the next. One run of each task is within that noise, so `lcode bench` makes three attempts
49
+ at every task, each in a new folder and conversation: every task once, then every task again. The
50
+ summary adds:
51
+
52
+ | | |
53
+ |---|---|
54
+ | **pass@1** | The share of attempts that passed, averaged over the tasks: the chance that one attempt works |
55
+ | **pass^3** | The share of tasks that passed all three attempts: the ones you can count on |
56
+ | **Each attempt** | How many tasks passed in each attempt. The difference between the best and the worst is the spread between runs |
57
+
58
+ They're counted as in the [public benchmarks](public-benchmarks.md). `--attempts 1` runs each task
59
+ once, as `lcode bench` did before 0.57, in a third of the time; `--attempts 5` gives pass^5. In the
60
+ summary, a task's time is that of one attempt, on average, and *Time* is the total.
40
61
 
41
62
  ### More tasks and features
42
63
 
@@ -57,8 +78,8 @@ would: no questions asked, since the flag is your OK. Comparing the two shows wh
57
78
  model's advice adds to the same second chance:
58
79
 
59
80
  ```bash
60
- lcode bench --tasks runtime-bug --retry --rounds 3
61
- lcode bench --tasks runtime-bug --retry --rounds 3 --escalate ollama/qwen3.8-27b
81
+ lcode bench --tasks runtime-bug --retry --attempts 3
82
+ lcode bench --tasks runtime-bug --retry --attempts 3 --escalate ollama/qwen3.8-27b
62
83
  ```
63
84
 
64
85
  The JSON report has, for each task, `first_passed` (with `--retry`, whether the first try passed)
@@ -77,7 +98,8 @@ lcode bench --context 32k --session --rounds 3
77
98
  lcode bench --context 32k --session --rounds 3 --no-prune
78
99
  ```
79
100
 
80
- `--rounds 3` runs the tasks three times, 24 in one conversation, which fills a 32K window several
101
+ With `--session`, an attempt is one conversation, and `--attempts` is 1 unless you set it. `--rounds 3`
102
+ runs the tasks three times in it, 24 in one conversation, which fills a 32K window several
81
103
  times over. With qwen3.6-35b on a 12 GB laptop (two runs each; runs vary a lot from one to the
82
104
  next):
83
105
 
@@ -130,8 +152,8 @@ and `feature` are checked with tests the model never saw.
130
152
 
131
153
  | | |
132
154
  |---|---|
133
- | **Passed** | Tasks solved within the time limit |
134
- | **Time** | Total time for the tasks (loading the model is reported separately) |
155
+ | **Passed** | Attempts that solved their task within the time limit; with several, also pass@1, pass^3 and each attempt's ([above](#three-attempts-at-each-task)) |
156
+ | **Time** | Total time for the tasks, every attempt (loading the model is reported separately) |
135
157
  | **Generation** | Output tokens per second, across all the model's responses |
136
158
  | **Prompt reading** | Prompt tokens per second: how fast the model reads files and tool output. Measured per model with fresh 4,000-token prompts (the faster of two readings, since the first one after loading includes warm-up), because during the tasks Ollama serves most of each request from its prompt cache |
137
159
  | **Tool-call errors** | Tool calls that failed (wrong arguments, editing without reading first, unmatched edits) or that the model wrote as invalid JSON |
@@ -144,7 +166,8 @@ to measure a model without reasoning.
144
166
 
145
167
  ## Results on a 12 GB laptop
146
168
 
147
- RTX 4080 Laptop GPU (12 GB) with 31 GB of RAM, Ollama 0.32.15, 32K context, reasoning on:
169
+ RTX 4080 Laptop GPU (12 GB) with 31 GB of RAM, Ollama 0.32.15, 32K context, reasoning on, one
170
+ attempt each (lcode 0.3):
148
171
 
149
172
  | | `qwen3.6-35b` | `qwen3.5-9b` | `qwen3.5-4b` |
150
173
  |---|---|---|---|
@@ -169,8 +192,8 @@ copying `read_file`'s line numbers into a data file, ignoring negative numbers,
169
192
  of the spec, and running out of time.
170
193
 
171
194
  Models sample their answers, so a task near the edge of a model's ability can pass in one run and
172
- fail in the next (`qwen3.6-35b` scored 7/8 in an earlier run). Compare totals rather than single
173
- tasks, and run twice before drawing conclusions.
195
+ fail in the next (`qwen3.6-35b` scored 7/8 in an earlier run), which is why `lcode bench` now makes
196
+ three attempts at each task. Compare pass@1 and pass^3 rather than single tasks.
174
197
 
175
198
  ## Sharing results
176
199
 
@@ -192,10 +215,10 @@ existing fields keep their meaning until `schema` changes.
192
215
  ```json
193
216
  {
194
217
  "schema": 1,
195
- "lcode": "0.3.1",
196
- "ollama": "0.32.15",
197
- "server": "Ollama 0.32.15",
198
- "date": "2026-09-30T19:09:09+02:00",
218
+ "lcode": "0.57.0",
219
+ "ollama": "0.40.13",
220
+ "server": "Ollama 0.40.13",
221
+ "date": "2026-11-02T09:44:14+01:00",
199
222
  "hardware": {
200
223
  "os": "linux", "cpu": "13th Gen Intel(R) Core(TM) i9-13980HX", "ram_gib": 30.96,
201
224
  "gpu": "NVIDIA GeForce RTX 4080 Laptop GPU", "vram_gib": 11.99, "unified": false,
@@ -209,20 +232,22 @@ existing fields keep their meaning until `schema` changes.
209
232
  "context": 32768,
210
233
  "num_batch": null,
211
234
  "think": true,
212
- "load_seconds": 16.2,
213
- "prompt_tps": 854.6,
214
- "memory_gb": 22.3,
215
- "gpu_percent": 45,
216
- "passed": 8,
217
- "total": 8,
218
- "seconds": 237.3,
219
- "generation_tps": 71.4,
220
- "tool_errors": 0,
221
- "usage": {"requests": 56, "prompt_tokens": 221522, "prompt_ns": 73377987000,
222
- "output_tokens": 11490, "output_ns": 161017657999},
235
+ "load_seconds": 17.8,
236
+ "prompt_tps": 904.6,
237
+ "memory_gb": 10.4,
238
+ "gpu_percent": 98,
239
+ "attempts": 3,
240
+ "passed": 24,
241
+ "total": 24,
242
+ "seconds": 756.2,
243
+ "generation_tps": 72.2,
244
+ "tool_errors": 2,
245
+ "summary": {"pass_at_1": 1.0, "pass^3": 1.0, "runs": [1.0, 1.0, 1.0], "spread": 0.0},
246
+ "usage": {"requests": 184, "prompt_tokens": 1058154, "prompt_ns": 199916607993,
247
+ "output_tokens": 38683, "output_ns": 535438114998},
223
248
  "tasks": [
224
- {"id": "fix-bug", "passed": true, "seconds": 21.9, "detail": "the tests pass",
225
- "steps": 5, "tool_errors": 0, "error": null},
249
+ {"id": "fix-bug", "passed": true, "seconds": 21.5, "detail": "the tests pass",
250
+ "steps": 5, "tool_errors": 0, "error": null, "attempt": 1},
226
251
  …
227
252
  ],
228
253
  "error": null,
@@ -241,6 +266,9 @@ existing fields keep their meaning until `schema` changes.
241
266
  | `runs[].generation_tps` | Output tokens per second across the tasks; `null` if Ollama reported no timings |
242
267
  | `runs[].prompt_tps` | Prompt tokens per second for a fresh 4,000-token prompt (the faster of two readings); `null` if it couldn't be measured |
243
268
  | `runs[].usage` | Totals over the tasks as Ollama reports them. `prompt_tokens` includes tokens served from the prompt cache |
269
+ | `runs[].attempts` | Attempts at each task (`--attempts`) |
270
+ | `runs[].summary` | `pass_at_1`, `pass^3` (with the number of attempts), `runs` (each attempt's pass rate) and `spread` (the best minus the worst), counted as in the [public benchmarks](public-benchmarks.md); `null` where there's nothing to count |
271
+ | `runs[].tasks[]` | One entry per attempt at a task; `attempt` says which (1, 2, 3) |
244
272
  | `runs[].tasks[].steps` | Model responses in the task |
245
273
  | `runs[].tasks[].error` | Why the task stopped early (`timed out after 300s`, an Ollama error), otherwise `null` |
246
274
  | `runs[].error` | Why the model didn't run at all (for example, not installed), otherwise `null` |
lcode/docs/quickstart.md CHANGED
@@ -12,7 +12,7 @@ lcode
12
12
 
13
13
  ```text
14
14
  ╭──────────────────────────────────────────────╮
15
- │ lcode v0.56.0 — local coding agent │
15
+ │ lcode v0.57.0 — local coding agent │
16
16
  │ │
17
17
  │ model lcode-qwen3.6-35b │
18
18
  │ context 256K tokens │
lcode/docs/search.md CHANGED
@@ -66,7 +66,7 @@ whether it is.
66
66
 
67
67
  ## Measured
68
68
 
69
- `lcode bench qwen3.6-35b --tasks find-code,find-concept --rounds 3` on a 12 GB laptop. `find-concept`
69
+ `lcode bench qwen3.6-35b --tasks find-code,find-concept --attempts 3` on a 12 GB laptop. `find-concept`
70
70
  asks which function computes the pause before a failed upload is sent again, in a 40-file backend
71
71
  full of look-alikes (retry policies, job requeue delays, log backoff); the right function's name and
72
72
  docstring use none of the question's words.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: lcode-cli
3
- Version: 0.56.0
3
+ Version: 0.57.0
4
4
  Summary: A local-first terminal coding agent powered by open-weight models on your own GPU or Mac, via Ollama.
5
5
  Project-URL: Homepage, https://nasser1941.github.io/lcode/
6
6
  Project-URL: Documentation, https://nasser1941.github.io/lcode/
@@ -1,6 +1,6 @@
1
1
  lcode/docs/agents.md,sha256=A1heI40IKf767li9ffAH1grLlo2RhfbmB7lHL2uhZ4g,6915
2
2
  lcode/docs/automation.md,sha256=Y57MWEVDjhOIDsnuWhzTB0K-5wlAm4nW2uOVWTAzeEM,9450
3
- lcode/docs/bench.md,sha256=4ot6vU_AKyDfj9MlMe98mFwO4l2J4fH_U5_2LxCr-PU,13109
3
+ lcode/docs/bench.md,sha256=C35gV5QZGdx0Oa6pClPxCrGuGkVXQZJsuzwOyMrEymE,15094
4
4
  lcode/docs/commands.md,sha256=PpRcOoKZXw1OQyGxEbmipEPDYAid1fLDiaarHax7ynU,5973
5
5
  lcode/docs/configuration.md,sha256=9L5mZtN9HyDQ5cXugUpUX5AXxxR1qNrwLmNMUlxGKgc,11112
6
6
  lcode/docs/editors.md,sha256=9Ztqg_nyV5UTnMlJYrJrNvzY59X0d1HdWKYrs9-tZn4,3295
@@ -15,14 +15,14 @@ lcode/docs/memory.md,sha256=XbsNnTwRdnUEYW7_2U1GHbtK0uOjTxR-s2EujgJbR0Y,6889
15
15
  lcode/docs/models.md,sha256=d9wLOVBlMtnd8_2jQG9f0-qcEbGT6qtnwOdQSco-RD8,17121
16
16
  lcode/docs/modes.md,sha256=vNQv5K-lk6egNQNlnOHk8YeIdoAsmyaWvSu-RbQeZnQ,34039
17
17
  lcode/docs/public-benchmarks.md,sha256=n6ef_v_sBIRfS8oJj9TFL0mvOA0SRRA-MPBN_YGPho4,8267
18
- lcode/docs/quickstart.md,sha256=fZlRieXhoSB4sAs29XPonqihiFzoTUPe13lQxg8QBlU,3403
18
+ lcode/docs/quickstart.md,sha256=-cwZAKay41isEr91cVLJmaDR94psTXFElxUCH7N8Al8,3403
19
19
  lcode/docs/sandbox.md,sha256=-_jc2I0LXKQIYCz_JOuHGaP2ehVuEqEepKqMATlFpZY,4064
20
- lcode/docs/search.md,sha256=UKYrYG_xo67-bOLU1hLgiiTh3Dy6s9LG4nuc2JTQHa8,4249
20
+ lcode/docs/search.md,sha256=1Sqkfc9NRftpcfBFG9b_D8Ns-octH399AaaSNBPHq28,4251
21
21
  lcode/docs/servers.md,sha256=0ddumHseQXx0CP0nqzgwV-493s81kdEBa6qtUYe9t6k,5718
22
22
  lcode/docs/traces.md,sha256=yY3ZT9twJeGqE-Yyo9Raynz3YqKS4uNoShBq8SPsYGI,10036
23
23
  lcode/docs/troubleshooting.md,sha256=YcwmrpR6jcxnhDqV1-E7VQKeczfEC3xuokVkejkAoLo,6292
24
24
  lcode/docs/usage.md,sha256=6l48yg2qX9j9oD_AkFn9jjRCg8q4Mc8uBuqy_Mlj43U,48133
25
- lcode/__init__.py,sha256=rWKAMVTU480j3xZg74rG6FuQpSrWjQyUmVOzUax3W4I,473
25
+ lcode/__init__.py,sha256=-wcCpx3C-mQwQliWiUqgs3m3iUHEKUa2E51yBRt0rys,473
26
26
  lcode/__main__.py,sha256=s5N5pryX2FAu93GGZ3FxUrIXHWGzxz66lKUoaV_h8Ws,35
27
27
  lcode/acp.py,sha256=eFNYdJNJd9tdCbF2UIj1N3UU4RnF2-pcMLA0KBYZbwE,29082
28
28
  lcode/action.py,sha256=wuT5F9EJCdEligPeytzmEi8FpahWBhXer528tpuTj_k,16711
@@ -30,13 +30,13 @@ lcode/agent.py,sha256=WWGGFXQhhKISAvqkQJZFkqLQZoh1wxVrKpQ7nA6reNE,93332
30
30
  lcode/api.py,sha256=5Lg9IhZkz75Q4G0LbTQnWpgUhJgvIj1DpE1KFMS1Fi8,19959
31
31
  lcode/assistant.py,sha256=zEj6Pt771154xokyy4Xq9cII03lrIjFnCVcc423QyEY,8032
32
32
  lcode/backends.py,sha256=343alwyDZin-bEhb5-Es4f8ek1oBQUzEvV6RFWR1VZo,21160
33
- lcode/bench.py,sha256=HxeUfy9Kv_0Rug1HAlDLyHYfYd9dw2bMgbXsvUy9nd4,43096
33
+ lcode/bench.py,sha256=Z7OtZi0L9KjRc-ohAfHE66N2Cs3aqkw1GAvbRdyzr6o,47236
34
34
  lcode/bench_backend.py,sha256=X2fo-zRX92Xp3KMxSsFlWioc2vRupBTtowj5kLME8mw,14287
35
35
  lcode/bench_runtime.py,sha256=EjzNgIvUkdbT8cbSy1TpmlyeIk6e-ipjlDFpM7Dnqx0,6835
36
36
  lcode/catalog.py,sha256=pZ1azX9OH2r4JE2c6E5OfwywpgS39-W2oXzoCHJhmtM,4141
37
37
  lcode/checkpoints.py,sha256=eqPtmPe44-aweWqc2H21ROogwzIt3NpvcUobsaCHoGY,18354
38
38
  lcode/checks.py,sha256=haYYIPhadKavGYEhh8YWAaWrPMcfzrpT2i6638f4xjQ,12933
39
- lcode/cli.py,sha256=AVZyuOYs4dR9zgUj1SX1FjekKfoOaeo8WRbUlRAmSaY,54561
39
+ lcode/cli.py,sha256=EqgK7mevyyshcUcRzlcxvxZI9H3RPnJh5IlJAGwfNyQ,55261
40
40
  lcode/clipboard.py,sha256=nTSdJyCXPdtjH947RjvB3QvRqnL5HZsS9KB8EkC42cc,5138
41
41
  lcode/cloud.py,sha256=q5Dl5GuqWvKzBCIso-eh6yomvEOsnQ0LW8ZgaAGwBxc,2131
42
42
  lcode/codesearch.py,sha256=Io8leN1nb_Y-Dvlm9xaGtwUWYXX-ooswuznJV6dGU1s,10766
@@ -119,8 +119,8 @@ lcode/workflows/wan21-vace.json,sha256=vJsiRvLCXCjKIibOO0SGM3fT6bedAGxF8N2sN2vcP
119
119
  lcode/workflows/wan22-fun-inp-5b.json,sha256=4HbKEezik8MHvxTMP6PjQUPQPfCeSu10U9FrC-DHKYw,3327
120
120
  lcode/workflows/wan22-ti2v-5b.json,sha256=RcTehoC2pNizzlb7Ed3keJ56DiE7V5lhXmsvR2Y0smQ,3371
121
121
  lcode/workflows/z-image-turbo-t2i.json,sha256=sHsL7xnnuULOuWGYlQrDl4jOTySdAmb2T82c_cChv0s,1585
122
- lcode_cli-0.56.0.dist-info/METADATA,sha256=V0XC5ox-vmCxrWvbYcNtK7zowrJAvu-3iN_KJSvhO14,14260
123
- lcode_cli-0.56.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
124
- lcode_cli-0.56.0.dist-info/entry_points.txt,sha256=Hxsn_itbnbgft3U0FwxWdmEt0yoAV2LB-nJDnL9WT20,172
125
- lcode_cli-0.56.0.dist-info/licenses/LICENSE,sha256=JWjmoL7nNIC1XUa-dZm2hwLUgjUQMFo6k8APb0idNzs,1074
126
- lcode_cli-0.56.0.dist-info/RECORD,,
122
+ lcode_cli-0.57.0.dist-info/METADATA,sha256=GC8ZFRAkldIxueidyTgBwUleax29PHeKrczH13t4FDQ,14260
123
+ lcode_cli-0.57.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
124
+ lcode_cli-0.57.0.dist-info/entry_points.txt,sha256=Hxsn_itbnbgft3U0FwxWdmEt0yoAV2LB-nJDnL9WT20,172
125
+ lcode_cli-0.57.0.dist-info/licenses/LICENSE,sha256=JWjmoL7nNIC1XUa-dZm2hwLUgjUQMFo6k8APb0idNzs,1074
126
+ lcode_cli-0.57.0.dist-info/RECORD,,