Add `openpeerllm` as library_name
#1
by
Wauplin
HF Staff
- opened
README.md
CHANGED
|
@@ -1,209 +1,209 @@
|
|
| 1 |
-
---
|
| 2 |
-
language:
|
| 3 |
-
- en
|
| 4 |
-
license: mit
|
| 5 |
-
library_name:
|
| 6 |
-
pipeline_tag: text-generation
|
| 7 |
-
tags:
|
| 8 |
-
- pytorch
|
| 9 |
-
- causal-lm
|
| 10 |
-
- decentralized-learning
|
| 11 |
-
- transformer
|
| 12 |
-
- boinc
|
| 13 |
-
- decent-torch
|
| 14 |
-
- lonscript
|
| 15 |
-
datasets:
|
| 16 |
-
- custom
|
| 17 |
-
model-index:
|
| 18 |
-
- name: OpenPeerLLM
|
| 19 |
-
results:
|
| 20 |
-
- task:
|
| 21 |
-
name: Language Modeling
|
| 22 |
-
type: text-generation
|
| 23 |
-
dataset:
|
| 24 |
-
name: Custom Text Dataset
|
| 25 |
-
type: text
|
| 26 |
-
metrics:
|
| 27 |
-
- name: Epoch
|
| 28 |
-
type: number
|
| 29 |
-
value: 2
|
| 30 |
-
- name: Model Size
|
| 31 |
-
type: text
|
| 32 |
-
value: "1.82 GB"
|
| 33 |
-
- name: Run Time
|
| 34 |
-
type: text
|
| 35 |
-
value: "2.5 minutes on Intel UHD Graphics 630"
|
| 36 |
-
- name: Loss
|
| 37 |
-
type: cross-entropy
|
| 38 |
-
value: 7.11
|
| 39 |
-
---
|
| 40 |
-
|
| 41 |
-
# OpenPeerLLM: A Decentralized Large Language Model
|
| 42 |
-
|
| 43 |
-
[](https://doi.org/10.57967/hf/6469)
|
| 44 |
-
|
| 45 |
-
This project implements a decentralized Large Language Model (LLM) that utilizes DecentTorch, Huggingface Transformers, BOINC, and the decentralized-internet SDK. The model incorporates LonScript grammar for enhanced language understanding and leverages OpenPeer for decentralized training and inference.
|
| 46 |
-
|
| 47 |
-
## Author Information
|
| 48 |
-
- **Author:** Andrew Magdy Kamal Nassief
|
| 49 |
-
- **Year:** 2025
|
| 50 |
-
- **Publisher:** Stark Publishing Group
|
| 51 |
-
- **Journal:** Hugging Face Model Hub
|
| 52 |
-
|
| 53 |
-
## Features
|
| 54 |
-
|
| 55 |
-
- Decentralized model architecture using DecentTorch
|
| 56 |
-
- Distributed computation through BOINC integration
|
| 57 |
-
- OpenPeer network integration for peer-to-peer model training
|
| 58 |
-
- LonScript-inspired grammar parsing system
|
| 59 |
-
- Deep reasoning capabilities following LLM standards
|
| 60 |
-
|
| 61 |
-
## Installation
|
| 62 |
-
|
| 63 |
-
1. Install the required dependencies:
|
| 64 |
-
```bash
|
| 65 |
-
pip install -r requirements.txt
|
| 66 |
-
```
|
| 67 |
-
|
| 68 |
-
2. Ensure you have Mojo runtime installed for enhanced performance.
|
| 69 |
-
|
| 70 |
-
## Usage
|
| 71 |
-
|
| 72 |
-
```python
|
| 73 |
-
from src.model import DecentralizedLLM
|
| 74 |
-
from src.grammar import LonScriptGrammar
|
| 75 |
-
|
| 76 |
-
# Initialize the model
|
| 77 |
-
model = DecentralizedLLM()
|
| 78 |
-
grammar = LonScriptGrammar()
|
| 79 |
-
|
| 80 |
-
# Use the model for inference
|
| 81 |
-
response = model.reason("context", "query")
|
| 82 |
-
```
|
| 83 |
-
|
| 84 |
-
## Training Details
|
| 85 |
-
|
| 86 |
-
### Training Data
|
| 87 |
-
The model is trained on the [awesome-chatgpt-prompts](https://huggingface.co/datasets/fka/awesome-chatgpt-prompts) dataset, which contains diverse prompt-completion pairs. This dataset helps the model understand various roles and contexts, making it suitable for a wide range of applications.
|
| 88 |
-
|
| 89 |
-
### Training Procedure
|
| 90 |
-
- **Architecture:** 12-layer transformer with 768 hidden dimensions and 12 attention heads
|
| 91 |
-
- **Optimizer:** AdamW with learning rate 5e-5
|
| 92 |
-
- **Batch Size:** 8
|
| 93 |
-
- **Training Steps:** 10,000
|
| 94 |
-
- **Warmup Steps:** 1,000
|
| 95 |
-
- **Hardware:** Distributed across peer network nodes
|
| 96 |
-
|
| 97 |
-
## Evaluation Results
|
| 98 |
-
|
| 99 |
-
Initial testing shows promising results:
|
| 100 |
-
- **Final Epoch:** 2
|
| 101 |
-
- **Model Size:** 1.82 GB
|
| 102 |
-
- **Total Run Time:** 2.5 minutes on Intel UHD Graphics 630
|
| 103 |
-
- **Loss:** 7.11
|
| 104 |
-
- **Perplexity:** 1223.8
|
| 105 |
-
- **Accuracy:** 78.5%
|
| 106 |
-
- **Response Coherence:** 82.1%
|
| 107 |
-
- **Peer Network Efficiency:** 91.2%
|
| 108 |
-
|
| 109 |
-
### Metrics Explanation
|
| 110 |
-
|
| 111 |
-
#### Test Calculations and Methodology
|
| 112 |
-
|
| 113 |
-
Our evaluation metrics were computed using the following methodology:
|
| 114 |
-
|
| 115 |
-
1. **Training Progression**
|
| 116 |
-
- Total Steps = epochs × steps_per_epoch = 2 × 10,000 = 20,000
|
| 117 |
-
- Samples Processed = total_steps × batch_size = 20,000 × 8 = 160,000
|
| 118 |
-
- Average Time/Epoch = 75 seconds on Intel UHD Graphics 630
|
| 119 |
-
|
| 120 |
-
2. **Model Storage Analysis**
|
| 121 |
-
- Parameter Count = layers × hidden_dim² = 12 × 768² ≈ 7.1M
|
| 122 |
-
- Network State Size = 1.82 GB (measured post-training)
|
| 123 |
-
- Includes: weights, biases, peer coordination tables
|
| 124 |
-
|
| 125 |
-
3. **Performance Metrics**
|
| 126 |
-
- Cross-Entropy Loss = -∑(y_true * log(y_pred)) = 7.11
|
| 127 |
-
- Perplexity = exp(cross_entropy) = exp(7.11) ≈ 1223.8
|
| 128 |
-
- Token Accuracy = correct_predictions/total_tokens × 100 = 78.5%
|
| 129 |
-
|
| 130 |
-
4. **Output Evaluation**
|
| 131 |
-
- Coherence Score: Based on inter-sentence relationship strength
|
| 132 |
-
- Measured across 1000 generated responses
|
| 133 |
-
- Average semantic link score: 82.1%
|
| 134 |
-
|
| 135 |
-
5. **Network Metrics**
|
| 136 |
-
- Task Completion Rate = successful_tasks/total_tasks × 100 = 91.2%
|
| 137 |
-
- Measured across distributed training operations
|
| 138 |
-
- Accounts for node synchronization success
|
| 139 |
-
|
| 140 |
-
#### Metric Descriptions
|
| 141 |
-
|
| 142 |
-
- **Training Progress**: Two complete dataset passes, processing 160,000 total samples through 20,000 batched steps.
|
| 143 |
-
|
| 144 |
-
- **Model Scale**: Neural network deployment package of 1.82 GB, encompassing parameter matrices and distributed coordination components.
|
| 145 |
-
|
| 146 |
-
- **Validation Results**: Cross-entropy of 7.11 yields perplexity of 1223.8, indicating the model's token prediction spread across vocabulary space.
|
| 147 |
-
|
| 148 |
-
- **Token Precision**: Successfully predicted 78.5% of next tokens in held-out validation data, tested against reference completions.
|
| 149 |
-
|
| 150 |
-
- **Generation Quality**: Achieved 82.1% semantic continuity score across multi-sentence outputs, based on contextual alignment measurements.
|
| 151 |
-
|
| 152 |
-
- **Distributed Performance**: Maintained 91.2% task execution success rate across peer nodes during distributed operations.
|
| 153 |
-
|
| 154 |
-
- **Output Quality**: Automated analysis of 82.1% reflects the generated text's internal consistency, measuring how well each new statement connects to and builds upon previous ones.
|
| 155 |
-
|
| 156 |
-
- **Network Performance**: Distributed training achieved 91.2% task throughput, indicating the proportion of successfully coordinated computation across the peer-to-peer node network.
|
| 157 |
-
|
| 158 |
-
## Limitations & Biases
|
| 159 |
-
|
| 160 |
-
1. **Current Limitations:**
|
| 161 |
-
- Maximum sequence length of 1024 tokens
|
| 162 |
-
- Requires stable network connection for peer-to-peer operations
|
| 163 |
-
- Limited support for non-English languages
|
| 164 |
-
|
| 165 |
-
2. **Known Biases:**
|
| 166 |
-
- Training data may contain societal biases
|
| 167 |
-
- Peer network distribution may favor certain geographic regions
|
| 168 |
-
- Response quality depends on active peer participation
|
| 169 |
-
|
| 170 |
-
## Environmental Impact
|
| 171 |
-
|
| 172 |
-
The model is designed to minimize environmental impact through:
|
| 173 |
-
- Efficient resource distribution across peer networks
|
| 174 |
-
- Multithreading and parallel processing optimization
|
| 175 |
-
- Smart load balancing among participating nodes
|
| 176 |
-
- Reduced central server dependency
|
| 177 |
-
- Optimized computational resource sharing
|
| 178 |
-
|
| 179 |
-
## Architecture
|
| 180 |
-
|
| 181 |
-
The system consists of several key components:
|
| 182 |
-
|
| 183 |
-
1. **DecentralizedLLM:** The main model class that integrates various components
|
| 184 |
-
2. **LonScriptGrammar:** Grammar parsing system inspired by LonScript
|
| 185 |
-
3. **BOINC Integration:** For distributed computation
|
| 186 |
-
4. **OpenPeer Network:** For decentralized training and inference
|
| 187 |
-
|
| 188 |
-
## License
|
| 189 |
-
|
| 190 |
-
This project is licensed under multiple licenses to ensure maximum flexibility and openness:
|
| 191 |
-
- OPNL and OPNL-2 for the decentralized protocol aspects
|
| 192 |
-
- MIT License for the software implementation
|
| 193 |
-
- Creative Commons Attribution 4.0 International (CC-BY-4.0) for documentation and models
|
| 194 |
-
|
| 195 |
-
## Citation
|
| 196 |
-
|
| 197 |
-
```bibtex
|
| 198 |
-
@misc{openpeer-llm,
|
| 199 |
-
author = {Andrew Magdy Kamal Nassief},
|
| 200 |
-
title = {OpenPeerLLM: A Decentralized Language Model},
|
| 201 |
-
year = {2025},
|
| 202 |
-
publisher = {Stark Publishing Group},
|
| 203 |
-
journal = {Hugging Face Model Hub}
|
| 204 |
-
}
|
| 205 |
-
```
|
| 206 |
-
|
| 207 |
-
## Contributing
|
| 208 |
-
|
| 209 |
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
license: mit
|
| 5 |
+
library_name: openpeerllm
|
| 6 |
+
pipeline_tag: text-generation
|
| 7 |
+
tags:
|
| 8 |
+
- pytorch
|
| 9 |
+
- causal-lm
|
| 10 |
+
- decentralized-learning
|
| 11 |
+
- transformer
|
| 12 |
+
- boinc
|
| 13 |
+
- decent-torch
|
| 14 |
+
- lonscript
|
| 15 |
+
datasets:
|
| 16 |
+
- custom
|
| 17 |
+
model-index:
|
| 18 |
+
- name: OpenPeerLLM
|
| 19 |
+
results:
|
| 20 |
+
- task:
|
| 21 |
+
name: Language Modeling
|
| 22 |
+
type: text-generation
|
| 23 |
+
dataset:
|
| 24 |
+
name: Custom Text Dataset
|
| 25 |
+
type: text
|
| 26 |
+
metrics:
|
| 27 |
+
- name: Epoch
|
| 28 |
+
type: number
|
| 29 |
+
value: 2
|
| 30 |
+
- name: Model Size
|
| 31 |
+
type: text
|
| 32 |
+
value: "1.82 GB"
|
| 33 |
+
- name: Run Time
|
| 34 |
+
type: text
|
| 35 |
+
value: "2.5 minutes on Intel UHD Graphics 630"
|
| 36 |
+
- name: Loss
|
| 37 |
+
type: cross-entropy
|
| 38 |
+
value: 7.11
|
| 39 |
+
---
|
| 40 |
+
|
| 41 |
+
# OpenPeerLLM: A Decentralized Large Language Model
|
| 42 |
+
|
| 43 |
+
[](https://doi.org/10.57967/hf/6469)
|
| 44 |
+
|
| 45 |
+
This project implements a decentralized Large Language Model (LLM) that utilizes DecentTorch, Huggingface Transformers, BOINC, and the decentralized-internet SDK. The model incorporates LonScript grammar for enhanced language understanding and leverages OpenPeer for decentralized training and inference.
|
| 46 |
+
|
| 47 |
+
## Author Information
|
| 48 |
+
- **Author:** Andrew Magdy Kamal Nassief
|
| 49 |
+
- **Year:** 2025
|
| 50 |
+
- **Publisher:** Stark Publishing Group
|
| 51 |
+
- **Journal:** Hugging Face Model Hub
|
| 52 |
+
|
| 53 |
+
## Features
|
| 54 |
+
|
| 55 |
+
- Decentralized model architecture using DecentTorch
|
| 56 |
+
- Distributed computation through BOINC integration
|
| 57 |
+
- OpenPeer network integration for peer-to-peer model training
|
| 58 |
+
- LonScript-inspired grammar parsing system
|
| 59 |
+
- Deep reasoning capabilities following LLM standards
|
| 60 |
+
|
| 61 |
+
## Installation
|
| 62 |
+
|
| 63 |
+
1. Install the required dependencies:
|
| 64 |
+
```bash
|
| 65 |
+
pip install -r requirements.txt
|
| 66 |
+
```
|
| 67 |
+
|
| 68 |
+
2. Ensure you have Mojo runtime installed for enhanced performance.
|
| 69 |
+
|
| 70 |
+
## Usage
|
| 71 |
+
|
| 72 |
+
```python
|
| 73 |
+
from src.model import DecentralizedLLM
|
| 74 |
+
from src.grammar import LonScriptGrammar
|
| 75 |
+
|
| 76 |
+
# Initialize the model
|
| 77 |
+
model = DecentralizedLLM()
|
| 78 |
+
grammar = LonScriptGrammar()
|
| 79 |
+
|
| 80 |
+
# Use the model for inference
|
| 81 |
+
response = model.reason("context", "query")
|
| 82 |
+
```
|
| 83 |
+
|
| 84 |
+
## Training Details
|
| 85 |
+
|
| 86 |
+
### Training Data
|
| 87 |
+
The model is trained on the [awesome-chatgpt-prompts](https://huggingface.co/datasets/fka/awesome-chatgpt-prompts) dataset, which contains diverse prompt-completion pairs. This dataset helps the model understand various roles and contexts, making it suitable for a wide range of applications.
|
| 88 |
+
|
| 89 |
+
### Training Procedure
|
| 90 |
+
- **Architecture:** 12-layer transformer with 768 hidden dimensions and 12 attention heads
|
| 91 |
+
- **Optimizer:** AdamW with learning rate 5e-5
|
| 92 |
+
- **Batch Size:** 8
|
| 93 |
+
- **Training Steps:** 10,000
|
| 94 |
+
- **Warmup Steps:** 1,000
|
| 95 |
+
- **Hardware:** Distributed across peer network nodes
|
| 96 |
+
|
| 97 |
+
## Evaluation Results
|
| 98 |
+
|
| 99 |
+
Initial testing shows promising results:
|
| 100 |
+
- **Final Epoch:** 2
|
| 101 |
+
- **Model Size:** 1.82 GB
|
| 102 |
+
- **Total Run Time:** 2.5 minutes on Intel UHD Graphics 630
|
| 103 |
+
- **Loss:** 7.11
|
| 104 |
+
- **Perplexity:** 1223.8
|
| 105 |
+
- **Accuracy:** 78.5%
|
| 106 |
+
- **Response Coherence:** 82.1%
|
| 107 |
+
- **Peer Network Efficiency:** 91.2%
|
| 108 |
+
|
| 109 |
+
### Metrics Explanation
|
| 110 |
+
|
| 111 |
+
#### Test Calculations and Methodology
|
| 112 |
+
|
| 113 |
+
Our evaluation metrics were computed using the following methodology:
|
| 114 |
+
|
| 115 |
+
1. **Training Progression**
|
| 116 |
+
- Total Steps = epochs × steps_per_epoch = 2 × 10,000 = 20,000
|
| 117 |
+
- Samples Processed = total_steps × batch_size = 20,000 × 8 = 160,000
|
| 118 |
+
- Average Time/Epoch = 75 seconds on Intel UHD Graphics 630
|
| 119 |
+
|
| 120 |
+
2. **Model Storage Analysis**
|
| 121 |
+
- Parameter Count = layers × hidden_dim² = 12 × 768² ≈ 7.1M
|
| 122 |
+
- Network State Size = 1.82 GB (measured post-training)
|
| 123 |
+
- Includes: weights, biases, peer coordination tables
|
| 124 |
+
|
| 125 |
+
3. **Performance Metrics**
|
| 126 |
+
- Cross-Entropy Loss = -∑(y_true * log(y_pred)) = 7.11
|
| 127 |
+
- Perplexity = exp(cross_entropy) = exp(7.11) ≈ 1223.8
|
| 128 |
+
- Token Accuracy = correct_predictions/total_tokens × 100 = 78.5%
|
| 129 |
+
|
| 130 |
+
4. **Output Evaluation**
|
| 131 |
+
- Coherence Score: Based on inter-sentence relationship strength
|
| 132 |
+
- Measured across 1000 generated responses
|
| 133 |
+
- Average semantic link score: 82.1%
|
| 134 |
+
|
| 135 |
+
5. **Network Metrics**
|
| 136 |
+
- Task Completion Rate = successful_tasks/total_tasks × 100 = 91.2%
|
| 137 |
+
- Measured across distributed training operations
|
| 138 |
+
- Accounts for node synchronization success
|
| 139 |
+
|
| 140 |
+
#### Metric Descriptions
|
| 141 |
+
|
| 142 |
+
- **Training Progress**: Two complete dataset passes, processing 160,000 total samples through 20,000 batched steps.
|
| 143 |
+
|
| 144 |
+
- **Model Scale**: Neural network deployment package of 1.82 GB, encompassing parameter matrices and distributed coordination components.
|
| 145 |
+
|
| 146 |
+
- **Validation Results**: Cross-entropy of 7.11 yields perplexity of 1223.8, indicating the model's token prediction spread across vocabulary space.
|
| 147 |
+
|
| 148 |
+
- **Token Precision**: Successfully predicted 78.5% of next tokens in held-out validation data, tested against reference completions.
|
| 149 |
+
|
| 150 |
+
- **Generation Quality**: Achieved 82.1% semantic continuity score across multi-sentence outputs, based on contextual alignment measurements.
|
| 151 |
+
|
| 152 |
+
- **Distributed Performance**: Maintained 91.2% task execution success rate across peer nodes during distributed operations.
|
| 153 |
+
|
| 154 |
+
- **Output Quality**: Automated analysis of 82.1% reflects the generated text's internal consistency, measuring how well each new statement connects to and builds upon previous ones.
|
| 155 |
+
|
| 156 |
+
- **Network Performance**: Distributed training achieved 91.2% task throughput, indicating the proportion of successfully coordinated computation across the peer-to-peer node network.
|
| 157 |
+
|
| 158 |
+
## Limitations & Biases
|
| 159 |
+
|
| 160 |
+
1. **Current Limitations:**
|
| 161 |
+
- Maximum sequence length of 1024 tokens
|
| 162 |
+
- Requires stable network connection for peer-to-peer operations
|
| 163 |
+
- Limited support for non-English languages
|
| 164 |
+
|
| 165 |
+
2. **Known Biases:**
|
| 166 |
+
- Training data may contain societal biases
|
| 167 |
+
- Peer network distribution may favor certain geographic regions
|
| 168 |
+
- Response quality depends on active peer participation
|
| 169 |
+
|
| 170 |
+
## Environmental Impact
|
| 171 |
+
|
| 172 |
+
The model is designed to minimize environmental impact through:
|
| 173 |
+
- Efficient resource distribution across peer networks
|
| 174 |
+
- Multithreading and parallel processing optimization
|
| 175 |
+
- Smart load balancing among participating nodes
|
| 176 |
+
- Reduced central server dependency
|
| 177 |
+
- Optimized computational resource sharing
|
| 178 |
+
|
| 179 |
+
## Architecture
|
| 180 |
+
|
| 181 |
+
The system consists of several key components:
|
| 182 |
+
|
| 183 |
+
1. **DecentralizedLLM:** The main model class that integrates various components
|
| 184 |
+
2. **LonScriptGrammar:** Grammar parsing system inspired by LonScript
|
| 185 |
+
3. **BOINC Integration:** For distributed computation
|
| 186 |
+
4. **OpenPeer Network:** For decentralized training and inference
|
| 187 |
+
|
| 188 |
+
## License
|
| 189 |
+
|
| 190 |
+
This project is licensed under multiple licenses to ensure maximum flexibility and openness:
|
| 191 |
+
- OPNL and OPNL-2 for the decentralized protocol aspects
|
| 192 |
+
- MIT License for the software implementation
|
| 193 |
+
- Creative Commons Attribution 4.0 International (CC-BY-4.0) for documentation and models
|
| 194 |
+
|
| 195 |
+
## Citation
|
| 196 |
+
|
| 197 |
+
```bibtex
|
| 198 |
+
@misc{openpeer-llm,
|
| 199 |
+
author = {Andrew Magdy Kamal Nassief},
|
| 200 |
+
title = {OpenPeerLLM: A Decentralized Language Model},
|
| 201 |
+
year = {2025},
|
| 202 |
+
publisher = {Stark Publishing Group},
|
| 203 |
+
journal = {Hugging Face Model Hub}
|
| 204 |
+
}
|
| 205 |
+
```
|
| 206 |
+
|
| 207 |
+
## Contributing
|
| 208 |
+
|
| 209 |
Contributions are welcome! Please feel free to submit a Pull Request.
|