llmrig 0.4.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.
llmrig-0.4.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Sunil Kumar Vadlamani and LLMRig contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
llmrig-0.4.0/PKG-INFO ADDED
@@ -0,0 +1,363 @@
1
+ Metadata-Version: 2.4
2
+ Name: llmrig
3
+ Version: 0.4.0
4
+ Summary: Know what your rig can run. Hardware-aware local LLM discovery, recommendation, setup, and benchmarking.
5
+ License-Expression: MIT
6
+ Project-URL: Homepage, https://github.com/sunilteja93/llmrig
7
+ Project-URL: Repository, https://github.com/sunilteja93/llmrig
8
+ Project-URL: Issues, https://github.com/sunilteja93/llmrig/issues
9
+ Requires-Python: >=3.9
10
+ Description-Content-Type: text/markdown
11
+ License-File: LICENSE
12
+ Dynamic: license-file
13
+
14
+ <h1 align="center">LLMRig</h1>
15
+
16
+ <p align="center">
17
+ <strong>Know what your rig can run.</strong>
18
+ </p>
19
+
20
+ <p align="center">
21
+ Hardware-aware local LLM selection, setup, and benchmarking.
22
+ </p>
23
+
24
+ <p align="center">
25
+ <a href="https://github.com/sunilteja93/llmrig/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/sunilteja93/llmrig/actions/workflows/ci.yml/badge.svg"></a>
26
+ <img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-yellow.svg">
27
+ <img alt="Python 3.9+" src="https://img.shields.io/badge/Python-3.9%2B-blue.svg">
28
+ </p>
29
+
30
+ <p align="center">
31
+ <img src="./assets/llmrig-terminal.svg" alt="LLMRig local model fit flow" width="100%" />
32
+ </p>
33
+
34
+ LLMRig answers one practical question:
35
+
36
+ > **Which local LLM can this machine actually run well?**
37
+
38
+ It detects the hardware you actually have, estimates a conservative model budget, recommends a practical model and context configuration, can set it up through Ollama, and benchmarks the result on the machine itself.
39
+
40
+ ### Install as a CLI
41
+
42
+ From a cloned checkout:
43
+
44
+ ```bash
45
+ git clone https://github.com/sunilteja93/llmrig.git
46
+ cd llmrig
47
+ python3 -m pip install .
48
+ ```
49
+
50
+ Then use LLMRig from anywhere:
51
+
52
+ ```bash
53
+ llmrig doctor
54
+ llmrig recommend
55
+ llmrig models --fit
56
+ ```
57
+
58
+ Or run directly from source without installing:
59
+
60
+ ```bash
61
+ python3 llmrig.py
62
+ ```
63
+
64
+ **LLMRig has no third-party Python runtime dependencies.** The CLI uses only the Python standard library.
65
+
66
+ ```text
67
+ detect hardware → estimate fit → recommend → setup → benchmark → compare
68
+ ```
69
+
70
+ LLMRig is currently **Qwen-first**. The architecture is intended to expand to additional model families, runtimes, GPUs, and platforms without changing the core workflow.
71
+
72
+ ## What LLMRig does
73
+
74
+ - Runs on **macOS, Windows, and Linux**
75
+ - Detects CPU/chip, architecture, RAM, free disk space, and GPU/VRAM when available
76
+ - Respects `OLLAMA_MODELS` when checking model-storage capacity
77
+ - Checks whether Ollama and its local API are available
78
+ - Gives a conservative local-LLM readiness assessment
79
+ - Recommends a model for `balanced`, `speed`, or `quality` priorities
80
+ - Separates official Qwen models from community reduced-refusal derivatives
81
+ - Discovers newly published official Qwen repositories from Hugging Face at runtime
82
+ - Auto-pulls only curated, verified Ollama identifiers
83
+ - Benchmarks generation speed, prompt-evaluation speed, accelerator residency, and lightweight correctness checks
84
+ - Isolates benchmark runs by unloading resident Ollama models before and after each test
85
+ - Saves shareable benchmark reports as JSON and Markdown
86
+ - Uses only the Python standard library
87
+
88
+ ## Current scope
89
+
90
+ LLMRig currently has a **Qwen-first curated catalog** and uses Ollama as its local inference backend. Live discovery tracks likely Qwen LLM/multimodal inference repositories, while automatic installation is limited to model identifiers that have been manually verified.
91
+
92
+ The project name is intentionally broader than Qwen because the long-term direction is to support additional model families and runtimes without changing the user experience:
93
+
94
+ ```text
95
+ hardware → discover → recommend → setup → benchmark → compare
96
+ ```
97
+
98
+ If you want to add support for another model family, runtime, GPU vendor, or operating system, see [CONTRIBUTING.md](CONTRIBUTING.md).
99
+
100
+ ## Requirements
101
+
102
+ - Python **3.9+**
103
+ - macOS, Windows, or Linux
104
+ - Ollama for automatic model setup and benchmarking
105
+ - Internet access for live discovery and model downloads
106
+
107
+ There is no Python dependency installation step for the CLI itself.
108
+
109
+ ## Quick start
110
+
111
+ After cloning or downloading the repository, run the interactive wizard:
112
+
113
+ ```bash
114
+ cd llmrig
115
+ python3 llmrig.py
116
+ ```
117
+
118
+ On Windows, use `python` instead of `python3` if needed.
119
+
120
+ The wizard inspects the machine, recommends a supported model, pulls it if necessary, benchmarks it, and prints the local chat/API details.
121
+
122
+ ## Commands
123
+
124
+ ### Inspect the machine
125
+
126
+ ```bash
127
+ python3 llmrig.py doctor
128
+ ```
129
+
130
+ Machine-readable output:
131
+
132
+ ```bash
133
+ python3 llmrig.py doctor --json
134
+ ```
135
+
136
+ ### List models
137
+
138
+ Show curated local-ready models plus the newest live Qwen LLM/multimodal candidates:
139
+
140
+ ```bash
141
+ python3 llmrig.py models --fit
142
+ ```
143
+
144
+ Force live refresh:
145
+
146
+ ```bash
147
+ python3 llmrig.py models --refresh --fit
148
+ ```
149
+
150
+ Show the full Qwen Hugging Face organization catalog, including non-LLM artifacts:
151
+
152
+ ```bash
153
+ python3 llmrig.py models --all --fit
154
+ ```
155
+
156
+ Use only the built-in curated snapshot:
157
+
158
+ ```bash
159
+ python3 llmrig.py models --offline --fit
160
+ ```
161
+
162
+ ### Get a recommendation
163
+
164
+ ```bash
165
+ python3 llmrig.py recommend
166
+ ```
167
+
168
+ Official models only:
169
+
170
+ ```bash
171
+ python3 llmrig.py recommend --category official
172
+ ```
173
+
174
+ Community reduced-refusal models only:
175
+
176
+ ```bash
177
+ python3 llmrig.py recommend --category unrestricted
178
+ ```
179
+
180
+ Prioritize quality:
181
+
182
+ ```bash
183
+ python3 llmrig.py recommend \
184
+ --category official \
185
+ --preference quality
186
+ ```
187
+
188
+ For CLI convenience, `unrestricted`, `uncensored`, and `reduced-refusal` map to the community reduced-refusal category. `restricted` is accepted as an alias for the official category. LLMRig uses **official** and **reduced-refusal** in its output because those labels are more precise.
189
+
190
+ ### Set up a model
191
+
192
+ ```bash
193
+ python3 llmrig.py setup --category official
194
+ ```
195
+
196
+ Or choose an exact curated model:
197
+
198
+ ```bash
199
+ python3 llmrig.py setup \
200
+ --model qwen3.8:27b-mlx \
201
+ --context 32768
202
+ ```
203
+
204
+ If a known alias of the selected curated build is already installed, LLMRig reuses it when possible.
205
+
206
+ ### Benchmark installed models
207
+
208
+ One model:
209
+
210
+ ```bash
211
+ python3 llmrig.py bench \
212
+ --model qwen3.8:27b-mlx \
213
+ --context 32768 \
214
+ --runs 2
215
+ ```
216
+
217
+ All installed supported Qwen models:
218
+
219
+ ```bash
220
+ python3 llmrig.py bench \
221
+ --all-installed \
222
+ --context 32768 \
223
+ --runs 2
224
+ ```
225
+
226
+ LLMRig deduplicates installed aliases that resolve to the same Ollama model ID.
227
+
228
+ ### Run project checks
229
+
230
+ Offline:
231
+
232
+ ```bash
233
+ python3 llmrig.py check
234
+ ```
235
+
236
+ Include live Hugging Face discovery:
237
+
238
+ ```bash
239
+ python3 llmrig.py check --online
240
+ ```
241
+
242
+ ## Model discovery and safety
243
+
244
+ LLMRig deliberately separates **discovery** from **automatic installation**.
245
+
246
+ The curated catalog contains local model identifiers that LLMRig may pull automatically. Live discovery queries the official Qwen organization on Hugging Face so new releases can appear without requiring an immediate LLMRig release.
247
+
248
+ A newly discovered repository is **discovery only**. LLMRig does not infer package size, hardware fit, or Ollama compatibility from a repository name. A model becomes eligible for one-command setup only after its identifier, package size, context capability, backend support, and provenance are verified and added to the curated catalog.
249
+
250
+ Community reduced-refusal discovery is best-effort and is not an authoritative registry. Third-party models should be reviewed before use.
251
+
252
+ ## Official vs reduced-refusal models
253
+
254
+ **Official** entries are upstream Qwen models distributed through the selected local backend.
255
+
256
+ **Community reduced-refusal** entries are third-party derivatives that modify model behavior to reduce refusals. Their authors may use terms such as `uncensored`, `unrestricted`, or `abliterated`.
257
+
258
+ Reduced refusal behavior does not imply better reasoning, accuracy, safety, or reliability. Review model provenance, licensing, and benchmark results before relying on a derivative for important work.
259
+
260
+ ## Hardware fit and context
261
+
262
+ LLMRig deliberately leaves headroom for the operating system, inference runtime, KV cache, other applications, and GPU/runtime buffers.
263
+
264
+ For Apple Silicon, CPU and GPU share unified memory. For discrete GPUs, LLMRig favors configurations likely to stay mostly or fully on the accelerator when VRAM can be detected.
265
+
266
+ The model's advertised maximum context is not automatically used as the default. Longer context allocations consume more memory, so LLMRig starts conservatively and increases context only when there is comfortable headroom.
267
+
268
+ Hardware-fit results are estimates. **The benchmark on the user's actual machine is the final check.**
269
+
270
+ ## Benchmarking
271
+
272
+ LLMRig unloads currently resident Ollama models before a benchmark and unloads the target model afterward. This reduces cross-model memory contamination and makes comparisons more reproducible.
273
+
274
+ Each benchmark records:
275
+
276
+ - generation tokens/second
277
+ - prompt-evaluation tokens/second
278
+ - load and total duration
279
+ - Ollama-reported context length
280
+ - accelerator residency when available
281
+ - RAM/swap snapshots when available
282
+ - three lightweight deterministic correctness smoke tests
283
+
284
+ Reports are written under `benchmarks/` as JSON and Markdown. That directory is ignored by Git by default so local benchmark data is not published accidentally. Review any benchmark before sharing it.
285
+
286
+ These are local performance/configuration checks, **not academic model-quality benchmarks**. Memory values are snapshots rather than peak-memory measurements.
287
+
288
+ ## Contributing
289
+
290
+ LLMRig is open source and contributions are welcome.
291
+
292
+ Good first contribution areas include:
293
+
294
+ - additional model families
295
+ - new Ollama/local-backend model mappings
296
+ - AMD, Intel, and NVIDIA GPU detection improvements
297
+ - Windows and Linux hardware testing
298
+ - reproducible benchmark improvements
299
+ - new hardware profiles and recommendation rules
300
+ - documentation and usability improvements
301
+ - tests for new operating systems and model variants
302
+
303
+ Please read [CONTRIBUTING.md](CONTRIBUTING.md) before opening a pull request. Bug reports, feature ideas, model-support requests, and benchmark improvements are all welcome through GitHub issues.
304
+
305
+ ## Development
306
+
307
+ Run the full local validation set before opening a pull request:
308
+
309
+ ```bash
310
+ python3 -m py_compile llmrig.py
311
+ python3 -m unittest discover -s tests -v
312
+ python3 llmrig.py check
313
+ python3 llmrig.py models --offline --fit
314
+ ```
315
+
316
+ With internet access:
317
+
318
+ ```bash
319
+ python3 llmrig.py check --online
320
+ ```
321
+
322
+ GitHub Actions also runs compile, unit-test, and sanity-check jobs on Linux, macOS, and Windows.
323
+
324
+ ## Repository layout
325
+
326
+ ```text
327
+ llmrig/
328
+ ├── .github/
329
+ │ ├── ISSUE_TEMPLATE/
330
+ │ ├── workflows/
331
+ │ │ └── ci.yml
332
+ │ └── PULL_REQUEST_TEMPLATE.md
333
+ ├── tests/
334
+ │ ├── __init__.py
335
+ │ └── test_llmrig.py
336
+ ├── .gitignore
337
+ ├── CODE_OF_CONDUCT.md
338
+ ├── CONTRIBUTING.md
339
+ ├── LICENSE
340
+ ├── README.md
341
+ ├── SECURITY.md
342
+ └── llmrig.py
343
+ ```
344
+
345
+ ## Roadmap
346
+
347
+ The roadmap is intentionally community-driven. Likely directions include support for more model families, multiple local inference runtimes, richer GPU detection, benchmark leaderboards, and standardized community hardware reports.
348
+
349
+ The rule for new functionality is simple: **be useful, be reproducible, and do not turn unverified discovery metadata into an automatic install decision.**
350
+
351
+ ## License
352
+
353
+ LLMRig is released under the [MIT License](LICENSE).
354
+
355
+ ## Primary references
356
+
357
+ - Qwen official Hugging Face organization: `https://huggingface.co/Qwen`
358
+ - Qwen3.8 official repository: `https://github.com/QwenLM/Qwen3.8`
359
+ - Hugging Face Hub API: `https://huggingface.co/docs/huggingface_hub/package_reference/hf_api`
360
+ - Ollama documentation: `https://docs.ollama.com/`
361
+ - Ollama generate API: `https://docs.ollama.com/api/generate`
362
+ - Ollama running-model API: `https://docs.ollama.com/api/ps`
363
+ - Qwen3.8 Ollama tags: `https://ollama.com/library/qwen3.8/tags`