lllm2 0.2.0__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 (49) hide show
  1. lllm2-0.2.0/.github/scripts/check_dist.py +31 -0
  2. lllm2-0.2.0/.gitignore +6 -0
  3. lllm2-0.2.0/LICENSE +201 -0
  4. lllm2-0.2.0/NOTICE +7 -0
  5. lllm2-0.2.0/PKG-INFO +38 -0
  6. lllm2-0.2.0/README.md +25 -0
  7. lllm2-0.2.0/docs/conf.py +21 -0
  8. lllm2-0.2.0/docs/development.md +68 -0
  9. lllm2-0.2.0/docs/explanation.md +22 -0
  10. lllm2-0.2.0/docs/how-to.md +76 -0
  11. lllm2-0.2.0/docs/index.md +22 -0
  12. lllm2-0.2.0/docs/reference.md +38 -0
  13. lllm2-0.2.0/docs/tutorial.md +45 -0
  14. lllm2-0.2.0/lllm2/__init__.py +0 -0
  15. lllm2-0.2.0/lllm2/__main__.py +3 -0
  16. lllm2-0.2.0/lllm2/app.py +299 -0
  17. lllm2-0.2.0/lllm2/bench.py +404 -0
  18. lllm2-0.2.0/lllm2/cli.py +214 -0
  19. lllm2-0.2.0/lllm2/config.py +12 -0
  20. lllm2-0.2.0/lllm2/defaults.py +154 -0
  21. lllm2-0.2.0/lllm2/discovery.py +205 -0
  22. lllm2-0.2.0/lllm2/downloads.py +215 -0
  23. lllm2-0.2.0/lllm2/engine.py +283 -0
  24. lllm2-0.2.0/lllm2/engine_install.py +197 -0
  25. lllm2-0.2.0/lllm2/gguf.py +320 -0
  26. lllm2-0.2.0/lllm2/harness.py +104 -0
  27. lllm2-0.2.0/lllm2/launch.py +83 -0
  28. lllm2-0.2.0/lllm2/models.json +125 -0
  29. lllm2-0.2.0/lllm2/recommendations.json +3412 -0
  30. lllm2-0.2.0/lllm2/recommendations.py +174 -0
  31. lllm2-0.2.0/lllm2/settings.py +330 -0
  32. lllm2-0.2.0/lllm2/source_workloads.py +205 -0
  33. lllm2-0.2.0/lllm2/static/index.html +73 -0
  34. lllm2-0.2.0/lllm2/static/panel.css +1275 -0
  35. lllm2-0.2.0/lllm2/static/panel.js +673 -0
  36. lllm2-0.2.0/lllm2/store.py +37 -0
  37. lllm2-0.2.0/lllm2/templates/qwen3.8-27b.jinja +189 -0
  38. lllm2-0.2.0/lllm2/warm.py +197 -0
  39. lllm2-0.2.0/pyproject.toml +41 -0
  40. lllm2-0.2.0/tests/test_cli.py +125 -0
  41. lllm2-0.2.0/tests/test_engine_install.py +27 -0
  42. lllm2-0.2.0/tests/test_gpu_offload.py +162 -0
  43. lllm2-0.2.0/tests/test_harness.py +84 -0
  44. lllm2-0.2.0/tests/test_release.py +36 -0
  45. lllm2-0.2.0/tests/test_ui_browser.cjs +228 -0
  46. lllm2-0.2.0/tests/test_ui_settings.py +66 -0
  47. lllm2-0.2.0/tests/test_versioning.py +47 -0
  48. lllm2-0.2.0/tests/ui_fixture.js +21 -0
  49. lllm2-0.2.0/uv.lock +1161 -0
