tuieval 0.2.0.dev154__tar.gz → 0.2.0.dev156__tar.gz

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.
Files changed (83) hide show
  1. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/CHANGELOG.md +1 -0
  2. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/PKG-INFO +1 -1
  3. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/docs/models.md +1 -1
  4. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/_version.py +2 -2
  5. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/ctxbench.py +8 -2
  6. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/tests/test_tuieval.py +14 -0
  7. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/.gitignore +0 -0
  8. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/LICENSE +0 -0
  9. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/README.md +0 -0
  10. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/RELEASING.md +0 -0
  11. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/docs/agent-packs.md +0 -0
  12. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/docs/images/brand/README.md +0 -0
  13. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/docs/images/brand/favicon.ico +0 -0
  14. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/docs/images/brand/readme-header.png +0 -0
  15. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/docs/images/brand/social-preview.png +0 -0
  16. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/docs/images/brand/tuieval-icon-1024.png +0 -0
  17. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/docs/images/brand/tuieval-icon-128.png +0 -0
  18. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/docs/images/brand/tuieval-icon-16.png +0 -0
  19. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/docs/images/brand/tuieval-icon-16.svg +0 -0
  20. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/docs/images/brand/tuieval-icon-256.png +0 -0
  21. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/docs/images/brand/tuieval-icon-32.png +0 -0
  22. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/docs/images/brand/tuieval-icon-48.png +0 -0
  23. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/docs/images/brand/tuieval-icon-512.png +0 -0
  24. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/docs/images/brand/tuieval-icon-64.png +0 -0
  25. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/docs/images/brand/tuieval-icon-animated.svg +0 -0
  26. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/docs/images/brand/tuieval-icon.svg +0 -0
  27. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/docs/images/tui-answer-reasoning.png +0 -0
  28. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/docs/images/tui-run-reasoning.png +0 -0
  29. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/docs/images/tui-setup.png +0 -0
  30. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/docs/writing-packs.md +0 -0
  31. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/pyproject.toml +0 -0
  32. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/__init__.py +0 -0
  33. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/__main__.py +0 -0
  34. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/agents.py +0 -0
  35. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/builtin.toml +0 -0
  36. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/cli.py +0 -0
  37. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/client.py +0 -0
  38. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/compare.py +0 -0
  39. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/dates.py +0 -0
  40. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/doctor.py +0 -0
  41. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/engine.py +0 -0
  42. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/export.py +0 -0
  43. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/graders/__init__.py +0 -0
  44. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/graders/answer.py +0 -0
  45. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/graders/code.py +0 -0
  46. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/graders/rag.py +0 -0
  47. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/graders/reply.py +0 -0
  48. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/graders/tool_call.py +0 -0
  49. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/insights.py +0 -0
  50. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/logs.py +0 -0
  51. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/machines.py +0 -0
  52. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/onboard.py +0 -0
  53. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/packs.py +0 -0
  54. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/profiles.py +0 -0
  55. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/pta.py +0 -0
  56. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/remove.py +0 -0
  57. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/run_evals.py +0 -0
  58. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/scaffold.py +0 -0
  59. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/selftest.py +0 -0
  60. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/templates/models.toml +0 -0
  61. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/templates/packs/answer/pack.toml +0 -0
  62. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/templates/packs/answer/system.txt +0 -0
  63. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/templates/packs/answer/tests.yaml +0 -0
  64. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/templates/packs/code/pack.toml +0 -0
  65. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/templates/packs/code/system.txt +0 -0
  66. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/templates/packs/code/tests.yaml +0 -0
  67. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/templates/packs/rag/pack.toml +0 -0
  68. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/templates/packs/rag/system.txt +0 -0
  69. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/templates/packs/rag/tests.yaml +0 -0
  70. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/templates/packs/reply/pack.toml +0 -0
  71. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/templates/packs/reply/system.txt +0 -0
  72. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/templates/packs/reply/tests.yaml +0 -0
  73. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/templates/packs/tool_call/pack.toml +0 -0
  74. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/templates/packs/tool_call/system.txt +0 -0
  75. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/templates/packs/tool_call/tests.yaml +0 -0
  76. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/templates/packs/tool_call/tools.yaml +0 -0
  77. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/tui.py +0 -0
  78. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/tune.py +0 -0
  79. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/verdict.py +0 -0
  80. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/watch_proxy.py +0 -0
  81. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/workspace.py +0 -0
  82. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/src/tuieval/yamlout.py +0 -0
  83. {tuieval-0.2.0.dev154 → tuieval-0.2.0.dev156}/tests/mock_server.py +0 -0
@@ -2,6 +2,7 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ - Fix: `tuieval tune --ctx` refused models larger than the machine's memory ("another model or app is holding memory"), which servers that read the model from disk as needed run fine. Their size on disk is no longer checked against free memory.
5
6
  - Fix: `tuieval tune --ctx` waits for the machine to recover after each try (memory pressure back to normal, memory given back). A try stopped for memory pressure could fail the next one within seconds, at a context that works.
