llm-checker 3.1.0

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 (53) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +418 -0
  3. package/analyzer/compatibility.js +584 -0
  4. package/analyzer/performance.js +505 -0
  5. package/bin/CLAUDE.md +12 -0
  6. package/bin/enhanced_cli.js +3118 -0
  7. package/bin/test-deterministic.js +41 -0
  8. package/package.json +96 -0
  9. package/src/CLAUDE.md +12 -0
  10. package/src/ai/intelligent-selector.js +615 -0
  11. package/src/ai/model-selector.js +312 -0
  12. package/src/ai/multi-objective-selector.js +820 -0
  13. package/src/commands/check.js +58 -0
  14. package/src/data/CLAUDE.md +11 -0
  15. package/src/data/model-database.js +637 -0
  16. package/src/data/sync-manager.js +279 -0
  17. package/src/hardware/CLAUDE.md +12 -0
  18. package/src/hardware/backends/CLAUDE.md +11 -0
  19. package/src/hardware/backends/apple-silicon.js +318 -0
  20. package/src/hardware/backends/cpu-detector.js +490 -0
  21. package/src/hardware/backends/cuda-detector.js +417 -0
  22. package/src/hardware/backends/intel-detector.js +436 -0
  23. package/src/hardware/backends/rocm-detector.js +440 -0
  24. package/src/hardware/detector.js +573 -0
  25. package/src/hardware/pc-optimizer.js +635 -0
  26. package/src/hardware/specs.js +286 -0
  27. package/src/hardware/unified-detector.js +442 -0
  28. package/src/index.js +2289 -0
  29. package/src/models/CLAUDE.md +17 -0
  30. package/src/models/ai-check-selector.js +806 -0
  31. package/src/models/catalog.json +426 -0
  32. package/src/models/deterministic-selector.js +1145 -0
  33. package/src/models/expanded_database.js +1142 -0
  34. package/src/models/intelligent-selector.js +532 -0
  35. package/src/models/requirements.js +310 -0
  36. package/src/models/scoring-config.js +57 -0
  37. package/src/models/scoring-engine.js +715 -0
  38. package/src/ollama/.cache/README.md +33 -0
  39. package/src/ollama/CLAUDE.md +24 -0
  40. package/src/ollama/client.js +438 -0
  41. package/src/ollama/enhanced-client.js +113 -0
  42. package/src/ollama/enhanced-scraper.js +634 -0
  43. package/src/ollama/manager.js +357 -0
  44. package/src/ollama/native-scraper.js +776 -0
  45. package/src/plugins/CLAUDE.md +11 -0
  46. package/src/plugins/examples/custom_model_plugin.js +87 -0
  47. package/src/plugins/index.js +295 -0
  48. package/src/utils/CLAUDE.md +11 -0
  49. package/src/utils/config.js +359 -0
  50. package/src/utils/formatter.js +315 -0
  51. package/src/utils/logger.js +272 -0
  52. package/src/utils/model-classifier.js +167 -0
  53. package/src/utils/verbose-progress.js +266 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Pavelevich
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.
package/README.md ADDED
@@ -0,0 +1,418 @@
1
+ <p align="center">
2
+ <img src="llmlogo.jpg" alt="LLM Checker Logo" width="200">
3
+ </p>
4
+
5
+ <p align="center">
6
+ <h1 align="center">LLM Checker</h1>
7
+ <p align="center">
8
+ <strong>Intelligent Ollama Model Selector</strong>
9
+ </p>
10
+ <p align="center">
11
+ AI-powered CLI that analyzes your hardware and recommends optimal LLM models<br/>
12
+ Deterministic scoring across <b>35+ curated models</b> with hardware-calibrated memory estimation
13
+ </p>
14
+ </p>
15
+
16
+ <p align="center">
17
+ <a href="https://www.npmjs.com/package/llm-checker"><img src="https://img.shields.io/npm/v/llm-checker?style=flat-square&color=0066FF" alt="npm version"></a>
18
+ <a href="https://www.npmjs.com/package/llm-checker"><img src="https://img.shields.io/npm/dm/llm-checker?style=flat-square&color=0066FF" alt="npm downloads"></a>
19
+ <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-0066FF?style=flat-square" alt="License"></a>
20
+ <a href="https://nodejs.org/"><img src="https://img.shields.io/badge/node-%3E%3D16-0066FF?style=flat-square" alt="Node.js"></a>
21
+ </p>
22
+
23
+ <p align="center">
24
+ <a href="#installation">Installation</a> &bull;
25
+ <a href="#quick-start">Quick Start</a> &bull;
26
+ <a href="#commands">Commands</a> &bull;
27
+ <a href="#scoring-system">Scoring</a> &bull;
28
+ <a href="#supported-hardware">Hardware</a>
29
+ </p>
30
+
31
+ ---
32
+
33
+ ## Why LLM Checker?
34
+
35
+ Choosing the right LLM for your hardware is complex. With thousands of model variants, quantization levels, and hardware configurations, finding the optimal model requires understanding memory bandwidth, VRAM limits, and performance characteristics.
36
+
37
+ **LLM Checker solves this.** It analyzes your system, scores every compatible model across four dimensions (Quality, Speed, Fit, Context), and delivers actionable recommendations in seconds.
38
+
39
+ ---
40
+
41
+ ## Features
42
+
43
+ | | Feature | Description |
44
+ |:---:|---|---|
45
+ | **35+** | Curated Models | Hand-picked catalog covering all major families and sizes (1B-32B) |
46
+ | **4D** | Scoring Engine | Quality, Speed, Fit, Context &mdash; weighted by use case |
47
+ | **Multi-GPU** | Hardware Detection | Apple Silicon, NVIDIA CUDA, AMD ROCm, Intel Arc, CPU |
48
+ | **Calibrated** | Memory Estimation | Bytes-per-parameter formula validated against real Ollama sizes |
49
+ | **Zero** | Native Dependencies | Pure JavaScript &mdash; works on any Node.js 16+ system |
50
+ | **Optional** | SQLite Search | Install `sql.js` to unlock `sync`, `search`, and `smart-recommend` |
51
+
52
+ ---
53
+
54
+ ## Installation
55
+
56
+ ```bash
57
+ # Install globally
58
+ npm install -g llm-checker
59
+
60
+ # Or run directly with npx
61
+ npx llm-checker hw-detect
62
+ ```
63
+
64
+ **Requirements:**
65
+ - Node.js 16+ (any version: 16, 18, 20, 22, 24)
66
+ - [Ollama](https://ollama.ai) installed for running models
67
+
68
+ **Optional:** For database search features (`sync`, `search`, `smart-recommend`):
69
+ ```bash
70
+ npm install sql.js
71
+ ```
72
+
73
+ ---
74
+
75
+ ## Quick Start
76
+
77
+ ```bash
78
+ # 1. Detect your hardware capabilities
79
+ llm-checker hw-detect
80
+
81
+ # 2. Get full analysis with compatible models
82
+ llm-checker check
83
+
84
+ # 3. Get intelligent recommendations by category
85
+ llm-checker recommend
86
+
87
+ # 4. (Optional) Sync full database and search
88
+ llm-checker sync
89
+ llm-checker search qwen --use-case coding
90
+ ```
91
+
92
+ ---
93
+
94
+ ## Commands
95
+
96
+ ### Core Commands
97
+
98
+ | Command | Description |
99
+ |---------|-------------|
100
+ | `hw-detect` | Detect GPU/CPU capabilities, memory, backends |
101
+ | `check` | Full system analysis with compatible models and recommendations |
102
+ | `recommend` | Intelligent recommendations by category (coding, reasoning, multimodal, etc.) |
103
+ | `installed` | Rank your installed Ollama models by compatibility |
104
+
105
+ ### Advanced Commands (require `sql.js`)
106
+
107
+ | Command | Description |
108
+ |---------|-------------|
109
+ | `sync` | Download the latest model catalog from Ollama registry |
110
+ | `search <query>` | Search models with filters and intelligent scoring |
111
+ | `smart-recommend` | Advanced recommendations using the full scoring engine |
112
+
113
+ ### AI Commands
114
+
115
+ | Command | Description |
116
+ |---------|-------------|
117
+ | `ai-check` | AI-powered model evaluation with meta-analysis |
118
+ | `ai-run` | AI-powered model selection and execution |
119
+
120
+ ---
121
+
122
+ ### `hw-detect` &mdash; Hardware Analysis
123
+
124
+ ```bash
125
+ llm-checker hw-detect
126
+ ```
127
+
128
+ ```
129
+ Summary:
130
+ Apple M4 Pro (24GB Unified Memory)
131
+ Tier: MEDIUM HIGH
132
+ Max model size: 15GB
133
+ Best backend: metal
134
+
135
+ CPU:
136
+ Apple M4 Pro
137
+ Cores: 12 (12 physical)
138
+ SIMD: NEON
139
+
140
+ Metal:
141
+ GPU Cores: 16
142
+ Unified Memory: 24GB
143
+ Memory Bandwidth: 273GB/s
144
+ ```
145
+
146
+ ### `recommend` &mdash; Category Recommendations
147
+
148
+ ```bash
149
+ llm-checker recommend
150
+ ```
151
+
152
+ ```
153
+ INTELLIGENT RECOMMENDATIONS BY CATEGORY
154
+ Hardware Tier: HIGH | Models Analyzed: 205
155
+
156
+ Coding:
157
+ qwen2.5-coder:14b (14B)
158
+ Score: 78/100
159
+ Command: ollama pull qwen2.5-coder:14b
160
+
161
+ Reasoning:
162
+ deepseek-r1:14b (14B)
163
+ Score: 86/100
164
+ Command: ollama pull deepseek-r1:14b
165
+
166
+ Multimodal:
167
+ llama3.2-vision:11b (11B)
168
+ Score: 83/100
169
+ Command: ollama pull llama3.2-vision:11b
170
+ ```
171
+
172
+ ### `search` &mdash; Model Search
173
+
174
+ ```bash
175
+ llm-checker search llama -l 5
176
+ llm-checker search coding --use-case coding
177
+ llm-checker search qwen --quant Q4_K_M --max-size 8
178
+ ```
179
+
180
+ | Option | Description |
181
+ |--------|-------------|
182
+ | `-l, --limit <n>` | Number of results (default: 10) |
183
+ | `-u, --use-case <type>` | Optimize for: `general`, `coding`, `chat`, `reasoning`, `creative`, `fast` |
184
+ | `--max-size <gb>` | Maximum model size in GB |
185
+ | `--quant <type>` | Filter by quantization: `Q4_K_M`, `Q8_0`, `FP16`, etc. |
186
+ | `--family <name>` | Filter by model family |
187
+
188
+ ---
189
+
190
+ ## Model Catalog
191
+
192
+ The built-in catalog includes 35+ models from the most popular Ollama families:
193
+
194
+ | Family | Models | Best For |
195
+ |--------|--------|----------|
196
+ | **Qwen 2.5/3** | 7B, 14B, Coder 7B/14B/32B, VL 3B/7B | Coding, general, vision |
197
+ | **Llama 3.x** | 1B, 3B, 8B, Vision 11B | General, chat, multimodal |
198
+ | **DeepSeek** | R1 8B/14B/32B, Coder V2 16B | Reasoning, coding |
199
+ | **Phi-4** | 14B | Reasoning, math |
200
+ | **Gemma 2** | 2B, 9B | General, efficient |
201
+ | **Mistral** | 7B, Nemo 12B | Creative, chat |
202
+ | **CodeLlama** | 7B, 13B | Coding |
203
+ | **LLaVA** | 7B, 13B | Vision |
204
+ | **Embeddings** | nomic-embed-text, mxbai-embed-large, bge-m3, all-minilm | RAG, search |
205
+
206
+ Models are automatically combined with any locally installed Ollama models for scoring.
207
+
208
+ ---
209
+
210
+ ## Scoring System
211
+
212
+ Models are evaluated across four dimensions, weighted by use case:
213
+
214
+ | Dimension | Description |
215
+ |-----------|-------------|
216
+ | **Q** Quality | Model family reputation + parameter count + quantization penalty |
217
+ | **S** Speed | Estimated tokens/sec based on hardware backend and model size |
218
+ | **F** Fit | Memory utilization efficiency (how well it fits in available RAM) |
219
+ | **C** Context | Context window capability vs. target context length |
220
+
221
+ ### Scoring Weights by Use Case
222
+
223
+ Three scoring systems are available, each optimized for different workflows:
224
+
225
+ **Deterministic Selector** (primary &mdash; used by `check` and `recommend`):
226
+
227
+ | Category | Quality | Speed | Fit | Context |
228
+ |----------|:-------:|:-----:|:---:|:-------:|
229
+ | `general` | 45% | 35% | 15% | 5% |
230
+ | `coding` | 55% | 20% | 15% | 10% |
231
+ | `reasoning` | 60% | 10% | 20% | 10% |
232
+ | `multimodal` | 50% | 15% | 20% | 15% |
233
+
234
+ **Scoring Engine** (used by `smart-recommend` and `search`):
235
+
236
+ | Use Case | Quality | Speed | Fit | Context |
237
+ |----------|:-------:|:-----:|:---:|:-------:|
238
+ | `general` | 40% | 35% | 15% | 10% |
239
+ | `coding` | 55% | 20% | 15% | 10% |
240
+ | `reasoning` | 60% | 15% | 10% | 15% |
241
+ | `chat` | 40% | 40% | 15% | 5% |
242
+ | `fast` | 25% | 55% | 15% | 5% |
243
+ | `quality` | 65% | 10% | 15% | 10% |
244
+
245
+ All weights are centralized in `src/models/scoring-config.js`.
246
+
247
+ ### Memory Estimation
248
+
249
+ Memory requirements are calculated using calibrated bytes-per-parameter values:
250
+
251
+ | Quantization | Bytes/Param | 7B Model | 14B Model | 32B Model |
252
+ |:------------:|:-----------:|:--------:|:---------:|:---------:|
253
+ | Q8_0 | 1.05 | ~8 GB | ~16 GB | ~35 GB |
254
+ | Q4_K_M | 0.58 | ~5 GB | ~9 GB | ~20 GB |
255
+ | Q3_K | 0.48 | ~4 GB | ~8 GB | ~17 GB |
256
+
257
+ The selector automatically picks the best quantization that fits your available memory.
258
+
259
+ ---
260
+
261
+ ## Supported Hardware
262
+
263
+ <details>
264
+ <summary><strong>Apple Silicon</strong></summary>
265
+
266
+ - M1, M1 Pro, M1 Max, M1 Ultra
267
+ - M2, M2 Pro, M2 Max, M2 Ultra
268
+ - M3, M3 Pro, M3 Max
269
+ - M4, M4 Pro, M4 Max
270
+
271
+ </details>
272
+
273
+ <details>
274
+ <summary><strong>NVIDIA (CUDA)</strong></summary>
275
+
276
+ - RTX 50 Series (5090, 5080, 5070 Ti, 5070)
277
+ - RTX 40 Series (4090, 4080, 4070 Ti, 4070, 4060 Ti, 4060)
278
+ - RTX 30 Series (3090 Ti, 3090, 3080 Ti, 3080, 3070 Ti, 3070, 3060 Ti, 3060)
279
+ - Data Center (H100, A100, A10, L40, T4)
280
+
281
+ </details>
282
+
283
+ <details>
284
+ <summary><strong>AMD (ROCm)</strong></summary>
285
+
286
+ - RX 7900 XTX, 7900 XT, 7800 XT, 7700 XT
287
+ - RX 6900 XT, 6800 XT, 6800
288
+ - Instinct MI300X, MI300A, MI250X, MI210
289
+
290
+ </details>
291
+
292
+ <details>
293
+ <summary><strong>Intel</strong></summary>
294
+
295
+ - Arc A770, A750, A580, A380
296
+ - Integrated Iris Xe, UHD Graphics
297
+
298
+ </details>
299
+
300
+ <details>
301
+ <summary><strong>CPU Backends</strong></summary>
302
+
303
+ - AVX-512 + AMX (Intel Sapphire Rapids, Emerald Rapids)
304
+ - AVX-512 (Intel Ice Lake+, AMD Zen 4)
305
+ - AVX2 (Most modern x86 CPUs)
306
+ - ARM NEON (Apple Silicon, AWS Graviton, Ampere Altra)
307
+
308
+ </details>
309
+
310
+ ---
311
+
312
+ ## Architecture
313
+
314
+ ```
315
+ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
316
+ │ Hardware │────>│ Model │────>│ Deterministic │
317
+ │ Detection │ │ Catalog (35+) │ │ Selector │
318
+ └─────────────────┘ └─────────────────┘ └─────────────────┘
319
+ │ │ │
320
+ Detects GPU/CPU JSON catalog + 4D scoring
321
+ Memory / Backend Installed models Per-category weights
322
+ Usable memory calc Auto-dedup Memory calibration
323
+
324
+ v
325
+ ┌─────────────────┐
326
+ │ Ranked │
327
+ │ Recommendations│
328
+ └─────────────────┘
329
+ ```
330
+
331
+ **Selector Pipeline:**
332
+ 1. **Hardware profiling** &mdash; CPU, GPU, RAM, acceleration backend
333
+ 2. **Model pool** &mdash; Merge catalog + installed Ollama models (deduped)
334
+ 3. **Category filter** &mdash; Keep models relevant to the use case
335
+ 4. **Quantization selection** &mdash; Best quant that fits in memory budget
336
+ 5. **4D scoring** &mdash; Q, S, F, C with category-specific weights
337
+ 6. **Ranking** &mdash; Top N candidates returned
338
+
339
+ ---
340
+
341
+ ## Examples
342
+
343
+ **Detect your hardware:**
344
+ ```bash
345
+ llm-checker hw-detect
346
+ ```
347
+
348
+ **Get recommendations for all categories:**
349
+ ```bash
350
+ llm-checker recommend
351
+ ```
352
+
353
+ **Full system analysis with compatible models:**
354
+ ```bash
355
+ llm-checker check
356
+ ```
357
+
358
+ **Find the best coding model:**
359
+ ```bash
360
+ llm-checker recommend --category coding
361
+ ```
362
+
363
+ **Search for small, fast models under 5GB:**
364
+ ```bash
365
+ llm-checker search "7b" --max-size 5 --use-case fast
366
+ ```
367
+
368
+ **Get high-quality reasoning models:**
369
+ ```bash
370
+ llm-checker smart-recommend --use-case reasoning
371
+ ```
372
+
373
+ ---
374
+
375
+ ## Development
376
+
377
+ ```bash
378
+ git clone https://github.com/Pavelevich/llm-checker.git
379
+ cd llm-checker
380
+ npm install
381
+ node bin/enhanced_cli.js hw-detect
382
+ ```
383
+
384
+ ### Project Structure
385
+
386
+ ```
387
+ src/
388
+ models/
389
+ deterministic-selector.js # Primary selection algorithm
390
+ scoring-config.js # Centralized scoring weights
391
+ scoring-engine.js # Advanced scoring (smart-recommend)
392
+ catalog.json # Curated model catalog (35+ models)
393
+ ai/
394
+ multi-objective-selector.js # Multi-objective optimization
395
+ ai-check-selector.js # LLM-based evaluation
396
+ hardware/
397
+ detector.js # Hardware detection
398
+ unified-detector.js # Cross-platform detection
399
+ data/
400
+ model-database.js # SQLite storage (optional)
401
+ sync-manager.js # Database sync from Ollama registry
402
+ bin/
403
+ enhanced_cli.js # CLI entry point
404
+ ```
405
+
406
+ ---
407
+
408
+ ## License
409
+
410
+ MIT License &mdash; see [LICENSE](LICENSE) for details.
411
+
412
+ ---
413
+
414
+ <p align="center">
415
+ <a href="https://github.com/Pavelevich/llm-checker">GitHub</a> &bull;
416
+ <a href="https://www.npmjs.com/package/llm-checker">npm</a> &bull;
417
+ <a href="https://github.com/Pavelevich/llm-checker/issues">Issues</a>
418
+ </p>