ai-model-detector 1.0.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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 eliekh05
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.
@@ -0,0 +1,220 @@
1
+ Metadata-Version: 2.4
2
+ Name: ai-model-detector
3
+ Version: 1.0.0
4
+ Summary: Deep hardware scanner that recommends and auto-downloads the best local AI model for your system
5
+ License: MIT License
6
+
7
+ Copyright (c) 2026 eliekh05
8
+
9
+ Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ of this software and associated documentation files (the "Software"), to deal
11
+ in the Software without restriction, including without limitation the rights
12
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ copies of the Software, and to permit persons to whom the Software is
14
+ furnished to do so, subject to the following conditions:
15
+
16
+ The above copyright notice and this permission notice shall be included in all
17
+ copies or substantial portions of the Software.
18
+
19
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
+ SOFTWARE.
26
+
27
+ Project-URL: Homepage, https://github.com/eliekh05/AI-Model-Detector-Auto-Downloader
28
+ Project-URL: Issues, https://github.com/eliekh05/AI-Model-Detector-Auto-Downloader/issues
29
+ Keywords: ollama,llm,ai,hardware,model-selection,local-ai
30
+ Classifier: Development Status :: 4 - Beta
31
+ Classifier: Environment :: Console
32
+ Classifier: Intended Audience :: Developers
33
+ Classifier: Intended Audience :: End Users/Desktop
34
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
35
+ Classifier: Topic :: System :: Hardware
36
+ Classifier: Programming Language :: Python :: 3
37
+ Classifier: Programming Language :: Python :: 3.11
38
+ Classifier: Programming Language :: Python :: 3.12
39
+ Classifier: License :: OSI Approved :: MIT License
40
+ Classifier: Operating System :: OS Independent
41
+ Requires-Python: >=3.11
42
+ Description-Content-Type: text/markdown
43
+ License-File: LICENSE
44
+ Requires-Dist: psutil>=5.9
45
+ Requires-Dist: requests>=2.31
46
+ Requires-Dist: rich>=13.7
47
+ Requires-Dist: pyyaml>=6.0
48
+ Provides-Extra: dev
49
+ Requires-Dist: pytest>=8.0; extra == "dev"
50
+ Requires-Dist: ruff>=0.4; extra == "dev"
51
+ Dynamic: license-file
52
+
53
+ # AI Model Detector & Auto Downloader
54
+
55
+ > Deep hardware scanning · Live model registry · Smart recommendations · Auto install
56
+
57
+ A precise, transparent tool that scans your entire system — from OS and CPU instruction sets to GPU drivers and available VRAM — then queries the **live** Ollama library, Hugging Face, and community issue trackers to recommend and install the best local AI model for your hardware.
58
+
59
+ Unlike tools that rely solely on GPU data or maintain a hardcoded model list, this tool fetches its registry fresh every run, so newly released models appear automatically without requiring a software update.
60
+
61
+ ---
62
+
63
+ ## Install
64
+
65
+ ```bash
66
+ pip3 install ai-model-detector --break-system-packages
67
+ ```
68
+
69
+ **Requirements:** Python ≥ 3.11, internet connection (for live registry fetch)
70
+
71
+ ---
72
+
73
+ ## Quick Start
74
+
75
+ ```bash
76
+ # Scan hardware, fetch live registry, recommend + optionally install
77
+ ai-model-detector
78
+
79
+ # Filter by use-case
80
+ ai-model-detector --category code
81
+ ai-model-detector --category vision
82
+ ai-model-detector --category math
83
+ ai-model-detector --category reasoning
84
+
85
+ # Show more recommendations
86
+ ai-model-detector --top 10
87
+
88
+ # Import a macOS system profile instead of live scan
89
+ ai-model-detector --import ~/Desktop/MyMac.spx
90
+
91
+ # Pull a specific model directly
92
+ ai-model-detector --pull llama3.2:3b
93
+
94
+ # Output full JSON (pipe to other tools)
95
+ ai-model-detector --json > results.json
96
+
97
+ # List already-installed models
98
+ ai-model-detector --installed
99
+ ```
100
+
101
+ ---
102
+
103
+ ## How It Works
104
+
105
+ ### 1 — System Scan
106
+
107
+ Reads hardware directly from the OS — no config file needed:
108
+
109
+ | Source | Data collected |
110
+ |--------|---------------|
111
+ | `/proc/cpuinfo` · `sysctl` · `wmic` | CPU brand, cores, AVX / AVX2 / AVX-512 / F16C flags |
112
+ | `psutil` | RAM total, RAM available |
113
+ | `dmidecode` · `system_profiler` · `wmic` | RAM speed |
114
+ | `nvidia-smi` | NVIDIA GPU name, VRAM, CUDA version |
115
+ | `rocm-smi` · `rocminfo` | AMD GPU name, VRAM, ROCm version |
116
+ | `system_profiler SPDisplaysDataType` | Apple Silicon GPU, Metal support |
117
+ | `psutil.disk_usage` | Free disk space |
118
+ | `ollama --version` | Ollama presence and version |
119
+
120
+ On macOS, `machdep.cpu.features` and `machdep.cpu.leaf7_features` are both queried so AVX2 is correctly detected on Intel Macs (it only appears in `leaf7_features`).
121
+
122
+ On macOS, pass `--import file.spx` to read a `system_profiler` export instead of scanning live hardware.
123
+
124
+ ### 2 — Live Registry Fetch
125
+
126
+ Every run fetches fresh data — no model list is stored in the source code:
127
+
128
+ - **Ollama library** — all available models with tags, sizes, and pull counts
129
+ - **Hugging Face API** — top GGUF models by download count (shown for reference; flagged as manual-download only)
130
+ - **Ollama GitHub issues** — open bug reports mapped to model names
131
+
132
+ ### 3 — Hardware-Aware Scoring
133
+
134
+ Each model variant is scored 0–100 against your specific hardware:
135
+
136
+ | Factor | Effect |
137
+ |--------|--------|
138
+ | Available RAM vs model RAM requirement | ±20 pts |
139
+ | GPU VRAM vs model VRAM requirement | ±20 pts |
140
+ | Free disk space | ±30 pts |
141
+ | CPU instruction sets (AVX2, AVX-512) | ±5 pts |
142
+ | Apple Silicon + Metal | +10 pts |
143
+ | Quantization suitability (q4_K_M sweet spot) | ±8 pts |
144
+ | Ollama-pullable (single command install) | +8 pts |
145
+ | HuggingFace-only (manual download required) | −25 pts |
146
+ | Community bug reports | −3 pts per issue |
147
+ | Popularity (pull count) | +2–5 pts |
148
+
149
+ ### 4 — Install
150
+
151
+ Runs `ollama pull <model>` with live streaming output. Only models from the Ollama library are offered for auto-install — HuggingFace-only GGUF models are shown in the list but flagged as manual-download. If Ollama isn't installed, platform-specific install instructions are provided.
152
+
153
+ ---
154
+
155
+ ## CLI Reference
156
+
157
+ ```
158
+ usage: ai-model-detector [options]
159
+
160
+ options:
161
+ --import FILE Import a macOS .spx system profile
162
+ --category CAT Filter: chat | code | vision | math | reasoning | embedding
163
+ --top N Number of recommendations to show (default: 5)
164
+ --json Output full results as JSON
165
+ --installed List already-installed Ollama models
166
+ --pull MODEL Pull a specific model (e.g. llama3.2:3b)
167
+ --no-hf Skip Hugging Face supplemental data
168
+ --verbose / -v Enable debug logging
169
+ --version Show version and exit
170
+ ```
171
+
172
+ ---
173
+
174
+ ## macOS `.spx` Import
175
+
176
+ Export your system profile from the macOS System Information app:
177
+
178
+ 1. Open **System Information** (`Cmd+Space` → "System Information")
179
+ 2. **File → Save…** → choose **System Information (.spx)**
180
+ 3. Run: `ai-model-detector --import ~/Desktop/MyMac.spx`
181
+
182
+ ---
183
+
184
+ ## Why Not Just Use GPU Data?
185
+
186
+ Tools that only look at GPU VRAM miss critical constraints:
187
+
188
+ - A model might fit in VRAM but not in RAM when layers spill to CPU
189
+ - CPU instruction sets (AVX2 vs AVX-512) drastically affect CPU-offload speed
190
+ - Free disk space at download time is often the real bottleneck
191
+ - Community bug reports reveal models that perform poorly on specific hardware regardless of specs
192
+
193
+ This tool checks all of these, not just VRAM.
194
+
195
+ ---
196
+
197
+ ## Project Structure
198
+
199
+ ```
200
+ src/ai_model_detector/
201
+ ├── scanner.py — deep hardware profiler (live + .spx import)
202
+ ├── registry.py — live model registry fetcher (Ollama + HuggingFace)
203
+ ├── scorer.py — hardware-aware scoring and ranking engine
204
+ ├── downloader.py — ollama pull with ANSI-stripped streaming output
205
+ ├── display.py — Rich terminal UI
206
+ └── cli.py — CLI entry point
207
+ ```
208
+
209
+ ---
210
+
211
+ ## Contributing
212
+
213
+ Issues, hardware reports, and PRs welcome at
214
+ [github.com/eliekh05/AI-Model-Detector-Auto-Downloader](https://github.com/eliekh05/AI-Model-Detector-Auto-Downloader)
215
+
216
+ ---
217
+
218
+ ## License
219
+
220
+ MIT — see [LICENSE](LICENSE)
@@ -0,0 +1,168 @@
1
+ # AI Model Detector & Auto Downloader
2
+
3
+ > Deep hardware scanning · Live model registry · Smart recommendations · Auto install
4
+
5
+ A precise, transparent tool that scans your entire system — from OS and CPU instruction sets to GPU drivers and available VRAM — then queries the **live** Ollama library, Hugging Face, and community issue trackers to recommend and install the best local AI model for your hardware.
6
+
7
+ Unlike tools that rely solely on GPU data or maintain a hardcoded model list, this tool fetches its registry fresh every run, so newly released models appear automatically without requiring a software update.
8
+
9
+ ---
10
+
11
+ ## Install
12
+
13
+ ```bash
14
+ pip3 install ai-model-detector --break-system-packages
15
+ ```
16
+
17
+ **Requirements:** Python ≥ 3.11, internet connection (for live registry fetch)
18
+
19
+ ---
20
+
21
+ ## Quick Start
22
+
23
+ ```bash
24
+ # Scan hardware, fetch live registry, recommend + optionally install
25
+ ai-model-detector
26
+
27
+ # Filter by use-case
28
+ ai-model-detector --category code
29
+ ai-model-detector --category vision
30
+ ai-model-detector --category math
31
+ ai-model-detector --category reasoning
32
+
33
+ # Show more recommendations
34
+ ai-model-detector --top 10
35
+
36
+ # Import a macOS system profile instead of live scan
37
+ ai-model-detector --import ~/Desktop/MyMac.spx
38
+
39
+ # Pull a specific model directly
40
+ ai-model-detector --pull llama3.2:3b
41
+
42
+ # Output full JSON (pipe to other tools)
43
+ ai-model-detector --json > results.json
44
+
45
+ # List already-installed models
46
+ ai-model-detector --installed
47
+ ```
48
+
49
+ ---
50
+
51
+ ## How It Works
52
+
53
+ ### 1 — System Scan
54
+
55
+ Reads hardware directly from the OS — no config file needed:
56
+
57
+ | Source | Data collected |
58
+ |--------|---------------|
59
+ | `/proc/cpuinfo` · `sysctl` · `wmic` | CPU brand, cores, AVX / AVX2 / AVX-512 / F16C flags |
60
+ | `psutil` | RAM total, RAM available |
61
+ | `dmidecode` · `system_profiler` · `wmic` | RAM speed |
62
+ | `nvidia-smi` | NVIDIA GPU name, VRAM, CUDA version |
63
+ | `rocm-smi` · `rocminfo` | AMD GPU name, VRAM, ROCm version |
64
+ | `system_profiler SPDisplaysDataType` | Apple Silicon GPU, Metal support |
65
+ | `psutil.disk_usage` | Free disk space |
66
+ | `ollama --version` | Ollama presence and version |
67
+
68
+ On macOS, `machdep.cpu.features` and `machdep.cpu.leaf7_features` are both queried so AVX2 is correctly detected on Intel Macs (it only appears in `leaf7_features`).
69
+
70
+ On macOS, pass `--import file.spx` to read a `system_profiler` export instead of scanning live hardware.
71
+
72
+ ### 2 — Live Registry Fetch
73
+
74
+ Every run fetches fresh data — no model list is stored in the source code:
75
+
76
+ - **Ollama library** — all available models with tags, sizes, and pull counts
77
+ - **Hugging Face API** — top GGUF models by download count (shown for reference; flagged as manual-download only)
78
+ - **Ollama GitHub issues** — open bug reports mapped to model names
79
+
80
+ ### 3 — Hardware-Aware Scoring
81
+
82
+ Each model variant is scored 0–100 against your specific hardware:
83
+
84
+ | Factor | Effect |
85
+ |--------|--------|
86
+ | Available RAM vs model RAM requirement | ±20 pts |
87
+ | GPU VRAM vs model VRAM requirement | ±20 pts |
88
+ | Free disk space | ±30 pts |
89
+ | CPU instruction sets (AVX2, AVX-512) | ±5 pts |
90
+ | Apple Silicon + Metal | +10 pts |
91
+ | Quantization suitability (q4_K_M sweet spot) | ±8 pts |
92
+ | Ollama-pullable (single command install) | +8 pts |
93
+ | HuggingFace-only (manual download required) | −25 pts |
94
+ | Community bug reports | −3 pts per issue |
95
+ | Popularity (pull count) | +2–5 pts |
96
+
97
+ ### 4 — Install
98
+
99
+ Runs `ollama pull <model>` with live streaming output. Only models from the Ollama library are offered for auto-install — HuggingFace-only GGUF models are shown in the list but flagged as manual-download. If Ollama isn't installed, platform-specific install instructions are provided.
100
+
101
+ ---
102
+
103
+ ## CLI Reference
104
+
105
+ ```
106
+ usage: ai-model-detector [options]
107
+
108
+ options:
109
+ --import FILE Import a macOS .spx system profile
110
+ --category CAT Filter: chat | code | vision | math | reasoning | embedding
111
+ --top N Number of recommendations to show (default: 5)
112
+ --json Output full results as JSON
113
+ --installed List already-installed Ollama models
114
+ --pull MODEL Pull a specific model (e.g. llama3.2:3b)
115
+ --no-hf Skip Hugging Face supplemental data
116
+ --verbose / -v Enable debug logging
117
+ --version Show version and exit
118
+ ```
119
+
120
+ ---
121
+
122
+ ## macOS `.spx` Import
123
+
124
+ Export your system profile from the macOS System Information app:
125
+
126
+ 1. Open **System Information** (`Cmd+Space` → "System Information")
127
+ 2. **File → Save…** → choose **System Information (.spx)**
128
+ 3. Run: `ai-model-detector --import ~/Desktop/MyMac.spx`
129
+
130
+ ---
131
+
132
+ ## Why Not Just Use GPU Data?
133
+
134
+ Tools that only look at GPU VRAM miss critical constraints:
135
+
136
+ - A model might fit in VRAM but not in RAM when layers spill to CPU
137
+ - CPU instruction sets (AVX2 vs AVX-512) drastically affect CPU-offload speed
138
+ - Free disk space at download time is often the real bottleneck
139
+ - Community bug reports reveal models that perform poorly on specific hardware regardless of specs
140
+
141
+ This tool checks all of these, not just VRAM.
142
+
143
+ ---
144
+
145
+ ## Project Structure
146
+
147
+ ```
148
+ src/ai_model_detector/
149
+ ├── scanner.py — deep hardware profiler (live + .spx import)
150
+ ├── registry.py — live model registry fetcher (Ollama + HuggingFace)
151
+ ├── scorer.py — hardware-aware scoring and ranking engine
152
+ ├── downloader.py — ollama pull with ANSI-stripped streaming output
153
+ ├── display.py — Rich terminal UI
154
+ └── cli.py — CLI entry point
155
+ ```
156
+
157
+ ---
158
+
159
+ ## Contributing
160
+
161
+ Issues, hardware reports, and PRs welcome at
162
+ [github.com/eliekh05/AI-Model-Detector-Auto-Downloader](https://github.com/eliekh05/AI-Model-Detector-Auto-Downloader)
163
+
164
+ ---
165
+
166
+ ## License
167
+
168
+ MIT — see [LICENSE](LICENSE)
@@ -0,0 +1,64 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "ai-model-detector"
7
+ version = "1.0.0"
8
+ description = "Deep hardware scanner that recommends and auto-downloads the best local AI model for your system"
9
+ readme = "README.md"
10
+ license = { file = "LICENSE" }
11
+ requires-python = ">=3.11"
12
+ keywords = ["ollama", "llm", "ai", "hardware", "model-selection", "local-ai"]
13
+ classifiers = [
14
+ "Development Status :: 4 - Beta",
15
+ "Environment :: Console",
16
+ "Intended Audience :: Developers",
17
+ "Intended Audience :: End Users/Desktop",
18
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
19
+ "Topic :: System :: Hardware",
20
+ "Programming Language :: Python :: 3",
21
+ "Programming Language :: Python :: 3.11",
22
+ "Programming Language :: Python :: 3.12",
23
+ "License :: OSI Approved :: MIT License",
24
+ "Operating System :: OS Independent",
25
+ ]
26
+ dependencies = [
27
+ "psutil>=5.9",
28
+ "requests>=2.31",
29
+ "rich>=13.7",
30
+ "pyyaml>=6.0",
31
+ ]
32
+
33
+ [project.optional-dependencies]
34
+ dev = [
35
+ "pytest>=8.0",
36
+ "ruff>=0.4",
37
+ ]
38
+
39
+ [project.urls]
40
+ Homepage = "https://github.com/eliekh05/AI-Model-Detector-Auto-Downloader"
41
+ Issues = "https://github.com/eliekh05/AI-Model-Detector-Auto-Downloader/issues"
42
+
43
+ [project.scripts]
44
+ ai-model-detector = "ai_model_detector.cli:run"
45
+
46
+ [tool.setuptools.packages.find]
47
+ where = ["src"]
48
+
49
+ [tool.setuptools.package-dir]
50
+ "" = "src"
51
+
52
+ [tool.ruff]
53
+ target-version = "py311"
54
+
55
+ [tool.ruff.lint]
56
+ # BLE001: broad exception in subprocess/OS helpers is intentional — we never
57
+ # want a hardware-probe or network call to crash the whole program.
58
+ # S110: try/except/pass is deliberate for best-effort system probing.
59
+ # PLW1510: check= omitted intentionally on subprocess.run when returncode is
60
+ # checked via other means or errors are caught explicitly.
61
+ ignore = ["BLE001", "S110", "PLW1510"]
62
+
63
+ [tool.pytest.ini_options]
64
+ testpaths = ["tests"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,7 @@
1
+ """
2
+ AI Model Detector & Auto Downloader
3
+ Deep system scanner that recommends and installs the best local AI model for your hardware.
4
+ """
5
+
6
+ __version__ = "1.0.0"
7
+ __author__ = "eliekh05"