@@ -0,0 +1,31 @@
1
+ """Smoke-test the installed wheel with Python's isolated mode (-I)."""
2
+
3
+ import json
4
+ import os
5
+ from importlib.metadata import version
6
+ from importlib.resources import files
7
+ from pathlib import Path
8
+ import subprocess
9
+ import sys
10
+ import tempfile
11
+
12
+ package = files('lllm2')
13
+ for name in ('models.json', 'recommendations.json'):
14
+ assert json.loads(package.joinpath(name).read_text()), name
15
+ for name in ('static/index.html', 'static/panel.js', 'static/panel.css',
16
+ 'templates/qwen3.8-27b.jinja'):
17
+ assert package.joinpath(name).read_text().strip(), name
18
+
19
+ installed_version = version('lllm2')
20
+ if os.environ.get('GITHUB_REF_TYPE') == 'tag':
21
+ tag = os.environ['GITHUB_REF_NAME']
22
+ assert tag.removeprefix('v') == installed_version, (
23
+ f'Tag {tag} does not match package version {installed_version}'
24
+ )
25
+
26
+ with tempfile.TemporaryDirectory() as directory:
27
+ subprocess.run([sys.executable, '-I', '-m', 'lllm2', '--help'],
28
+ cwd=directory, check=True)
29
+ subprocess.run([str(Path(sys.executable).with_name('lllm2')), '--help'],
30
+ cwd=directory, check=True)
31
+ print(f'Installed lllm2 {installed_version}: CLI and package assets OK')
lllm2-0.2.0/.gitignore ADDED
@@ -0,0 +1,6 @@
1
+ .venv/
2
+ __pycache__/
3
+ *.pyc
4
+ .venv-dist/
5
+ dist/
6
+ docs/_build/
lllm2-0.2.0/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "{}"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright {yyyy} {name of copyright owner}
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
lllm2-0.2.0/NOTICE ADDED
@@ -0,0 +1,7 @@
1
+ lllm2 includes GGUF inspection, model catalogue data and downloads adapted from
2
+ gilesknap/lllm3090, revision e56c8d0fb19f76a254b5453bf7f206b229705d6a.
3
+ Copyright Giles Knap and contributors. Licensed under Apache License 2.0.
4
+ Modifications: isolated configuration, robust download resume streamlined catalogue, inherited launch defaults and calibrated context planning.
5
+ The Qwen3.8 chat-template override is also retained from that revision.
6
+ Claude Code session environment configuration is adapted from the lllm3090
7
+ Claude launcher, with live engine context discovery and bounded output tokens.
lllm2-0.2.0/PKG-INFO ADDED
@@ -0,0 +1,38 @@
1
+ Metadata-Version: 2.4
2
+ Name: lllm2
3
+ Version: 0.2.0
4
+ Summary: Local NVIDIA LLM experimentation workbench
5
+ Project-URL: GitHub, https://github.com/gilesknap/lllm2
6
+ Project-URL: Documentation, https://gilesknap.github.io/lllm2/
7
+ License-Expression: Apache-2.0
8
+ License-File: LICENSE
9
+ License-File: NOTICE
10
+ Requires-Python: >=3.11
11
+ Requires-Dist: typer<1,>=0.16
12
+ Description-Content-Type: text/markdown
13
+
14
+ # lllm2
15
+
16
+ A local NVIDIA LLM workbench: download GGUF models, run llama.cpp, compare
17
+ settings and save measured results from a browser panel.
18
+
19
+ ## Install and run
20
+
21
+ On Linux with Python 3.11+ and a working NVIDIA driver,
22
+ [install uv](https://docs.astral.sh/uv/getting-started/installation/), then:
23
+
24
+ ```bash
25
+ uv tool install lllm2
26
+ lllm2 engines install cuda
27
+ lllm2
28
+ ```
29
+
30
+ The engine build needs Git, CMake, a C++ compiler and the CUDA toolkit; install
31
+ those separately. Existing builds can also be discovered. Open
32
+ <http://127.0.0.1:8082>, download a model and click **Start**. The model API
33
+ listens at `http://127.0.0.1:1920/v1`.
34
+
35
+ [Documentation](https://gilesknap.github.io/lllm2/) covers
36
+ [getting started](docs/tutorial.md), [common tasks](docs/how-to.md),
37
+ [reference](docs/reference.md), [measurements](docs/explanation.md) and
38
+ [development and releases](docs/development.md).
lllm2-0.2.0/README.md ADDED
@@ -0,0 +1,25 @@
1
+ # lllm2
2
+
3
+ A local NVIDIA LLM workbench: download GGUF models, run llama.cpp, compare
4
+ settings and save measured results from a browser panel.
5
+
6
+ ## Install and run
7
+
8
+ On Linux with Python 3.11+ and a working NVIDIA driver,
9
+ [install uv](https://docs.astral.sh/uv/getting-started/installation/), then:
10
+
11
+ ```bash
12
+ uv tool install lllm2
13
+ lllm2 engines install cuda
14
+ lllm2
15
+ ```
16
+
17
+ The engine build needs Git, CMake, a C++ compiler and the CUDA toolkit; install
18
+ those separately. Existing builds can also be discovered. Open
19
+ <http://127.0.0.1:8082>, download a model and click **Start**. The model API
20
+ listens at `http://127.0.0.1:1920/v1`.
21
+
22
+ [Documentation](https://gilesknap.github.io/lllm2/) covers
23
+ [getting started](docs/tutorial.md), [common tasks](docs/how-to.md),
24
+ [reference](docs/reference.md), [measurements](docs/explanation.md) and
25
+ [development and releases](docs/development.md).
@@ -0,0 +1,21 @@
1
+ """Sphinx configuration, using the same theme as lllm3090."""
2
+
3
+ from importlib.metadata import version as package_version
4
+
5
+ project = 'lllm2'
6
+ author = 'Giles Knap'
7
+ copyright = '2026, Giles Knap'
8
+ release = package_version(project)
9
+ version = release
10
+ extensions = ['myst_parser', 'sphinx_copybutton']
11
+ myst_heading_anchors = 3
12
+ nitpicky = True
13
+ exclude_patterns = ['_build']
14
+ html_theme = 'pydata_sphinx_theme'
15
+ html_title = f'{project} {release}'
16
+ html_theme_options = {
17
+ 'logo': {'text': project},
18
+ 'github_url': 'https://github.com/gilesknap/lllm2',
19
+ 'navbar_end': ['theme-switcher', 'navbar-icon-links'],
20
+ 'show_toc_level': 2,
21
+ }
@@ -0,0 +1,68 @@
1
+ # Development and releases
2
+
3
+ ## Local checks
4
+
5
+ From a checkout, run:
6
+
7
+ ```bash
8
+ uv sync --locked --group docs
9
+ uv run --locked python -m unittest discover -s tests -v
10
+ node tests/test_ui_browser.cjs
11
+ uv run --locked sphinx-build -W --keep-going -b html docs docs/_build/html
12
+ uv run --locked python -m build
13
+ uv run --locked twine check --strict dist/*
14
+ ```
15
+
16
+ Browser checks need Node.js 22 and Chrome; set `CHROME_BIN` if Chrome is not
17
+ at `/opt/google/chrome/chrome`. Tests use mocked engines and browser data;
18
+ no GPU or model download is required. Preview the built documentation with
19
+ `uv run python -m http.server --directory docs/_build/html`.
20
+
21
+ ## CI and publishing setup
22
+
23
+ Pull requests, pushes to `main` and all tags run Python tests, browser tests,
24
+ a strict docs build and distribution checks. CI installs the built wheel in
25
+ isolation and checks its CLI, catalogue, recommendations and UI/template assets.
26
+ Successful `main` builds deploy documentation; version tags publish the same
27
+ checked distribution artifacts to PyPI.
28
+
29
+ Configure these once in the hosting accounts:
30
+
31
+ 1. In GitHub **Settings → Pages**, select **GitHub Actions** as the build source
32
+ ([Pages instructions](https://docs.github.com/en/pages/getting-started-with-github-pages/using-custom-workflows-with-github-pages)).
33
+ 2. Create the repository environment `release`.
34
+ 3. Add a [PyPI trusted publisher](https://docs.pypi.org/trusted-publishers/adding-a-publisher/)
35
+ for project `lllm2` (or a pending publisher for the first release):
36
+
37
+ | Field | Value |
38
+ | --- | --- |
39
+ | Owner | `gilesknap` |
40
+ | Repository | `lllm2` |
41
+ | Workflow | `_pypi.yml` |
42
+ | Environment | `release` |
43
+
44
+ The reusable publishing workflow is `_pypi.yml`; use that filename when
45
+ registering the publisher. [Trusted publishing](https://docs.pypi.org/trusted-publishers/using-a-publisher/)
46
+ uses the workflow identity, with no PyPI API token in repository secrets.
47
+
48
+ ## Release
49
+
50
+ Run the checks above and merge the changes to `main`. Tag the merged commit
51
+ with the new version and push it, for example:
52
+
53
+ ```bash
54
+ git switch main
55
+ git pull --ff-only
56
+ git tag 0.1.2
57
+ git push origin refs/tags/0.1.2
58
+ ```
59
+
60
+ Hatch derives the package version from Git using `hatch-vcs`: `0.1.2` and
61
+ `v0.1.2` both build version `0.1.2`. There is no version string to update in
62
+ `pyproject.toml` or `uv.lock` for a release. Builds between tags get a development
63
+ version. CI checks that the built wheel matches the release tag. Each release
64
+ needs a new version. Once published, users install with `uv tool install lllm2`
65
+ or upgrade with `uv tool upgrade lllm2`.
66
+
67
+ The tagged commit must contain the workflow changes: fixing `main` does not
68
+ rerun an existing tag.
@@ -0,0 +1,22 @@
1
+ # Defaults and measurements
2
+
3
+ Defaults are starting points. A matching measured profile can supply tuning;
4
+ otherwise the workbench uses inherited estimates or generic settings. The
5
+ panel records the source and qualifications. Changing the GPU, checkpoint
6
+ or engine can invalidate a measurement; a speed observed on one card is
7
+ not a prediction for another.
8
+
9
+ **Context** is the total allocation shared across **slots**. More slots allow
10
+ concurrent conversations but leave less context for each one. Weights, KV
11
+ cache and runtime buffers all compete for VRAM. Automatic placement can put
12
+ weights in system RAM when the engine supports it, with a possible speed cost.
13
+
14
+ **Prefill** measures prompt processing; **decode** measures output generation.
15
+ Warm runs can reuse prompt tokens, so compare them with like-for-like runs.
16
+ A completed speed test alone does not establish quality or stability. Read
17
+ the workload checks and failure evidence too.
18
+
19
+ Context search tests large prompts and an output budget, retaining failed
20
+ probes. A timeout is inconclusive, rather than proof of a memory limit.
21
+ Recommended context applies headroom to a successful probe; it remains an
22
+ estimate for other workloads.
@@ -0,0 +1,76 @@
1
+ # Common tasks
2
+
3
+ ## Use your own GGUF or engine
4
+
5
+ Put GGUF files under `~/models`, or set a different directory before starting:
6
+
7
+ ```bash
8
+ LLLM2_MODELS_DIR=/data/models lllm2
9
+ ```
10
+
11
+ Choose the checkpoint in **All models**. Under **Customize settings**, select
12
+ the llama-server binary, backend and GPU. To discover engines elsewhere, set
13
+ `LLLM2_ENGINE_ROOTS` to colon-separated directories.
14
+
15
+ ## Serve from the terminal
16
+
17
+ ```bash
18
+ lllm2 models
19
+ lllm2 engines list
20
+ lllm2 launch --model /data/models/model.gguf --engine /path/to/llama-server
21
+ ```
22
+
23
+ With no selection options, `lllm2 launch` looks for a compatible installed
24
+ recommendation. It runs in the foreground; Ctrl-C stops the engine.
25
+
26
+ ## Connect a client
27
+
28
+ Start a model first. OpenAI-compatible clients use
29
+ `http://127.0.0.1:1920/v1`; query `/v1/models` for the served model ID.
30
+
31
+ If their CLIs are installed, these wrappers configure a local session and
32
+ forward additional arguments:
33
+
34
+ ```bash
35
+ lllm2 claude
36
+ lllm2 codex
37
+ lllm2 pi
38
+ ```
39
+
40
+ The wrappers read the running model's context and slots. Relaunch the client
41
+ after changing server context. Use `lllm2 claude -- --help` (or the equivalent
42
+ wrapper) to read the client's own help.
43
+
44
+ ## Compare and save settings
45
+
46
+ In **Experiments**, choose workloads and run a baseline. Change settings and
47
+ add combinations, or run **Baseline + single options**. **Discover usable
48
+ context** adds context probes; long prompts can take several minutes.
49
+
50
+ Inspect completed results and their evidence before loading a configuration
51
+ into **Launch**. Click **Save my settings** to keep it. Launch and experiment
52
+ drafts are separate; loading a result does not save it or restart the model.
53
+ Export results as CSV for comparison or JSON for the full record.
54
+
55
+ ## Access over SSH
56
+
57
+ Forward the panel and API ports from your client machine:
58
+
59
+ ```bash
60
+ ssh -N -L 8082:127.0.0.1:8082 -L 1920:127.0.0.1:1920 user@gpu-host
61
+ ```
62
+
63
+ Open the usual localhost URL. `lllm2 panel --host 0.0.0.0` also exposes the
64
+ panel on a trusted LAN, with no login or TLS; anyone who can reach it can
65
+ control the workbench.
66
+
67
+ ## Troubleshoot
68
+
69
+ - **No engine:** check `lllm2 engines list` and the configured search roots;
70
+ build CUDA or Vulkan if needed.
71
+ - **No GPU:** check `nvidia-smi` and the selected engine's device probe.
72
+ - **Startup fails:** read the engine log, reduce context or GPU layers, and
73
+ disable unsupported acceleration options. Automatic placement needs an
74
+ engine with memory-fitting support.
75
+ - **Client exceeds context:** increase context or reduce slots, then restart
76
+ the model and client. Available memory still limits the allocation.
@@ -0,0 +1,22 @@
1
+ # lllm2
2
+
3
+ Run local models and measure what works on your NVIDIA GPU. The browser panel
4
+ downloads GGUF checkpoints, controls llama.cpp and compares speed, context
5
+ capacity and settings. Launch a model for everyday use, or use **Experiments**
6
+ to test changes before saving them.
7
+
8
+ - **[Tutorial](tutorial.md):** install and serve your first model.
9
+ - **[How-to](how-to.md):** use your own models, connect clients and compare settings.
10
+ - **[Reference](reference.md):** commands, paths and ports.
11
+ - **[Explanation](explanation.md):** what the measurements and defaults mean.
12
+ - **[Development](development.md):** run checks and publish a release.
13
+
14
+ ```{toctree}
15
+ :hidden:
16
+
17
+ tutorial
18
+ how-to
19
+ reference
20
+ explanation
21
+ development
22
+ ```
@@ -0,0 +1,38 @@
1
+ # Reference
2
+
3
+ ## Commands
4
+
5
+ Run `lllm2 COMMAND --help` for all options.
6
+
7
+ | Command | Purpose |
8
+ | --- | --- |
9
+ | `lllm2` or `lllm2 panel` | Start the panel; `--host` and `--port` control its listener. |
10
+ | `lllm2 models [--json]` | List installed GGUF checkpoints. |
11
+ | `lllm2 engines list [--json]` | List discovered llama-server builds. |
12
+ | `lllm2 engines install cuda\|vulkan` | Build an engine; accepts `--ref`, `--name`, `--jobs` and `--cuda-architectures`. |
13
+ | `lllm2 launch` | Serve in the foreground; accepts `--model`, `--engine`, `--backend CUDA\|Vulkan`, `--device` and `--timeout`. |
14
+ | `lllm2 claude`, `lllm2 codex`, `lllm2 pi` | Connect an installed coding-agent CLI to the running model. |
15
+
16
+ ## Paths and ports
17
+
18
+ Set environment variables before starting the workbench or a client wrapper.
19
+
20
+ | Variable | Default | Contents |
21
+ | --- | --- | --- |
22
+ | `LLLM2_MODELS_DIR` | `~/models` | GGUF checkpoints and downloads. |
23
+ | `LLLM2_STATE_DIR` | `~/.local/state/lllm2` | `workbench.sqlite3` and the panel lock. |
24
+ | `LLLM2_ENGINE_HOME` | `~/.local/share/lllm2/engines` | Newly compiled engines. |
25
+ | `LLLM2_ENGINE_ROOTS` | Engine home and `~/.local/share/lllm3090` | Colon-separated engine search roots; setting it replaces the defaults. |
26
+ | `LLLM2_ENGINE_PORT` | `1920` | Model server port on loopback. |
27
+
28
+ The panel defaults to `127.0.0.1:8082`. Its controls use `/api/*`; model
29
+ clients connect to the separate llama.cpp server on port 1920. Protocol
30
+ support depends on the selected engine build.
31
+
32
+ ## Packaged data
33
+
34
+ `lllm2/models.json` contains the downloadable catalogue;
35
+ `lllm2/recommendations.json` records measured recommendations and their
36
+ provenance. The package also includes the panel's HTML, CSS and JavaScript
37
+ and model-specific chat templates. User settings and experiment results
38
+ live in the state directory.
@@ -0,0 +1,45 @@
1
+ # Install and serve a model
2
+
3
+ You need Linux, Python 3.11+, a working NVIDIA driver and enough RAM and disk
4
+ space for your chosen model. Install [uv](https://docs.astral.sh/uv/getting-started/installation/),
5
+ then install the workbench:
6
+
7
+ ```bash
8
+ uv tool install lllm2
9
+ ```
10
+
11
+ ## Prepare an engine
12
+
13
+ Existing llama-server builds under the [engine search paths](reference.md#paths-and-ports)
14
+ are discovered automatically. Otherwise install Git, CMake, a C++ compiler,
15
+ the NVIDIA CUDA toolkit and a compiler compatible with that toolkit, then run:
16
+
17
+ ```bash
18
+ lllm2 engines install cuda
19
+ lllm2 engines list
20
+ ```
21
+
22
+ This compiles llama.cpp into your user directory. System prerequisites are
23
+ installed separately; missing build tools produce installation hints.
24
+ For Vulkan, use `lllm2 engines install vulkan` with Vulkan development
25
+ libraries and `glslc` installed. Use `--ref TAG` to choose a particular
26
+ llama.cpp revision; the default is `master`.
27
+
28
+ ## Start the panel
29
+
30
+ ```bash
31
+ lllm2
32
+ ```
33
+
34
+ 1. Open <http://127.0.0.1:8082> and choose a model from the catalogue.
35
+ 2. Download it, or select an installed checkpoint in **All models**.
36
+ 3. Review **Customize settings** if needed, then click **Start**.
37
+ 4. When ready, connect a client to `http://127.0.0.1:1920/v1`, or use one of
38
+ the [coding-agent launchers](how-to.md#connect-a-client).
39
+
40
+ Use **Stop** to release the GPU. Keep the panel process running while serving.
41
+
42
+ ## Upgrade
43
+
44
+ Stop the panel and any foreground launch, run `uv tool upgrade lllm2`, then
45
+ start the panel again. Engine builds and model downloads are managed separately.
File without changes
@@ -0,0 +1,3 @@
1
+ from .cli import main
2
+
3
+ raise SystemExit(main())