seedpack 0.1.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.
- seedpack-0.1.0/LICENSE +202 -0
- seedpack-0.1.0/NOTICE +6 -0
- seedpack-0.1.0/PKG-INFO +111 -0
- seedpack-0.1.0/README.md +100 -0
- seedpack-0.1.0/README_PYPI.md +70 -0
- seedpack-0.1.0/pyproject.toml +60 -0
- seedpack-0.1.0/seedpack/__init__.py +6 -0
- seedpack-0.1.0/seedpack/__main__.py +3 -0
- seedpack-0.1.0/seedpack/bf16codec.py +103 -0
- seedpack-0.1.0/seedpack/bf16v2.py +421 -0
- seedpack-0.1.0/seedpack/bundle.py +36 -0
- seedpack-0.1.0/seedpack/cli.py +413 -0
- seedpack-0.1.0/seedpack/codecs_gguf.py +344 -0
- seedpack-0.1.0/seedpack/container.py +106 -0
- seedpack-0.1.0/seedpack/ggml/LICENSE +21 -0
- seedpack-0.1.0/seedpack/ggml/build.sh +14 -0
- seedpack-0.1.0/seedpack/ggml/export.c +10 -0
- seedpack-0.1.0/seedpack/ggml/ggml-alloc.h +87 -0
- seedpack-0.1.0/seedpack/ggml/ggml-backend.h +463 -0
- seedpack-0.1.0/seedpack/ggml/ggml-common.h +1911 -0
- seedpack-0.1.0/seedpack/ggml/ggml-cpu/ggml-cpu-impl.h +540 -0
- seedpack-0.1.0/seedpack/ggml/ggml-cpu.h +152 -0
- seedpack-0.1.0/seedpack/ggml/ggml-impl.h +795 -0
- seedpack-0.1.0/seedpack/ggml/ggml-quants.c +5639 -0
- seedpack-0.1.0/seedpack/ggml/ggml-quants.h +115 -0
- seedpack-0.1.0/seedpack/ggml/ggml.h +3049 -0
- seedpack-0.1.0/seedpack/ggml/gguf.h +211 -0
- seedpack-0.1.0/seedpack/ggml/iqtables.npz +0 -0
- seedpack-0.1.0/seedpack/ggml/stubs.c +29 -0
- seedpack-0.1.0/seedpack/ggml/variants/ggml-quants.pre-f95b0d9539.c +5667 -0
- seedpack-0.1.0/seedpack/gguf_reader.py +121 -0
- seedpack-0.1.0/seedpack/gpu2.py +874 -0
- seedpack-0.1.0/seedpack/gpu3.py +639 -0
- seedpack-0.1.0/seedpack/gpu_bf16.py +530 -0
- seedpack-0.1.0/seedpack/gpu_codec.py +353 -0
- seedpack-0.1.0/seedpack/gpuquant.py +416 -0
- seedpack-0.1.0/seedpack/ptxfix.py +78 -0
- seedpack-0.1.0/seedpack/qr.py +735 -0
- seedpack-0.1.0/seedpack/rans.py +164 -0
- seedpack-0.1.0/seedpack/refcodec.py +314 -0
- seedpack-0.1.0/seedpack/repo.py +597 -0
- seedpack-0.1.0/seedpack/repo2.py +160 -0
- seedpack-0.1.0/seedpack/repo3.py +931 -0
- seedpack-0.1.0/seedpack/requant.py +117 -0
- seedpack-0.1.0/seedpack/seed.py +160 -0
- seedpack-0.1.0/seedpack.egg-info/PKG-INFO +111 -0
- seedpack-0.1.0/seedpack.egg-info/SOURCES.txt +51 -0
- seedpack-0.1.0/seedpack.egg-info/dependency_links.txt +1 -0
- seedpack-0.1.0/seedpack.egg-info/entry_points.txt +2 -0
- seedpack-0.1.0/seedpack.egg-info/requires.txt +9 -0
- seedpack-0.1.0/seedpack.egg-info/top_level.txt +1 -0
- seedpack-0.1.0/setup.cfg +4 -0
seedpack-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
seedpack-0.1.0/NOTICE
ADDED
seedpack-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: seedpack
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Lossless GPU archiver for GGUF model repositories: the BF16 model and all its quants in one archive about the size of a single compressed BF16 file
|
|
5
|
+
Author: NeuroSquad
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/glmn-ai/seedpack
|
|
8
|
+
Project-URL: Source, https://github.com/glmn-ai/seedpack
|
|
9
|
+
Project-URL: Issues, https://github.com/glmn-ai/seedpack/issues
|
|
10
|
+
Project-URL: Example archive, https://huggingface.co/neurosquad/Qwen3-0.6B-SEEDPACK
|
|
11
|
+
Keywords: gguf,llama.cpp,lossless,compression,archiver,quantization,cuda,llm,huggingface
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Environment :: GPU :: NVIDIA CUDA :: 13
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: Intended Audience :: Science/Research
|
|
17
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
18
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
24
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
25
|
+
Classifier: Topic :: System :: Archiving :: Compression
|
|
26
|
+
Requires-Python: >=3.11
|
|
27
|
+
Description-Content-Type: text/markdown
|
|
28
|
+
License-File: LICENSE
|
|
29
|
+
License-File: NOTICE
|
|
30
|
+
License-File: seedpack/ggml/LICENSE
|
|
31
|
+
Requires-Dist: numpy>=2.0
|
|
32
|
+
Requires-Dist: numba>=0.60
|
|
33
|
+
Requires-Dist: zstandard>=0.23
|
|
34
|
+
Requires-Dist: blake3>=1.0
|
|
35
|
+
Requires-Dist: cupy-cuda13x>=14.0
|
|
36
|
+
Requires-Dist: nvidia-cuda-nvrtc>=13.0
|
|
37
|
+
Requires-Dist: nvidia-cuda-runtime>=13.0
|
|
38
|
+
Requires-Dist: nvidia-nvjitlink>=13.0
|
|
39
|
+
Requires-Dist: huggingface_hub>=0.30
|
|
40
|
+
Dynamic: license-file
|
|
41
|
+
|
|
42
|
+
<p align="center">
|
|
43
|
+
<img src="https://raw.githubusercontent.com/glmn-ai/seedpack/main/assets/banner.png" alt="SeedPack" width="860">
|
|
44
|
+
</p>
|
|
45
|
+
|
|
46
|
+
# SeedPack
|
|
47
|
+
|
|
48
|
+
**Lossless GPU archiver for GGUF model repositories.** A whole repository, the BF16 model and all its quants from IQ1 to Q8, packs into one archive about the size of a single compressed BF16 file. Every file comes back byte for byte.
|
|
49
|
+
|
|
50
|
+
| unsloth/Qwen3-0.6B-GGUF, BF16 + 25 quants (10.95 GB) | Archive | Ratio |
|
|
51
|
+
|---|---:|---:|
|
|
52
|
+
| **SeedPack** | **782 MB** | **7.14%** |
|
|
53
|
+
| lmz 1.3.0 | 4.54 GB | 41.47% |
|
|
54
|
+
| zstd 1.5.7 -19 --long=30 | 6.57 GB | 59.99% |
|
|
55
|
+
| 7-Zip 23.01 -mx9 | 10.21 GB | 93.26% |
|
|
56
|
+
| ZipNN 0.5.4 | 10.33 GB | 94.34% |
|
|
57
|
+
|
|
58
|
+
The archive is smaller than the repository's largest single quant (UD-Q8_K_XL, 844 MB). The full benchmark against 10 other compressors, with speeds and single files, is on the [example archive's page](https://huggingface.co/neurosquad/Qwen3-0.6B-SEEDPACK).
|
|
59
|
+
|
|
60
|
+
## Install
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
pip install seedpack
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Requirements:
|
|
67
|
+
- An NVIDIA GPU, Turing (RTX 20xx) or newer, with a CUDA 13 driver (R580 or newer).
|
|
68
|
+
- Python 3.11+.
|
|
69
|
+
- Windows 10/11 or Linux. Tested on an RTX 5070 under Windows 10 (Python 3.11) and Ubuntu on WSL2 (Python 3.14).
|
|
70
|
+
- No CUDA Toolkit is needed: NVRTC, nvJitLink and the CUDA headers come from pip.
|
|
71
|
+
|
|
72
|
+
Archives are portable between operating systems: an archive packed on Windows unpacks bit-exactly on Linux, and the other way round. The first run compiles the GPU quantizers for your card (about 15 s) and caches them in `%LOCALAPPDATA%\seedpack\cache` or `~/.cache/seedpack`; set `SEEDPACK_CACHE` to move the cache.
|
|
73
|
+
|
|
74
|
+
## Use
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
# straight from the Hugging Face Hub: download once, extract what you need
|
|
78
|
+
seedpack list hf://neurosquad/Qwen3-0.6B-SEEDPACK
|
|
79
|
+
seedpack x hf://neurosquad/Qwen3-0.6B-SEEDPACK Qwen3-0.6B-Q4_K_M.gguf -o models
|
|
80
|
+
seedpack x hf://neurosquad/Qwen3-0.6B-SEEDPACK "*Q4_K*" "*Q8_0*" -o models
|
|
81
|
+
seedpack x hf://neurosquad/Qwen3-0.6B-SEEDPACK -o models # everything
|
|
82
|
+
|
|
83
|
+
# local archives
|
|
84
|
+
seedpack pack models/Qwen3-0.6B-GGUF -o qwen3.varc # files and/or folders
|
|
85
|
+
seedpack x qwen3.varc Qwen3-0.6B-Q4_K_M.gguf -o out
|
|
86
|
+
seedpack test qwen3.varc # decode and verify, write nothing
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Notes on the commands:
|
|
90
|
+
- `hf://OWNER/REPO[/FILE.varc][@REVISION]` and `https://huggingface.co/...` links work wherever an archive is expected.
|
|
91
|
+
- `list` reads only the archive's index over the network; `x` and `test` download the archive once into the Hugging Face cache.
|
|
92
|
+
- Extracted files are checked against BLAKE3 hashes. Every chunk of the archive carries a CRC32.
|
|
93
|
+
|
|
94
|
+
## How it works
|
|
95
|
+
|
|
96
|
+
A GGUF repository ships the same weights 20–30 times: the BF16 model plus each quantization of it. To a general-purpose compressor that looks like gigabytes of almost incompressible bytes. SeedPack uses the fact that every quant is a deterministic function of the same weights:
|
|
97
|
+
|
|
98
|
+
- **The seed is stored once.** The most precise model (the BF16 file, or the senior quant when there is none) is coded with an entropy coder built for its weights.
|
|
99
|
+
- **Quants are re-derived, not stored.** Each quant is computed again on the GPU by a bit-exact CUDA port of llama.cpp's quantizers (`ggml-quants.c`, compiled without FMA contraction), with the repository's importance matrix.
|
|
100
|
+
- **Only the residual is kept.** Where a re-derived quant differs from the published file, the residual is coded with the quantizer's own probabilities: scales first, then each code relative to its rounding boundary. For Qwen3-0.6B, all 25 quants together cost about 1 MB on top of the seed.
|
|
101
|
+
- **Duplicates are stored once.** Identical tensors in different files are kept once. Files that are not GGUF are compressed with LZMA or zstd.
|
|
102
|
+
|
|
103
|
+
## Links
|
|
104
|
+
|
|
105
|
+
- Source and research notes: <https://github.com/glmn-ai/seedpack>
|
|
106
|
+
- Example archive: <https://huggingface.co/neurosquad/Qwen3-0.6B-SEEDPACK>
|
|
107
|
+
- A [NeuroSquad](https://huggingface.co/neurosquad) project.
|
|
108
|
+
|
|
109
|
+
## License
|
|
110
|
+
|
|
111
|
+
Apache-2.0. The bundled llama.cpp / ggml quantization sources (`seedpack/ggml/`) are MIT-licensed; see `NOTICE`.
|
seedpack-0.1.0/README.md
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
<p align="center"><img src="assets/banner.png" alt="SeedPack" width="860"></p>
|
|
2
|
+
|
|
3
|
+
# SeedPack
|
|
4
|
+
|
|
5
|
+
Архиватор без потерь для репозиториев GGUF-моделей, проект [NeuroSquad](https://huggingface.co/neurosquad). Весь репозиторий — BF16-модель и все её кванты от IQ1 до Q8 — сжимается в один архив размером примерно с один сжатый BF16-файл. Каждый файл восстанавливается **побайтово**.
|
|
6
|
+
|
|
7
|
+
Идея: кванты не хранятся, а «вырастают» из BF16, как из семени. Квантизаторы llama.cpp детерминированы, поэтому архив повторяет квантизацию на GPU из BF16 с imatrix репозитория и бит-в-бит совпадающей копией кода `ggml-quants.c`. Хранится только разница с результатом, закодированная вероятностями самого квантизатора.
|
|
8
|
+
|
|
9
|
+
Готовый архив на Hugging Face: [neurosquad/Qwen3-0.6B-SEEDPACK](https://huggingface.co/neurosquad/Qwen3-0.6B-SEEDPACK) — весь unsloth/Qwen3-0.6B-GGUF (BF16 и 25 квантов, 10.95 ГБ) в одном файле, с бенчмарком против 11 архиваторов.
|
|
10
|
+
|
|
11
|
+
## Результаты
|
|
12
|
+
|
|
13
|
+
| Что сжимается | Исходно | Архив | % | lmz 1.3.0 |
|
|
14
|
+
|---|---|---|---|---|
|
|
15
|
+
| unsloth/Qwen3-0.6B-GGUF целиком (BF16 + 25 квантов) | 10.95 ГБ | 781.7 МБ | 7.14% | 41.5% |
|
|
16
|
+
| unsloth/Qwen3.5-0.8B-GGUF целиком | 14.08 ГБ | 1.12 ГБ | 7.96% | 41.2% |
|
|
17
|
+
| unsloth/Qwen3.5-2B-GGUF целиком | 34.57 ГБ | 2.91 ГБ | 8.41% | 43.7% |
|
|
18
|
+
| только кванты Qwen3.5-2B (21 файл) + imatrix | 28.13 ГБ | 2.55 ГБ | 9.06% | 40.2% |
|
|
19
|
+
| только кванты Qwen3.5-2B без imatrix | 28.13 ГБ | 3.02 ГБ | 10.74% | 40.2% |
|
|
20
|
+
| один Q8_0 (Qwen3-0.6B) | 639 МБ | 576 МБ | 90.1% | 93.0% |
|
|
21
|
+
| один Q4_K_M (Qwen3-0.6B) | 397 МБ | 372 МБ | 93.8% | 95.0% |
|
|
22
|
+
| один BF16 (Qwen3.5-2B) | 3.78 ГБ | 2.46 ГБ | 65.2% | 65.9% |
|
|
23
|
+
|
|
24
|
+
Скорость, время и все наборы — в `bench_competitors/VS_LMZ.md`; план развития — в `ROADMAP.md`.
|
|
25
|
+
Распаковка проверяет контрольные суммы. Измерено на RTX 5070, Core i7-8700K (6 ядер, 12 потоков) и NVMe-диске.
|
|
26
|
+
|
|
27
|
+
## Установка
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
pip install seedpack
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Нужны видеокарта NVIDIA (Turing и новее) с драйвером CUDA 13 (R580+) и Python 3.11+; CUDA Toolkit не нужен (NVRTC, nvJitLink и заголовки ставятся из pip). Проверено на RTX 5070: Windows 10 (Python 3.11) и Ubuntu в WSL2 (Python 3.14). Архивы переносимы между ОС: собранный на Windows распаковывается на Linux бит-в-бит и наоборот. При первом запуске квантизаторы компилируются под вашу видеокарту (около 15 с) и кэшируются в `%LOCALAPPDATA%\seedpack\cache` (или `~/.cache/seedpack`, или `SEEDPACK_CACHE`).
|
|
34
|
+
|
|
35
|
+
## Использование
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
seedpack pack ВХОДЫ... -o архив.varc # файлы и/или папки
|
|
39
|
+
seedpack unpack АРХИВ [ИМЕНА|МАСКИ] -o DIR # всё или выбранные файлы (alias: x)
|
|
40
|
+
seedpack list АРХИВ
|
|
41
|
+
seedpack test АРХИВ [ИМЕНА|МАСКИ] # распаковка в памяти + проверка
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
АРХИВ — файл `.varc` или архив на Hugging Face: `hf://OWNER/REPO[/FILE.varc][@REVISION]` либо ссылка `https://huggingface.co/...`. `list` читает по сети только индекс, `unpack` и `test` один раз скачивают архив в кэш Hugging Face.
|
|
45
|
+
|
|
46
|
+
Примеры:
|
|
47
|
+
```
|
|
48
|
+
seedpack x hf://neurosquad/Qwen3-0.6B-SEEDPACK Qwen3-0.6B-Q4_K_M.gguf -o models
|
|
49
|
+
seedpack pack models/Qwen3-0.6B-GGUF -o qwen3.varc
|
|
50
|
+
seedpack x qwen3.varc "*IQ1*" README.md -o out
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Роли файлов определяются автоматически:
|
|
54
|
+
- GGUF, где больше половины весов в BF16, — это база (модель, mmproj);
|
|
55
|
+
- остальные GGUF выводятся из баз; кванты без BF16-модели — из старшего кванта (семени, `seedpack/seed.py`);
|
|
56
|
+
- одинаковые тензоры разных файлов хранятся один раз;
|
|
57
|
+
- прочие файлы сжимаются LZMA или zstd.
|
|
58
|
+
|
|
59
|
+
Каждый файл проверяется по BLAKE3 (если пакета нет — по SHA-256), каждая часть архива — по CRC32.
|
|
60
|
+
|
|
61
|
+
## Разработка
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
git clone https://github.com/glmn-ai/seedpack && cd seedpack
|
|
65
|
+
python -m venv .venv
|
|
66
|
+
.venv\Scripts\pip install -r requirements.txt -e .
|
|
67
|
+
sh seedpack/ggml/build.sh # CPU-библиотека квантизаторов (MinGW gcc): нужна только исследовательским скриптам
|
|
68
|
+
python varc.py --help # то же, что seedpack
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Таблицы IQ-сеток (`seedpack/ggml/iqtables.npz`) построены CPU-библиотекой и лежат в пакете; без файла они строятся заново (около 25 с, нужна `ggmlq.dll`).
|
|
72
|
+
|
|
73
|
+
Публикация: `python -m build` → `twine upload dist/*`.
|
|
74
|
+
|
|
75
|
+
## Устройство
|
|
76
|
+
|
|
77
|
+
- `seedpack/cli.py` — CLI (`seedpack`, из исходников — `python varc.py`); `seedpack/container.py` — формат `.varc` (части + индекс в конце, произвольный доступ).
|
|
78
|
+
- `seedpack/repo3.py` — ядро: M28/M29 (базы, предсказание квантов, остатки, конвейер).
|
|
79
|
+
- `seedpack/gpuquant.py` — генерация CUDA-кода из `ggml-quants.c`, бит-в-бит с CPU; варианты квантизаторов старых версий llama.cpp.
|
|
80
|
+
- `seedpack/ptxfix.py` — обход ошибки ptxas при делении на константу.
|
|
81
|
+
- `seedpack/bf16v2.py` — кодек BF16 (R2); `seedpack/gpu_bf16.py` — M24.
|
|
82
|
+
- `seedpack/gpu3.py` (на основе `seedpack/gpu2.py`) — M21/M22: кодек Q8_0 без базы (rANS с контекстами, предсказание строк по похожим строкам).
|
|
83
|
+
- `seedpack/seed.py` — семя: старший квант набора без BF16 и его кодек.
|
|
84
|
+
- `seedpack/qr.py` — QR: GPU-кодирование остатка вероятностями квантизатора (масштабы, затем коды), и тот же кодер без семени для одиночных файлов.
|
|
85
|
+
- `seedpack/requant.py` — CPU-квантизаторы через `ggmlq.dll`, загрузка imatrix (legacy `.dat` и GGUF).
|
|
86
|
+
- `bench*.py`, `results*.json` — замеры всех методов M1–M29; `research/` — исследования кодеков.
|
|
87
|
+
- `bench_competitors/` — сравнение с другими архиваторами: `run_bench.py`, `quant_sets.py`, `vs_lmz.py`; `hf_bench.py` и `hf_card.py` — бенчмарк и карточка релиза Qwen3-0.6B на Hugging Face.
|
|
88
|
+
- `assets/` — логотип (`logo.svg`) и баннер (`banner.png`, исходник `banner.html`).
|
|
89
|
+
- `seedpack/ggml/` — исходники квантизации llama.cpp (MIT, см. `seedpack/ggml/LICENSE`).
|
|
90
|
+
|
|
91
|
+
## Ограничения
|
|
92
|
+
|
|
93
|
+
- Нужна видеокарта NVIDIA.
|
|
94
|
+
- Кванты без BF16-модели: семенем становится старший квант (больше всего бит на вес: UD-Q8_K_XL, Q8_0, … Q4); его тензоры деквантуются, остальные кванты выводятся из них. Если imatrix нет, квантизаторы запускаются с единичными весами или без весов — для каждого тензора выбирается вариант с меньшим остатком. Набор квантов Qwen3.5-2B без BF16 и imatrix (21 файл, 28 ГБ) сжимается до 17%; lmz — до 40%.
|
|
95
|
+
- Если опубликованный imatrix отличается от того, которым квантовали (так в Qwen3.5), часть блоков предсказывается неточно. Корректность от этого не страдает, растёт только размер: для Qwen3.5-2B все кванты вместе стоят 33 МБ.
|
|
96
|
+
- Проверено на Windows 10 и Ubuntu (WSL2) с RTX 5070; другие видеокарты — в плане (ROADMAP, п. 22).
|
|
97
|
+
|
|
98
|
+
## Лицензия
|
|
99
|
+
|
|
100
|
+
Apache-2.0 (`LICENSE`). Исходники квантизации llama.cpp / ggml в `seedpack/ggml/` — MIT, см. `NOTICE`.
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/glmn-ai/seedpack/main/assets/banner.png" alt="SeedPack" width="860">
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
# SeedPack
|
|
6
|
+
|
|
7
|
+
**Lossless GPU archiver for GGUF model repositories.** A whole repository, the BF16 model and all its quants from IQ1 to Q8, packs into one archive about the size of a single compressed BF16 file. Every file comes back byte for byte.
|
|
8
|
+
|
|
9
|
+
| unsloth/Qwen3-0.6B-GGUF, BF16 + 25 quants (10.95 GB) | Archive | Ratio |
|
|
10
|
+
|---|---:|---:|
|
|
11
|
+
| **SeedPack** | **782 MB** | **7.14%** |
|
|
12
|
+
| lmz 1.3.0 | 4.54 GB | 41.47% |
|
|
13
|
+
| zstd 1.5.7 -19 --long=30 | 6.57 GB | 59.99% |
|
|
14
|
+
| 7-Zip 23.01 -mx9 | 10.21 GB | 93.26% |
|
|
15
|
+
| ZipNN 0.5.4 | 10.33 GB | 94.34% |
|
|
16
|
+
|
|
17
|
+
The archive is smaller than the repository's largest single quant (UD-Q8_K_XL, 844 MB). The full benchmark against 10 other compressors, with speeds and single files, is on the [example archive's page](https://huggingface.co/neurosquad/Qwen3-0.6B-SEEDPACK).
|
|
18
|
+
|
|
19
|
+
## Install
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pip install seedpack
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Requirements:
|
|
26
|
+
- An NVIDIA GPU, Turing (RTX 20xx) or newer, with a CUDA 13 driver (R580 or newer).
|
|
27
|
+
- Python 3.11+.
|
|
28
|
+
- Windows 10/11 or Linux. Tested on an RTX 5070 under Windows 10 (Python 3.11) and Ubuntu on WSL2 (Python 3.14).
|
|
29
|
+
- No CUDA Toolkit is needed: NVRTC, nvJitLink and the CUDA headers come from pip.
|
|
30
|
+
|
|
31
|
+
Archives are portable between operating systems: an archive packed on Windows unpacks bit-exactly on Linux, and the other way round. The first run compiles the GPU quantizers for your card (about 15 s) and caches them in `%LOCALAPPDATA%\seedpack\cache` or `~/.cache/seedpack`; set `SEEDPACK_CACHE` to move the cache.
|
|
32
|
+
|
|
33
|
+
## Use
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# straight from the Hugging Face Hub: download once, extract what you need
|
|
37
|
+
seedpack list hf://neurosquad/Qwen3-0.6B-SEEDPACK
|
|
38
|
+
seedpack x hf://neurosquad/Qwen3-0.6B-SEEDPACK Qwen3-0.6B-Q4_K_M.gguf -o models
|
|
39
|
+
seedpack x hf://neurosquad/Qwen3-0.6B-SEEDPACK "*Q4_K*" "*Q8_0*" -o models
|
|
40
|
+
seedpack x hf://neurosquad/Qwen3-0.6B-SEEDPACK -o models # everything
|
|
41
|
+
|
|
42
|
+
# local archives
|
|
43
|
+
seedpack pack models/Qwen3-0.6B-GGUF -o qwen3.varc # files and/or folders
|
|
44
|
+
seedpack x qwen3.varc Qwen3-0.6B-Q4_K_M.gguf -o out
|
|
45
|
+
seedpack test qwen3.varc # decode and verify, write nothing
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Notes on the commands:
|
|
49
|
+
- `hf://OWNER/REPO[/FILE.varc][@REVISION]` and `https://huggingface.co/...` links work wherever an archive is expected.
|
|
50
|
+
- `list` reads only the archive's index over the network; `x` and `test` download the archive once into the Hugging Face cache.
|
|
51
|
+
- Extracted files are checked against BLAKE3 hashes. Every chunk of the archive carries a CRC32.
|
|
52
|
+
|
|
53
|
+
## How it works
|
|
54
|
+
|
|
55
|
+
A GGUF repository ships the same weights 20–30 times: the BF16 model plus each quantization of it. To a general-purpose compressor that looks like gigabytes of almost incompressible bytes. SeedPack uses the fact that every quant is a deterministic function of the same weights:
|
|
56
|
+
|
|
57
|
+
- **The seed is stored once.** The most precise model (the BF16 file, or the senior quant when there is none) is coded with an entropy coder built for its weights.
|
|
58
|
+
- **Quants are re-derived, not stored.** Each quant is computed again on the GPU by a bit-exact CUDA port of llama.cpp's quantizers (`ggml-quants.c`, compiled without FMA contraction), with the repository's importance matrix.
|
|
59
|
+
- **Only the residual is kept.** Where a re-derived quant differs from the published file, the residual is coded with the quantizer's own probabilities: scales first, then each code relative to its rounding boundary. For Qwen3-0.6B, all 25 quants together cost about 1 MB on top of the seed.
|
|
60
|
+
- **Duplicates are stored once.** Identical tensors in different files are kept once. Files that are not GGUF are compressed with LZMA or zstd.
|
|
61
|
+
|
|
62
|
+
## Links
|
|
63
|
+
|
|
64
|
+
- Source and research notes: <https://github.com/glmn-ai/seedpack>
|
|
65
|
+
- Example archive: <https://huggingface.co/neurosquad/Qwen3-0.6B-SEEDPACK>
|
|
66
|
+
- A [NeuroSquad](https://huggingface.co/neurosquad) project.
|
|
67
|
+
|
|
68
|
+
## License
|
|
69
|
+
|
|
70
|
+
Apache-2.0. The bundled llama.cpp / ggml quantization sources (`seedpack/ggml/`) are MIT-licensed; see `NOTICE`.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=77"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "seedpack"
|
|
7
|
+
dynamic = ["version"]
|
|
8
|
+
description = "Lossless GPU archiver for GGUF model repositories: the BF16 model and all its quants in one archive about the size of a single compressed BF16 file"
|
|
9
|
+
readme = "README_PYPI.md"
|
|
10
|
+
requires-python = ">=3.11"
|
|
11
|
+
license = "Apache-2.0"
|
|
12
|
+
license-files = ["LICENSE", "NOTICE", "seedpack/ggml/LICENSE"]
|
|
13
|
+
authors = [{ name = "NeuroSquad" }]
|
|
14
|
+
keywords = ["gguf", "llama.cpp", "lossless", "compression", "archiver", "quantization", "cuda", "llm", "huggingface"]
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Development Status :: 4 - Beta",
|
|
17
|
+
"Environment :: Console",
|
|
18
|
+
"Environment :: GPU :: NVIDIA CUDA :: 13",
|
|
19
|
+
"Intended Audience :: Developers",
|
|
20
|
+
"Intended Audience :: Science/Research",
|
|
21
|
+
"Operating System :: Microsoft :: Windows",
|
|
22
|
+
"Operating System :: POSIX :: Linux",
|
|
23
|
+
"Programming Language :: Python :: 3",
|
|
24
|
+
"Programming Language :: Python :: 3.11",
|
|
25
|
+
"Programming Language :: Python :: 3.12",
|
|
26
|
+
"Programming Language :: Python :: 3.13",
|
|
27
|
+
"Programming Language :: Python :: 3.14",
|
|
28
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
29
|
+
"Topic :: System :: Archiving :: Compression",
|
|
30
|
+
]
|
|
31
|
+
dependencies = [
|
|
32
|
+
"numpy>=2.0",
|
|
33
|
+
"numba>=0.60",
|
|
34
|
+
"zstandard>=0.23",
|
|
35
|
+
"blake3>=1.0",
|
|
36
|
+
"cupy-cuda13x>=14.0",
|
|
37
|
+
"nvidia-cuda-nvrtc>=13.0",
|
|
38
|
+
"nvidia-cuda-runtime>=13.0",
|
|
39
|
+
"nvidia-nvjitlink>=13.0",
|
|
40
|
+
"huggingface_hub>=0.30",
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
[project.urls]
|
|
44
|
+
Homepage = "https://github.com/glmn-ai/seedpack"
|
|
45
|
+
Source = "https://github.com/glmn-ai/seedpack"
|
|
46
|
+
Issues = "https://github.com/glmn-ai/seedpack/issues"
|
|
47
|
+
"Example archive" = "https://huggingface.co/neurosquad/Qwen3-0.6B-SEEDPACK"
|
|
48
|
+
|
|
49
|
+
[project.scripts]
|
|
50
|
+
seedpack = "seedpack.cli:main"
|
|
51
|
+
|
|
52
|
+
[tool.setuptools]
|
|
53
|
+
packages = ["seedpack", "seedpack.ggml", "seedpack.ggml.variants"]
|
|
54
|
+
|
|
55
|
+
[tool.setuptools.dynamic]
|
|
56
|
+
version = { attr = "seedpack.__version__" }
|
|
57
|
+
|
|
58
|
+
[tool.setuptools.package-data]
|
|
59
|
+
"seedpack.ggml" = ["LICENSE", "*.c", "*.h", "ggml-cpu/*.h", "build.sh", "iqtables.npz"]
|
|
60
|
+
"seedpack.ggml.variants" = ["*.c"]
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"""SeedPack: lossless GPU archiver for GGUF model repositories.
|
|
2
|
+
|
|
3
|
+
The quants of a repository are re-derived on the GPU from its most precise model (the seed) with
|
|
4
|
+
a bit-exact port of llama.cpp's quantisers; only what differs is stored. Command line: `seedpack`.
|
|
5
|
+
"""
|
|
6
|
+
__version__ = "0.1.0"
|