gguf-radar 0.1.3__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.
- gguf_radar-0.1.3/LICENSE +21 -0
- gguf_radar-0.1.3/LICENSE-ASSETS +20 -0
- gguf_radar-0.1.3/PKG-INFO +150 -0
- gguf_radar-0.1.3/README.md +91 -0
- gguf_radar-0.1.3/pyproject.toml +62 -0
- gguf_radar-0.1.3/setup.cfg +4 -0
- gguf_radar-0.1.3/src/gguf_radar/__init__.py +24 -0
- gguf_radar-0.1.3/src/gguf_radar/__main__.py +6 -0
- gguf_radar-0.1.3/src/gguf_radar/cdr.py +333 -0
- gguf_radar-0.1.3/src/gguf_radar/cli.py +467 -0
- gguf_radar-0.1.3/src/gguf_radar/compare_template.py +571 -0
- gguf_radar-0.1.3/src/gguf_radar/hf_scanner.py +727 -0
- gguf_radar-0.1.3/src/gguf_radar/parser.py +1241 -0
- gguf_radar-0.1.3/src/gguf_radar/safe_text.py +26 -0
- gguf_radar-0.1.3/src/gguf_radar/template_ast.py +466 -0
- gguf_radar-0.1.3/src/gguf_radar.egg-info/PKG-INFO +150 -0
- gguf_radar-0.1.3/src/gguf_radar.egg-info/SOURCES.txt +26 -0
- gguf_radar-0.1.3/src/gguf_radar.egg-info/dependency_links.txt +1 -0
- gguf_radar-0.1.3/src/gguf_radar.egg-info/entry_points.txt +2 -0
- gguf_radar-0.1.3/src/gguf_radar.egg-info/requires.txt +6 -0
- gguf_radar-0.1.3/src/gguf_radar.egg-info/top_level.txt +1 -0
- gguf_radar-0.1.3/tests/test_clean_models_script.py +107 -0
- gguf_radar-0.1.3/tests/test_compare_template.py +321 -0
- gguf_radar-0.1.3/tests/test_compare_template_safety.py +259 -0
- gguf_radar-0.1.3/tests/test_compare_template_verdicts.py +85 -0
- gguf_radar-0.1.3/tests/test_gguf_radar.py +616 -0
- gguf_radar-0.1.3/tests/test_scan_selection_and_escaping.py +105 -0
- gguf_radar-0.1.3/tests/test_zero_scale_types.py +461 -0
gguf_radar-0.1.3/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 @Root0ne
|
|
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,20 @@
|
|
|
1
|
+
GGUF Radar logo, documentation and detection rules
|
|
2
|
+
Copyright (c) 2026 @Root0ne
|
|
3
|
+
|
|
4
|
+
The following files are licensed under the Creative Commons Attribution 4.0
|
|
5
|
+
International License, known as CC BY 4.0:
|
|
6
|
+
|
|
7
|
+
- assets/ the GGUF Radar logo and mark
|
|
8
|
+
- docs/ the user guide
|
|
9
|
+
- rules/ the YARA detection rules
|
|
10
|
+
- README.md the project overview
|
|
11
|
+
|
|
12
|
+
You may share and adapt them for any purpose, including commercial use, as
|
|
13
|
+
long as you give appropriate credit to @Root0ne, link to the license and say
|
|
14
|
+
whether you made changes.
|
|
15
|
+
|
|
16
|
+
License summary: https://creativecommons.org/licenses/by/4.0/
|
|
17
|
+
Full legal code: https://creativecommons.org/licenses/by/4.0/legalcode
|
|
18
|
+
|
|
19
|
+
The source code in this repository, which includes src/, tests/ and the build
|
|
20
|
+
files, is licensed under the MIT License. See LICENSE.
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: gguf-radar
|
|
3
|
+
Version: 0.1.3
|
|
4
|
+
Summary: Checks LLM model files for hidden malware and poisoned chat templates without running them, and builds clean copies of GGUF files.
|
|
5
|
+
Author: Root0ne
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2026 @Root0ne
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
28
|
+
Project-URL: Homepage, https://github.com/Root0ne/gguf-radar
|
|
29
|
+
Project-URL: Repository, https://github.com/Root0ne/gguf-radar
|
|
30
|
+
Project-URL: Issues, https://github.com/Root0ne/gguf-radar/issues
|
|
31
|
+
Project-URL: Changelog, https://github.com/Root0ne/gguf-radar/blob/main/CHANGELOG.md
|
|
32
|
+
Project-URL: Research, https://malspark.com/blog/malicious-gguf-models-hugging-face/
|
|
33
|
+
Keywords: gguf,safetensors,chat-template,llm-security,supply-chain,malware-analysis,cdr,huggingface,yara
|
|
34
|
+
Classifier: Development Status :: 4 - Beta
|
|
35
|
+
Classifier: Intended Audience :: Information Technology
|
|
36
|
+
Classifier: Intended Audience :: Developers
|
|
37
|
+
Classifier: Intended Audience :: Science/Research
|
|
38
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
39
|
+
Classifier: Environment :: Console
|
|
40
|
+
Classifier: Operating System :: OS Independent
|
|
41
|
+
Classifier: Programming Language :: Python :: 3
|
|
42
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
43
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
44
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
45
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
46
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
47
|
+
Classifier: Topic :: Security
|
|
48
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
49
|
+
Requires-Python: >=3.10
|
|
50
|
+
Description-Content-Type: text/markdown
|
|
51
|
+
License-File: LICENSE
|
|
52
|
+
License-File: LICENSE-ASSETS
|
|
53
|
+
Requires-Dist: numpy>=1.24
|
|
54
|
+
Requires-Dist: jinja2>=3.1
|
|
55
|
+
Provides-Extra: dev
|
|
56
|
+
Requires-Dist: pytest>=7.4; extra == "dev"
|
|
57
|
+
Requires-Dist: ruff>=0.6; extra == "dev"
|
|
58
|
+
Dynamic: license-file
|
|
59
|
+
|
|
60
|
+
<p align="center">
|
|
61
|
+
<picture>
|
|
62
|
+
<source media="(prefers-color-scheme: dark)" srcset="assets/gguf-radar-logo-white.svg">
|
|
63
|
+
<img alt="GGUF Radar" src="assets/gguf-radar-logo-black.svg" width="282">
|
|
64
|
+
</picture>
|
|
65
|
+
</p>
|
|
66
|
+
|
|
67
|
+
<p align="center">
|
|
68
|
+
<a href="https://github.com/Root0ne/gguf-radar/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/Root0ne/gguf-radar/actions/workflows/ci.yml/badge.svg"></a>
|
|
69
|
+
<a href="https://github.com/Root0ne/gguf-radar/releases"><img alt="Release" src="https://img.shields.io/github/v/release/Root0ne/gguf-radar"></a>
|
|
70
|
+
<img alt="Python 3.10+" src="https://img.shields.io/badge/python-3.10%2B-blue">
|
|
71
|
+
<a href="LICENSE"><img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-green"></a>
|
|
72
|
+
</p>
|
|
73
|
+
|
|
74
|
+
# GGUF Radar
|
|
75
|
+
|
|
76
|
+
GGUF Radar checks LLM model files for hidden malware and poisoned chat templates. It never runs the model or its template. If it finds something in a GGUF file, it can also build a clean copy of that file with the same model weights.
|
|
77
|
+
|
|
78
|
+
It works on GGUF files on your disk and on models hosted on Hugging Face. For Hugging Face models it downloads only the small parts it needs, so a scan takes seconds even for very large models. It also checks the chat templates of Safetensors and PyTorch models.
|
|
79
|
+
|
|
80
|
+
## Why this matters
|
|
81
|
+
|
|
82
|
+
A GGUF file holds the model weights and a chat template, which is a small program that formats every conversation before the model reads it. Attackers have used both. They hide programs after the end of the weights, where model loaders never look, and they change the chat template so that the model tells the user to run a command or tells a coding agent to download a script. These attacks are described in [this research post](https://malspark.com/blog/malicious-gguf-models-hugging-face/).
|
|
83
|
+
|
|
84
|
+
## Install
|
|
85
|
+
|
|
86
|
+
GGUF Radar needs Python 3.10 or newer.
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
pip install git+https://github.com/Root0ne/gguf-radar
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Quick start
|
|
93
|
+
|
|
94
|
+
Check a file on your disk:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
gguf-radar scan ./model.gguf
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Check a model on Hugging Face:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
gguf-radar scan Qwen/Qwen2.5-0.5B-Instruct-GGUF
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Build a clean copy of a file:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
gguf-radar sanitize suspicious.gguf -o clean.gguf
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Compare the chat template of a GGUF file with the template of the original model:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
gguf-radar compare-template ./model.gguf --base Qwen/Qwen2.5-0.5B-Instruct
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## Results
|
|
119
|
+
|
|
120
|
+
Every scan ends with one of four verdicts.
|
|
121
|
+
|
|
122
|
+
| Verdict | What it means |
|
|
123
|
+
| --- | --- |
|
|
124
|
+
| `CLEAN` | Nothing suspicious was found. |
|
|
125
|
+
| `SUSPICIOUS` | Something unusual was found. A person should look at it. |
|
|
126
|
+
| `MALICIOUS` | The file shows a pattern used in real attacks. Do not use it. |
|
|
127
|
+
| `ERROR` | The file or the repository could not be read. |
|
|
128
|
+
|
|
129
|
+
The command exits with code `0` for `CLEAN`, `2` for `SUSPICIOUS` or `MALICIOUS`, and `1` for `ERROR`, so it can stop a CI pipeline.
|
|
130
|
+
|
|
131
|
+
## Documentation
|
|
132
|
+
|
|
133
|
+
- [Getting started](docs/getting-started.md)
|
|
134
|
+
- [Scanning files and Hugging Face models](docs/scanning.md)
|
|
135
|
+
- [Building a clean copy](docs/sanitizing.md)
|
|
136
|
+
- [Comparing a chat template with the original model](docs/comparing-templates.md)
|
|
137
|
+
- [Understanding the results](docs/results.md)
|
|
138
|
+
- [How the checks work](docs/how-it-works.md)
|
|
139
|
+
- [Using GGUF Radar in CI and in Python](docs/ci-and-python.md)
|
|
140
|
+
- [Limitations](docs/limitations.md)
|
|
141
|
+
|
|
142
|
+
The YARA rules for the attacks in the research post are in [`rules/`](rules/gguf_supply_chain_threats.yar).
|
|
143
|
+
|
|
144
|
+
## Contributing and security
|
|
145
|
+
|
|
146
|
+
Bug reports, missed detections and false alarms are welcome as [issues](https://github.com/Root0ne/gguf-radar/issues/new/choose). Please read [`CONTRIBUTING.md`](CONTRIBUTING.md) before you open a pull request. If you find a security problem in GGUF Radar itself, please report it privately as described in [`SECURITY.md`](SECURITY.md).
|
|
147
|
+
|
|
148
|
+
## License
|
|
149
|
+
|
|
150
|
+
The code is released under the [MIT License](LICENSE). The logo, the documentation and the YARA rules are released under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), as described in [`LICENSE-ASSETS`](LICENSE-ASSETS). Both licenses only ask that you keep the credit to @Root0ne.
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<picture>
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="assets/gguf-radar-logo-white.svg">
|
|
4
|
+
<img alt="GGUF Radar" src="assets/gguf-radar-logo-black.svg" width="282">
|
|
5
|
+
</picture>
|
|
6
|
+
</p>
|
|
7
|
+
|
|
8
|
+
<p align="center">
|
|
9
|
+
<a href="https://github.com/Root0ne/gguf-radar/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/Root0ne/gguf-radar/actions/workflows/ci.yml/badge.svg"></a>
|
|
10
|
+
<a href="https://github.com/Root0ne/gguf-radar/releases"><img alt="Release" src="https://img.shields.io/github/v/release/Root0ne/gguf-radar"></a>
|
|
11
|
+
<img alt="Python 3.10+" src="https://img.shields.io/badge/python-3.10%2B-blue">
|
|
12
|
+
<a href="LICENSE"><img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-green"></a>
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
# GGUF Radar
|
|
16
|
+
|
|
17
|
+
GGUF Radar checks LLM model files for hidden malware and poisoned chat templates. It never runs the model or its template. If it finds something in a GGUF file, it can also build a clean copy of that file with the same model weights.
|
|
18
|
+
|
|
19
|
+
It works on GGUF files on your disk and on models hosted on Hugging Face. For Hugging Face models it downloads only the small parts it needs, so a scan takes seconds even for very large models. It also checks the chat templates of Safetensors and PyTorch models.
|
|
20
|
+
|
|
21
|
+
## Why this matters
|
|
22
|
+
|
|
23
|
+
A GGUF file holds the model weights and a chat template, which is a small program that formats every conversation before the model reads it. Attackers have used both. They hide programs after the end of the weights, where model loaders never look, and they change the chat template so that the model tells the user to run a command or tells a coding agent to download a script. These attacks are described in [this research post](https://malspark.com/blog/malicious-gguf-models-hugging-face/).
|
|
24
|
+
|
|
25
|
+
## Install
|
|
26
|
+
|
|
27
|
+
GGUF Radar needs Python 3.10 or newer.
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pip install git+https://github.com/Root0ne/gguf-radar
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Quick start
|
|
34
|
+
|
|
35
|
+
Check a file on your disk:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
gguf-radar scan ./model.gguf
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Check a model on Hugging Face:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
gguf-radar scan Qwen/Qwen2.5-0.5B-Instruct-GGUF
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Build a clean copy of a file:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
gguf-radar sanitize suspicious.gguf -o clean.gguf
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Compare the chat template of a GGUF file with the template of the original model:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
gguf-radar compare-template ./model.gguf --base Qwen/Qwen2.5-0.5B-Instruct
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Results
|
|
60
|
+
|
|
61
|
+
Every scan ends with one of four verdicts.
|
|
62
|
+
|
|
63
|
+
| Verdict | What it means |
|
|
64
|
+
| --- | --- |
|
|
65
|
+
| `CLEAN` | Nothing suspicious was found. |
|
|
66
|
+
| `SUSPICIOUS` | Something unusual was found. A person should look at it. |
|
|
67
|
+
| `MALICIOUS` | The file shows a pattern used in real attacks. Do not use it. |
|
|
68
|
+
| `ERROR` | The file or the repository could not be read. |
|
|
69
|
+
|
|
70
|
+
The command exits with code `0` for `CLEAN`, `2` for `SUSPICIOUS` or `MALICIOUS`, and `1` for `ERROR`, so it can stop a CI pipeline.
|
|
71
|
+
|
|
72
|
+
## Documentation
|
|
73
|
+
|
|
74
|
+
- [Getting started](docs/getting-started.md)
|
|
75
|
+
- [Scanning files and Hugging Face models](docs/scanning.md)
|
|
76
|
+
- [Building a clean copy](docs/sanitizing.md)
|
|
77
|
+
- [Comparing a chat template with the original model](docs/comparing-templates.md)
|
|
78
|
+
- [Understanding the results](docs/results.md)
|
|
79
|
+
- [How the checks work](docs/how-it-works.md)
|
|
80
|
+
- [Using GGUF Radar in CI and in Python](docs/ci-and-python.md)
|
|
81
|
+
- [Limitations](docs/limitations.md)
|
|
82
|
+
|
|
83
|
+
The YARA rules for the attacks in the research post are in [`rules/`](rules/gguf_supply_chain_threats.yar).
|
|
84
|
+
|
|
85
|
+
## Contributing and security
|
|
86
|
+
|
|
87
|
+
Bug reports, missed detections and false alarms are welcome as [issues](https://github.com/Root0ne/gguf-radar/issues/new/choose). Please read [`CONTRIBUTING.md`](CONTRIBUTING.md) before you open a pull request. If you find a security problem in GGUF Radar itself, please report it privately as described in [`SECURITY.md`](SECURITY.md).
|
|
88
|
+
|
|
89
|
+
## License
|
|
90
|
+
|
|
91
|
+
The code is released under the [MIT License](LICENSE). The logo, the documentation and the YARA rules are released under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), as described in [`LICENSE-ASSETS`](LICENSE-ASSETS). Both licenses only ask that you keep the credit to @Root0ne.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "gguf-radar"
|
|
7
|
+
version = "0.1.3"
|
|
8
|
+
description = "Checks LLM model files for hidden malware and poisoned chat templates without running them, and builds clean copies of GGUF files."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = { file = "LICENSE" }
|
|
11
|
+
authors = [{ name = "Root0ne" }]
|
|
12
|
+
requires-python = ">=3.10"
|
|
13
|
+
keywords = ["gguf", "safetensors", "chat-template", "llm-security", "supply-chain", "malware-analysis", "cdr", "huggingface", "yara"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 4 - Beta",
|
|
16
|
+
"Intended Audience :: Information Technology",
|
|
17
|
+
"Intended Audience :: Developers",
|
|
18
|
+
"Intended Audience :: Science/Research",
|
|
19
|
+
"License :: OSI Approved :: MIT License",
|
|
20
|
+
"Environment :: Console",
|
|
21
|
+
"Operating System :: OS Independent",
|
|
22
|
+
"Programming Language :: Python :: 3",
|
|
23
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
24
|
+
"Programming Language :: Python :: 3.10",
|
|
25
|
+
"Programming Language :: Python :: 3.11",
|
|
26
|
+
"Programming Language :: Python :: 3.12",
|
|
27
|
+
"Programming Language :: Python :: 3.13",
|
|
28
|
+
"Topic :: Security",
|
|
29
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
30
|
+
]
|
|
31
|
+
dependencies = [
|
|
32
|
+
"numpy>=1.24",
|
|
33
|
+
"jinja2>=3.1",
|
|
34
|
+
]
|
|
35
|
+
|
|
36
|
+
[project.optional-dependencies]
|
|
37
|
+
dev = ["pytest>=7.4", "ruff>=0.6"]
|
|
38
|
+
|
|
39
|
+
[project.scripts]
|
|
40
|
+
gguf-radar = "gguf_radar.cli:main"
|
|
41
|
+
|
|
42
|
+
[project.urls]
|
|
43
|
+
Homepage = "https://github.com/Root0ne/gguf-radar"
|
|
44
|
+
Repository = "https://github.com/Root0ne/gguf-radar"
|
|
45
|
+
Issues = "https://github.com/Root0ne/gguf-radar/issues"
|
|
46
|
+
Changelog = "https://github.com/Root0ne/gguf-radar/blob/main/CHANGELOG.md"
|
|
47
|
+
Research = "https://malspark.com/blog/malicious-gguf-models-hugging-face/"
|
|
48
|
+
|
|
49
|
+
[tool.setuptools.packages.find]
|
|
50
|
+
where = ["src"]
|
|
51
|
+
|
|
52
|
+
[tool.ruff]
|
|
53
|
+
line-length = 130
|
|
54
|
+
target-version = "py310"
|
|
55
|
+
src = ["src", "tests"]
|
|
56
|
+
|
|
57
|
+
[tool.ruff.lint]
|
|
58
|
+
select = ["E", "F", "W", "I", "B", "UP"]
|
|
59
|
+
|
|
60
|
+
[tool.pytest.ini_options]
|
|
61
|
+
testpaths = ["tests"]
|
|
62
|
+
pythonpath = ["src"]
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"""GGUF Radar checks LLM model files for hidden malware and poisoned chat templates without running them."""
|
|
2
|
+
|
|
3
|
+
from .cdr import CDRSanitizationResult, sanitize_gguf_file
|
|
4
|
+
from .hf_scanner import RemoteTargetResult, parse_hf_target, scan_hf_target, scan_targets
|
|
5
|
+
from .parser import GGUFForensicReport, parse_gguf_file, parse_gguf_partial_bytes
|
|
6
|
+
from .template_ast import TemplateFinding, TemplateForensicReport, analyze_chat_template
|
|
7
|
+
|
|
8
|
+
__version__ = "0.1.3"
|
|
9
|
+
|
|
10
|
+
__all__ = [
|
|
11
|
+
"__version__",
|
|
12
|
+
"CDRSanitizationResult",
|
|
13
|
+
"GGUFForensicReport",
|
|
14
|
+
"RemoteTargetResult",
|
|
15
|
+
"TemplateFinding",
|
|
16
|
+
"TemplateForensicReport",
|
|
17
|
+
"analyze_chat_template",
|
|
18
|
+
"parse_gguf_file",
|
|
19
|
+
"parse_gguf_partial_bytes",
|
|
20
|
+
"parse_hf_target",
|
|
21
|
+
"sanitize_gguf_file",
|
|
22
|
+
"scan_hf_target",
|
|
23
|
+
"scan_targets",
|
|
24
|
+
]
|