goodwoolf 0.0.1__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.
Files changed (27) hide show
  1. goodwoolf-0.0.1/LICENSE +21 -0
  2. goodwoolf-0.0.1/PKG-INFO +173 -0
  3. goodwoolf-0.0.1/README.md +157 -0
  4. goodwoolf-0.0.1/pyproject.toml +33 -0
  5. goodwoolf-0.0.1/setup.cfg +4 -0
  6. goodwoolf-0.0.1/src/goodwoolf/config/Qwen/Qwen2-0.5B/chat_template.jinja +6 -0
  7. goodwoolf-0.0.1/src/goodwoolf/config/Qwen/Qwen2-0.5B/model.yaml +65 -0
  8. goodwoolf-0.0.1/src/goodwoolf/config/Qwen/Qwen2-0.5B/tokenizer.json +757273 -0
  9. goodwoolf-0.0.1/src/goodwoolf/config/Qwen/Qwen2-0.5B/tokenizer_config.json +19 -0
  10. goodwoolf-0.0.1/src/goodwoolf/config/SupraLabs/Supra-Mini-0.1M/model.yaml +41 -0
  11. goodwoolf-0.0.1/src/goodwoolf/config/SupraLabs/Supra-Mini-0.1M/tokenizer.json +336 -0
  12. goodwoolf-0.0.1/src/goodwoolf/config/SupraLabs/Supra-Mini-0.1M/tokenizer_config.json +11 -0
  13. goodwoolf-0.0.1/src/goodwoolf/data/openwebtext/prepare.py +111 -0
  14. goodwoolf-0.0.1/src/goodwoolf/data/shakespeare/prepare.py +105 -0
  15. goodwoolf-0.0.1/src/goodwoolf/main.py +169 -0
  16. goodwoolf-0.0.1/src/goodwoolf/models/GoodWoolf/default/model.py +24 -0
  17. goodwoolf-0.0.1/src/goodwoolf/models/GoodWoolf/default/pretrain.py +226 -0
  18. goodwoolf-0.0.1/src/goodwoolf/models/GoodWoolf/default/tokenizer.py +16 -0
  19. goodwoolf-0.0.1/src/goodwoolf/utils/ledger.py +216 -0
  20. goodwoolf-0.0.1/src/goodwoolf/utils/models.py +423 -0
  21. goodwoolf-0.0.1/src/goodwoolf/utils/system.py +126 -0
  22. goodwoolf-0.0.1/src/goodwoolf.egg-info/PKG-INFO +173 -0
  23. goodwoolf-0.0.1/src/goodwoolf.egg-info/SOURCES.txt +25 -0
  24. goodwoolf-0.0.1/src/goodwoolf.egg-info/dependency_links.txt +1 -0
  25. goodwoolf-0.0.1/src/goodwoolf.egg-info/entry_points.txt +3 -0
  26. goodwoolf-0.0.1/src/goodwoolf.egg-info/requires.txt +7 -0
  27. goodwoolf-0.0.1/src/goodwoolf.egg-info/top_level.txt +1 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 GoodWoolf
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,173 @@
1
+ Metadata-Version: 2.4
2
+ Name: goodwoolf
3
+ Version: 0.0.1
4
+ Summary: Building foundation collaboratively models on commodity hardware.
5
+ Requires-Python: >=3.12
6
+ Description-Content-Type: text/markdown
7
+ License-File: LICENSE
8
+ Requires-Dist: click>=8.5.0
9
+ Requires-Dist: datasets>=5.0.0
10
+ Requires-Dist: numpy>=2.4.6
11
+ Requires-Dist: tiktoken>=0.13.0
12
+ Requires-Dist: torch>=2.12.0
13
+ Requires-Dist: tqdm>=4.68.1
14
+ Requires-Dist: transformers>=5.10.2
15
+ Dynamic: license-file
16
+
17
+
18
+ <p align="center">
19
+ <a href="https://goodwoolf.ai">
20
+ <img src="https://github.com/GoodWoolf-AI/.github/raw/main/profile/goodwoolf.svg" width="200" alt="GoodWoolf" />
21
+ </a>
22
+ </p>
23
+
24
+ <h1 align="center">
25
+ <a href="https://goodwoolf.ai">GoodWoolf</a>
26
+ </h1>
27
+
28
+ <p align="center">
29
+ <strong>AI by the People</strong>
30
+ </p>
31
+
32
+ <p align="center">
33
+ Foundation Models · Commodity Hardware · Collaborative Training
34
+ </p>
35
+
36
+ <p align="center">
37
+ <a href="https://goodwoolf.ai">Website</a>
38
+ &nbsp;·&nbsp;
39
+ <a href="https://docs.goodwoolf.ai">Docs</a>
40
+ &nbsp;·&nbsp;
41
+ <a href="https://github.com/GoodWoolf-AI/GoodWoolf">Main Repository</a>
42
+ &nbsp;·&nbsp;
43
+ <a href="https://huggingface.co/datasets/GoodWoolf/Training-Ledger">Training-Ledger</a>
44
+ </p>
45
+
46
+ <br/>
47
+
48
+ ## Building Foundation Models Collaboratively on Commodity Hardware
49
+
50
+ GoodWoolf builds large foundation models on commodity hardware using the following principles:
51
+
52
+ - **Open Collaboration.**
53
+ Enable collective model development across independent contributors, coordinated through a shared public training ledger.
54
+
55
+ - **Virtual Memory Extension:** Expanding effective memory beyond physical RAM by leveraging storage-based virtual memory.
56
+
57
+ - **Data-Independent Scaling:** Decoupling total training time from global data volume, bounding system latency to individual run durations rather than aggregate data sizes.
58
+
59
+ Learn more by following the online documenation:
60
+
61
+ - [Get Started](https://docs.goodwoolf.ai/)
62
+ - [Introduction](https://docs.goodwoolf.ai/introduction)
63
+ - [Features](https://docs.goodwoolf.ai/category/features)
64
+ - [Training Process](https://docs.goodwoolf.ai/features/training-process)
65
+ - [Training Ledger](https://docs.goodwoolf.ai/features/training-ledger)
66
+ - [Collective Training Time](https://docs.goodwoolf.ai/features/training-time)
67
+ - [Model Poisoning Controls](https://docs.goodwoolf.ai/features/model-poisoning)
68
+ - [Configure](https://docs.goodwoolf.ai/category/configure)
69
+ - [Python Environment](https://docs.goodwoolf.ai/setup/environment)
70
+ - [Virtaul Memory](https://docs.goodwoolf.ai/setup/virtual-memory)
71
+ - [Usage](https://docs.goodwoolf.ai/category/usage)
72
+ - [Naming Conventions](https://docs.goodwoolf.ai/usage/naming-conventions)
73
+ - [Prepare training data](https://docs.goodwoolf.ai/usage/prepare-data)
74
+ - [Download model weights](https://docs.goodwoolf.ai/usage/download-model)
75
+ - [Train model](https://docs.goodwoolf.ai/usage/train-model)
76
+ - [Generate text](https://docs.goodwoolf.ai/usage/generate-text)
77
+ - [Create a new model](https://docs.goodwoolf.ai/usage/create-model)
78
+ - [Publish a new model](https://docs.goodwoolf.ai/usage/publish-model)
79
+ - [Publish a model update](https://docs.goodwoolf.ai/usage/publish-update)
80
+
81
+ ## Project Structure
82
+
83
+ The project consists of two repositories:
84
+
85
+ - [GoodWoolf Core](https://github.com/GoodWoolf-AI/GoodWoolf) (this repository) - the training framework
86
+ - [GoodWoolf Training Ledger](https://hf.co/datasets/GoodWoolf/Training-Ledger) - the public training log
87
+
88
+ ### Collaborative Training Workflow
89
+
90
+ The training process is hardware-agnostic, parallel, and completely asynchronous.
91
+
92
+ ```bash
93
+ =======================================================
94
+ Visual represenation of Collaborative Training Workflow
95
+ =======================================================
96
+
97
+ +-----------+----------+-----------+
98
+ | | | |
99
+ v | | |
100
+ +----------------+ | v |
101
+ | Participant A | | +----------------+ |
102
+ |----------------| | | Participant B | |
103
+ | Local data | | |----------------| |
104
+ | Train locally | | | Local data | |
105
+ | Publish model | | | Train locally | |
106
+ | Pull request | | | Publish model | |
107
+ +-------+--------+ | | Pull request | |
108
+ | v +--------+-------+ |
109
+ | +----------------+ | |
110
+ | | Participant C | | |
111
+ | |----------------| | |
112
+ | | Local data | | |
113
+ | | Train locally | | |
114
+ | | Model offload | | |
115
+ | | Pull request | | |
116
+ | +------+---------+ | |
117
+ | | | |
118
+ v v v |
119
+ +-----------------------------+ |
120
+ | PUBLIC TRAINING LEDGER |-------+
121
+ |-----------------------------|
122
+ | Base model weights |
123
+ | Training updates / PRs |<------+
124
+ | Training history | |
125
+ +-----------------------------+ |
126
+ | |
127
+ v |
128
+ +-----------------------------+ |
129
+ | Peers / Independent | |
130
+ | Auditors |-------+
131
+ |-----------------------------|
132
+ | Validate and aggregate |
133
+ | model updates |
134
+ | Publish updated model |
135
+ | Pull request |
136
+ +-----------------------------+
137
+ ```
138
+
139
+ ## Usage Examples
140
+
141
+ ### Prepare training data
142
+
143
+ ```
144
+ goodwoolf prepare <vendor>/<model> <dataset>
145
+ ```
146
+
147
+ ### Download model weights
148
+
149
+ ```bash
150
+ goodwoolf pull <vendor>/<model>
151
+ ```
152
+
153
+ ### Train model
154
+
155
+ ```bash
156
+ goodwoolf pretrain <vendor>/<model> <dataset>
157
+ ```
158
+
159
+ ### Generate text
160
+
161
+ ```bash
162
+ goodwoolf run <vendor>/<model> --prompt "A long time ago..."
163
+ ```
164
+
165
+ ## Get involved
166
+
167
+ GoodWoolf is built by an open-source community project.
168
+
169
+ Whether you're trainig and sharing models, improving the platform, fixing bugs or writing documentation, your contributions are welcome.
170
+
171
+ ## License
172
+ - [GoodWoolf](https://github.com/GoodWoolf-AI/GoodWoolf): MIT
173
+ - [GoodWoolf Training Ledger](https://hf.co/datasets/GoodWoolf/Training-Ledger): OpenMDW
@@ -0,0 +1,157 @@
1
+
2
+ <p align="center">
3
+ <a href="https://goodwoolf.ai">
4
+ <img src="https://github.com/GoodWoolf-AI/.github/raw/main/profile/goodwoolf.svg" width="200" alt="GoodWoolf" />
5
+ </a>
6
+ </p>
7
+
8
+ <h1 align="center">
9
+ <a href="https://goodwoolf.ai">GoodWoolf</a>
10
+ </h1>
11
+
12
+ <p align="center">
13
+ <strong>AI by the People</strong>
14
+ </p>
15
+
16
+ <p align="center">
17
+ Foundation Models · Commodity Hardware · Collaborative Training
18
+ </p>
19
+
20
+ <p align="center">
21
+ <a href="https://goodwoolf.ai">Website</a>
22
+ &nbsp;·&nbsp;
23
+ <a href="https://docs.goodwoolf.ai">Docs</a>
24
+ &nbsp;·&nbsp;
25
+ <a href="https://github.com/GoodWoolf-AI/GoodWoolf">Main Repository</a>
26
+ &nbsp;·&nbsp;
27
+ <a href="https://huggingface.co/datasets/GoodWoolf/Training-Ledger">Training-Ledger</a>
28
+ </p>
29
+
30
+ <br/>
31
+
32
+ ## Building Foundation Models Collaboratively on Commodity Hardware
33
+
34
+ GoodWoolf builds large foundation models on commodity hardware using the following principles:
35
+
36
+ - **Open Collaboration.**
37
+ Enable collective model development across independent contributors, coordinated through a shared public training ledger.
38
+
39
+ - **Virtual Memory Extension:** Expanding effective memory beyond physical RAM by leveraging storage-based virtual memory.
40
+
41
+ - **Data-Independent Scaling:** Decoupling total training time from global data volume, bounding system latency to individual run durations rather than aggregate data sizes.
42
+
43
+ Learn more by following the online documenation:
44
+
45
+ - [Get Started](https://docs.goodwoolf.ai/)
46
+ - [Introduction](https://docs.goodwoolf.ai/introduction)
47
+ - [Features](https://docs.goodwoolf.ai/category/features)
48
+ - [Training Process](https://docs.goodwoolf.ai/features/training-process)
49
+ - [Training Ledger](https://docs.goodwoolf.ai/features/training-ledger)
50
+ - [Collective Training Time](https://docs.goodwoolf.ai/features/training-time)
51
+ - [Model Poisoning Controls](https://docs.goodwoolf.ai/features/model-poisoning)
52
+ - [Configure](https://docs.goodwoolf.ai/category/configure)
53
+ - [Python Environment](https://docs.goodwoolf.ai/setup/environment)
54
+ - [Virtaul Memory](https://docs.goodwoolf.ai/setup/virtual-memory)
55
+ - [Usage](https://docs.goodwoolf.ai/category/usage)
56
+ - [Naming Conventions](https://docs.goodwoolf.ai/usage/naming-conventions)
57
+ - [Prepare training data](https://docs.goodwoolf.ai/usage/prepare-data)
58
+ - [Download model weights](https://docs.goodwoolf.ai/usage/download-model)
59
+ - [Train model](https://docs.goodwoolf.ai/usage/train-model)
60
+ - [Generate text](https://docs.goodwoolf.ai/usage/generate-text)
61
+ - [Create a new model](https://docs.goodwoolf.ai/usage/create-model)
62
+ - [Publish a new model](https://docs.goodwoolf.ai/usage/publish-model)
63
+ - [Publish a model update](https://docs.goodwoolf.ai/usage/publish-update)
64
+
65
+ ## Project Structure
66
+
67
+ The project consists of two repositories:
68
+
69
+ - [GoodWoolf Core](https://github.com/GoodWoolf-AI/GoodWoolf) (this repository) - the training framework
70
+ - [GoodWoolf Training Ledger](https://hf.co/datasets/GoodWoolf/Training-Ledger) - the public training log
71
+
72
+ ### Collaborative Training Workflow
73
+
74
+ The training process is hardware-agnostic, parallel, and completely asynchronous.
75
+
76
+ ```bash
77
+ =======================================================
78
+ Visual represenation of Collaborative Training Workflow
79
+ =======================================================
80
+
81
+ +-----------+----------+-----------+
82
+ | | | |
83
+ v | | |
84
+ +----------------+ | v |
85
+ | Participant A | | +----------------+ |
86
+ |----------------| | | Participant B | |
87
+ | Local data | | |----------------| |
88
+ | Train locally | | | Local data | |
89
+ | Publish model | | | Train locally | |
90
+ | Pull request | | | Publish model | |
91
+ +-------+--------+ | | Pull request | |
92
+ | v +--------+-------+ |
93
+ | +----------------+ | |
94
+ | | Participant C | | |
95
+ | |----------------| | |
96
+ | | Local data | | |
97
+ | | Train locally | | |
98
+ | | Model offload | | |
99
+ | | Pull request | | |
100
+ | +------+---------+ | |
101
+ | | | |
102
+ v v v |
103
+ +-----------------------------+ |
104
+ | PUBLIC TRAINING LEDGER |-------+
105
+ |-----------------------------|
106
+ | Base model weights |
107
+ | Training updates / PRs |<------+
108
+ | Training history | |
109
+ +-----------------------------+ |
110
+ | |
111
+ v |
112
+ +-----------------------------+ |
113
+ | Peers / Independent | |
114
+ | Auditors |-------+
115
+ |-----------------------------|
116
+ | Validate and aggregate |
117
+ | model updates |
118
+ | Publish updated model |
119
+ | Pull request |
120
+ +-----------------------------+
121
+ ```
122
+
123
+ ## Usage Examples
124
+
125
+ ### Prepare training data
126
+
127
+ ```
128
+ goodwoolf prepare <vendor>/<model> <dataset>
129
+ ```
130
+
131
+ ### Download model weights
132
+
133
+ ```bash
134
+ goodwoolf pull <vendor>/<model>
135
+ ```
136
+
137
+ ### Train model
138
+
139
+ ```bash
140
+ goodwoolf pretrain <vendor>/<model> <dataset>
141
+ ```
142
+
143
+ ### Generate text
144
+
145
+ ```bash
146
+ goodwoolf run <vendor>/<model> --prompt "A long time ago..."
147
+ ```
148
+
149
+ ## Get involved
150
+
151
+ GoodWoolf is built by an open-source community project.
152
+
153
+ Whether you're trainig and sharing models, improving the platform, fixing bugs or writing documentation, your contributions are welcome.
154
+
155
+ ## License
156
+ - [GoodWoolf](https://github.com/GoodWoolf-AI/GoodWoolf): MIT
157
+ - [GoodWoolf Training Ledger](https://hf.co/datasets/GoodWoolf/Training-Ledger): OpenMDW
@@ -0,0 +1,33 @@
1
+ [project]
2
+ name = "goodwoolf"
3
+ version = "0.0.1"
4
+ description = "Building foundation collaboratively models on commodity hardware."
5
+ readme = "README.md"
6
+ requires-python = ">=3.12"
7
+ dependencies = [
8
+ "click>=8.5.0",
9
+ "datasets>=5.0.0",
10
+ "numpy>=2.4.6",
11
+ "tiktoken>=0.13.0",
12
+ "torch>=2.12.0",
13
+ "tqdm>=4.68.1",
14
+ "transformers>=5.10.2",
15
+ ]
16
+
17
+ [tool.setuptools.packages.find]
18
+ where = ["src"]
19
+ include = ["goodwoolf", "goodwoolf.*"]
20
+ # enable folders as packages without __init__ files
21
+ namespaces = true
22
+
23
+ # build dist package with non-python files
24
+ [tool.setuptools.package-data]
25
+ goodwoolf = [
26
+ "config/**/*.json",
27
+ "config/**/*.jinja",
28
+ "config/**/*.yaml",
29
+ ]
30
+
31
+ [project.scripts]
32
+ goodwoolf = "goodwoolf.main:main"
33
+ gw = "goodwoolf.main:main"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,6 @@
1
+ {% for message in messages %}{% if loop.first and messages[0]['role'] != 'system' %}{{ '<|im_start|>system
2
+ You are a helpful assistant<|im_end|>
3
+ ' }}{% endif %}{{'<|im_start|>' + message['role'] + '
4
+ ' + message['content'] + '<|im_end|>' + '
5
+ '}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant
6
+ ' }}{% endif %}
@@ -0,0 +1,65 @@
1
+ transformers_version: 5.10.2
2
+ architectures:
3
+ - Qwen2ForCausalLM
4
+ output_hidden_states: false
5
+ return_dict: true
6
+ dtype: bfloat16
7
+ chunk_size_feed_forward: 0
8
+ is_encoder_decoder: false
9
+ id2label:
10
+ 0: LABEL_0
11
+ 1: LABEL_1
12
+ label2id:
13
+ LABEL_0: 0
14
+ LABEL_1: 1
15
+ problem_type: null
16
+ vocab_size: 151936
17
+ hidden_size: 896
18
+ intermediate_size: 4864
19
+ num_hidden_layers: 24
20
+ num_attention_heads: 14
21
+ num_key_value_heads: 2
22
+ hidden_act: silu
23
+ max_position_embeddings: 131072
24
+ initializer_range: 0.02
25
+ rms_norm_eps: 1.0e-06
26
+ use_cache: true
27
+ tie_word_embeddings: true
28
+ rope_parameters:
29
+ rope_theta: 1000000.0
30
+ rope_type: default
31
+ use_sliding_window: false
32
+ sliding_window: null
33
+ max_window_layers: 24
34
+ layer_types:
35
+ - full_attention
36
+ - full_attention
37
+ - full_attention
38
+ - full_attention
39
+ - full_attention
40
+ - full_attention
41
+ - full_attention
42
+ - full_attention
43
+ - full_attention
44
+ - full_attention
45
+ - full_attention
46
+ - full_attention
47
+ - full_attention
48
+ - full_attention
49
+ - full_attention
50
+ - full_attention
51
+ - full_attention
52
+ - full_attention
53
+ - full_attention
54
+ - full_attention
55
+ - full_attention
56
+ - full_attention
57
+ - full_attention
58
+ - full_attention
59
+ attention_dropout: 0.0
60
+ pad_token_id: null
61
+ bos_token_id: 151643
62
+ eos_token_id: 151643
63
+ _name_or_path: Qwen/Qwen2-0.5B
64
+ model_type: qwen2
65
+ output_attentions: false