6
7
  - `tuieval tune --ctx`: the measured context governs the caps in `models.toml` (`max_ctx`, a model's `ctx`, a context flag), not the other way around: the search runs up to the model's own limit, and runs use what was measured even above a cap. It starts at half the model's current context, and a try is also stopped while the server loads. Memory is measured as what the machine loses while the server runs (on a Mac from `vm_stat` page counts, not the rounded free percentage), so memory-mapped files a server reads on demand no longer count against it.
7
8
  - `tuieval tune <model> --ctx` measures the largest context a model can be served with on this machine, for any server tuieval starts: it fills each context it tries and checks the answer, the tokens the server read, memory pressure and swapping. Runs then use the measured context in place of the fit check's estimate (`tuning/<machine>/<model>.ctx.toml`; `tuieval machines` shows *measured*). See docs/models.md.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: tuieval
3
- Version: 0.2.0.dev154
3
+ Version: 0.2.0.dev156
4
4
  Summary: Evaluate local and frontier LLMs on your own questions: accuracy, speed, tokens and PASS/FAIL verdicts, in the terminal.
5
5
  Project-URL: Homepage, https://github.com/ashe-wb/tuieval
6
6
  Project-URL: Issues, https://github.com/ashe-wb/tuieval/issues
@@ -156,7 +156,7 @@ The fit check estimates the context from the model file, and only for servers th
156
156
  2. The try passes when the answer is right, the server read the whole document (a server that cuts long prompts short fails here), and the machine stayed healthy: no macOS memory pressure, no swapping, memory left on Linux. A try is stopped the moment one of those turns bad, also while the server is still loading. The next try waits until the machine has recovered, so the pressure one try leaves behind can't fail the next.
157
157
  3. It starts at half the context the model runs with now (32768 when that isn't known) and doubles. Memory grows about linearly with the context, so two tries that passed predict the largest context that fits in the machine's memory (less `memory_headroom_gb`, and less whatever other apps hold now); no try goes above the prediction, and a failed try is bisected against the largest that passed.
158
158
 
159
- Expect 3 to 5 server starts; the largest ones take as long as the server needs to read that many tokens. It won't start when memory pressure is already elevated or the model is larger than the memory free now.
159
+ Expect 3 to 5 server starts; the largest ones take as long as the server needs to read that many tokens. It won't start when memory pressure is already elevated or the model is larger than the memory free now (unless the model is larger than the machine's memory altogether: a server that reads its model from disk as needed is judged by the tries alone).
160
160
 
161
161
  Memory is read off the machine, not the server's processes: the memory available before the server starts, less the lowest it falls to while the context is full (VRAM on discrete GPUs). On a Mac, available memory is RAM less what is held and can't be given back (anonymous and wired pages and the compressor, from `vm_stat`), so files a server maps and reads on demand don't count against it, and the reading is in the same terms as the memory it is compared with.
162
162
 
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
18
18
  commit_id: str | None
19
19
  __commit_id__: str | None
20
20
 
21
- __version__ = version = '0.2.0.dev154'
22
- __version_tuple__ = version_tuple = (0, 2, 0, 'dev154')
21
+ __version__ = version = '0.2.0.dev156'
22
+ __version_tuple__ = version_tuple = (0, 2, 0, 'dev156')
23
23
 
24
24
  __commit_id__ = commit_id = None
@@ -424,10 +424,16 @@ def bench(eng, label, emit=lambda *a, **k: None, max_ctx=None, start=None, step=
424
424
  room, refuse = room_gb(eng)
425
425
  if refuse:
426
426
  raise engine_mod.ModelFailed(refuse)
427
- size = model_gb(m)
428
- if room is not None and size is not None and size > room:
427
+ # A model that could be held in memory whole needs that much free before the first load (another
428
+ # model may be loaded). One larger than the machine's memory can't be: its server reads it from
429
+ # disk as needed, so its size says nothing about what it takes, and the probes' guard decides.
430
+ size, whole = model_gb(m), sv.machine.gpu_limit_gb if sv.machine.discrete else sv.machine.ram_gb
431
+ if room is not None and size is not None and room < size <= whole:
429
432
  raise engine_mod.ModelFailed(f"the model is {size:.1f} GB and {room:.1f} GB is free for it now: another "
430
433
  "model or app is holding memory")
434
+ if size is not None and size > whole:
435
+ emit("tune_step", message=f"the model is {size:.0f} GB on disk, more than this machine's memory: its server "
436
+ "reads it from disk as needed, so its size isn't checked against free memory")
431
437
  # Half of what it runs with now, so the second probe is a context expected to work and the two
432
438
  # give the memory per token before anything larger is tried.
433
439
  usual = sv.ctx if sv.fits and sv.ctx else None
@@ -4253,6 +4253,20 @@ max_context = 8192
4253
4253
  ctxbench.bench(e, "sized", max_ctx=65536)
4254
4254
  self.assertFalse(os.path.isdir(os.path.join(e.log_dir, "server"))) # no server was started
4255
4255
 
4256
+ def test_model_size_is_checked_against_free_memory_only_when_it_could_be_held_whole(self):
4257
+ from tuieval import ctxbench, engine
4258
+ self.addCleanup(setattr, ctxbench, "model_gb", ctxbench.model_gb)
4259
+ with tempfile.TemporaryDirectory() as tmp:
4260
+ e = self._engine(self._workspace(tmp))
4261
+ ram, said = e.machine().ram_gb, []
4262
+ ctxbench.model_gb = lambda m: ram - 0.1 # fits the machine, but not what is free now
4263
+ with self.assertRaisesRegex(engine.ModelFailed, "another model or app is holding memory"):
4264
+ ctxbench.bench(e, "sized", max_ctx=65536)
4265
+ ctxbench.model_gb = lambda m: ram * 3 # can't be held in memory: its server reads it from disk
4266
+ got = ctxbench.bench(e, "sized", lambda kind, **d: said.append(d.get("message", "")), max_ctx=65536, step=2048)
4267
+ self.assertEqual(got["max_ctx"], 18432)
4268
+ self.assertTrue(any("more than this machine's memory" in s for s in said))
4269
+
4256
4270
  def test_a_probe_stops_when_the_machine_starts_swapping(self):
4257
4271
  from tuieval import ctxbench, machines
4258
4272
  with tempfile.TemporaryDirectory() as tmp:
File without changes
File without changes