Text Generation
Transformers
GGUF
conversational
Mungert commited on
Commit
39ac4d6
·
verified ·
1 Parent(s): bb8b199

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +337 -0
README.md ADDED
@@ -0,0 +1,337 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ datasets:
4
+ - Fortytwo-Network/Strandset-Rust-v1
5
+ base_model:
6
+ - Qwen/Qwen2.5-Coder-14B-Instruct
7
+ pipeline_tag: text-generation
8
+ library_name: transformers
9
+ ---
10
+
11
+ # <span style="color: #7FFF7F;">Strand-Rust-Coder-14B-v1 GGUF Models</span>
12
+
13
+
14
+ ## <span style="color: #7F7FFF;">Model Generation Details</span>
15
+
16
+ This model was generated using [llama.cpp](https://github.com/ggerganov/llama.cpp) at commit [`05fa625ea`](https://github.com/ggerganov/llama.cpp/commit/05fa625eac5bbdbe88b43f857156c35501421d6e).
17
+
18
+
19
+
20
+
21
+
22
+ ---
23
+
24
+ ## <span style="color: #7FFF7F;">Quantization Beyond the IMatrix</span>
25
+
26
+ I've been experimenting with a new quantization approach that selectively elevates the precision of key layers beyond what the default IMatrix configuration provides.
27
+
28
+ In my testing, standard IMatrix quantization underperforms at lower bit depths, especially with Mixture of Experts (MoE) models. To address this, I'm using the `--tensor-type` option in `llama.cpp` to manually "bump" important layers to higher precision. You can see the implementation here:
29
+ 👉 [Layer bumping with llama.cpp](https://github.com/Mungert69/GGUFModelBuilder/blob/main/model-converter/tensor_list_builder.py)
30
+
31
+ While this does increase model file size, it significantly improves precision for a given quantization level.
32
+
33
+ ### **I'd love your feedback—have you tried this? How does it perform for you?**
34
+
35
+
36
+
37
+
38
+ ---
39
+
40
+ <a href="https://readyforquantum.com/huggingface_gguf_selection_guide.html" style="color: #7FFF7F;">
41
+ Click here to get info on choosing the right GGUF model format
42
+ </a>
43
+
44
+ ---
45
+
46
+
47
+
48
+ <!--Begin Original Model Card-->
49
+
50
+
51
+ ![image/jpeg](https://cdn-uploads.huggingface.co/production/uploads/63aeda3a2314b93f9e706a68/I6WwY8U7I5V8lc138UmGt.jpeg)
52
+
53
+ # Strand-Rust-Coder-14B-v1
54
+
55
+ ## Overview
56
+
57
+ **Strand-Rust-Coder-14B-v1** is the first domain-specialized Rust language model created through **Fortytwo’s Swarm Inference**, a decentralized AI architecture where multiple models collaboratively generate, validate, and rank outputs through peer consensus.
58
+
59
+ The model fine-tunes **Qwen2.5-Coder-14B** for Rust-specific programming tasks using a **191K-example synthetic dataset** built via multi-model generation and peer-reviewed validation.
60
+ It achieves **43–48% accuracy** on Rust-specific benchmarks – surpassing much larger proprietary models like GPT-5 Codex on Rust tasks – while maintaining competitive general coding performance.
61
+
62
+ [Strand-Rust-Coder-v1: Technical Report](https://huggingface.co/blog/Fortytwo-Network/strand-rust-coder-tech-report)
63
+
64
+ ## Key Features
65
+
66
+ - **Rust-specialized fine-tuning** on 15 diverse programming task categories
67
+ - **Peer-validated synthetic dataset** (191,008 verified examples, 94.3% compile rate)
68
+ - **LoRA-based fine-tuning** for efficient adaptation
69
+ - **Benchmarked across Rust-specific suites:**
70
+ - **RustEvo^2**
71
+ - **Evaluation on Hold-Out Set**
72
+ - **Deployed in the Fortytwo decentralized inference network** for collective AI reasoning
73
+
74
+ ---
75
+
76
+ ## Performance Summary
77
+
78
+ | **Model** | **Hold-Out Set** | **RustEvo^2** |
79
+ |------------|------------------|---------------|
80
+ | **Fortytwo-Rust-One-14B (Ours)** | **48.00%** | **43.00%** |
81
+ | openai/gpt-5-codex | 47.00% | 28.00% |
82
+ | anthropic/claude-sonnet-4.5 | 46.00% | 21.00% |
83
+ | anthropic/claude-3.7-sonnet | 42.00% | 31.00% |
84
+ | qwen/qwen3-max | 42.00% | 40.00% |
85
+ | qwen/qwen3-coder-plus | 41.00% | 22.00% |
86
+ | x-ai/grok-4 | 39.00% | 37.00% |
87
+ | deepseek/deepseek-v3.1-terminus | 37.00% | 33.00% |
88
+ | Qwen3-Coder-30B-A3B-Instruct | 36.00% | 20.00% |
89
+ | openai/gpt-4o-latest | 34.00% | 39.00% |
90
+ | deepseek/deepseek-chat | 34.00% | 41.00% |
91
+ | google/gemini-2.5-flash | 33.00% | 7.00% |
92
+ | Qwen2.5-Coder-14B-Instruct (Base) | 29.00% | 30.00% |
93
+ | Qwen2.5-Coder-32B-Instruct | 29.00% | 31.00% |
94
+ | google/gemini-2.5-pro | 28.00% | 22.00% |
95
+ | qwen/qwen-2.5-72b | 28.00% | 32.00% |
96
+ | Tesslate/Tessa-Rust-T1-7B | 23.00% | 19.00% |
97
+
98
+ *Benchmarks on code tasks measured using unit-test pass rate@1 in Docker-isolated Rust 1.86.0 environment.*
99
+
100
+ ---
101
+
102
+ ## Task Breakdown
103
+
104
+ | Task | Base | Strand-14B |
105
+ |------|------|-------------|
106
+ | test_generation | 0.00 | 0.51 |
107
+ | api_usage_prediction | 0.27 | 0.71 |
108
+ | function_naming | 0.53 | 0.87 |
109
+ | code_refactoring | 0.04 | 0.19–0.20 |
110
+ | variable_naming | 0.87 | 1.00 |
111
+ | code_generation | 0.40 | 0.49 |
112
+
113
+ Largest improvements appear in *test generation*, *API usage prediction*, and *refactoring* – areas demanding strong semantic reasoning about Rust’s ownership and lifetime rules.
114
+
115
+ ---
116
+
117
+ ## Dataset
118
+
119
+ **Fortytwo-Network/Strandset-Rust-v1 (191,008 examples, 15 categories)**
120
+ Built through Fortytwo’s *Swarm Inference* pipeline, where multiple SLMs generate and cross-validate examples with peer review consensus and output aggregation.
121
+
122
+ - 94.3% compile success rate
123
+ - 73.2% consensus acceptance
124
+ - Coverage of 89% of Rust language features
125
+ - Tasks include:
126
+ - `code_generation`, `code_completion`, `bug_detection`, `refactoring`, `optimization`
127
+ - `docstring_generation`, `code_review`, `summarization`, `test_generation`
128
+ - `naming`, `API usage prediction`, `search`
129
+
130
+ Dataset construction involved 2,383 crates from crates.io, automatic compilation tests, and semantic validation of ownership and lifetime correctness.
131
+
132
+ Dataset: [Fortytwo-Network/Strandset-Rust-v1](https://huggingface.co/datasets/Fortytwo-Network/Strandset-Rust-v1)
133
+
134
+ ---
135
+
136
+ ## Training Configuration
137
+
138
+ | Setting | Value |
139
+ |----------|-------|
140
+ | Base model | Qwen2.5-Coder-14B-Instruct |
141
+ | Method | LoRA (r=64, α=16) |
142
+ | Learning rate | 5e-5 |
143
+ | Batch size | 128 |
144
+ | Epochs | 3 |
145
+ | Optimizer | AdamW |
146
+ | Precision | bfloat16 |
147
+ | Objective | Completion-only loss |
148
+ | Context length | 32,768 |
149
+ | Framework | PyTorch + FSDP + Flash Attention 2 |
150
+ | Hardware | 8× H200 GPUs |
151
+
152
+ ---
153
+
154
+ ## Model Architecture
155
+
156
+ - **Base:** Qwen2.5-Coder (14 B parameters, GQA attention, extended RoPE embeddings)
157
+ - **Tokenizer:** 151 k vocabulary optimized for Rust syntax
158
+ - **Context:** 32 k tokens
159
+ - **Fine-tuning:** Parameter-efficient LoRA adapters (≈1% of parameters updated)
160
+ - **Deployment:** Compatible with local deployment and Fortytwo Capsule runtime for distributed swarm inference
161
+
162
+ ---
163
+
164
+ ## Evaluation Protocol
165
+
166
+ - All evaluations executed in Docker-isolated Rust 1.86.0 environment
167
+ - **Code tasks:** measured via unit test pass rate
168
+ - **Documentation & naming tasks:** scored via LLM-based correctness (Claude Sonnet 4 judge)
169
+ - **Code completion & API tasks:** syntax-weighted Levenshtein similarity
170
+ - **Comment generation:** compilation success metric
171
+
172
+ ---
173
+
174
+ ## Why It Matters
175
+
176
+ Rust is a high-safety, low-level language with complex ownership semantics that make it uniquely challenging for general-purpose LLMs.
177
+ At the same time, there is simply **not enough high-quality training data on Rust**, as it remains a relatively modern and rapidly evolving language.
178
+ This scarcity of large, reliable Rust datasets – combined with the language’s intricate borrow checker and type system – makes it an ideal benchmark for evaluating true model understanding and reasoning precision.
179
+
180
+ **Strand-Rust-Coder** demonstrates how **specialized models** can outperform giant centralized models – achieving domain mastery with a fraction of the compute.
181
+ Through **Fortytwo’s Swarm Inference**, the network was able to generate an **extremely accurate synthetic dataset**, enabling a **state-of-the-art Rust model** to be built through an efficient **LoRA fine-tune** rather than full retraining.
182
+
183
+ This work validates Fortytwo’s thesis: **intelligence can scale horizontally through networked specialization rather than centralized scale.**
184
+
185
+ ---
186
+
187
+ ## 🔬 Research & References
188
+
189
+ - [Fortytwo: Swarm Inference with Peer-Ranked Consensus (arXiv)](https://arxiv.org/abs/2510.24801) - *Fortytwo Swarm Inference – Technical Report*
190
+ - [Self-Supervised Inference of Agents in Trustless Environments (arXiv)](https://arxiv.org/abs/2409.08386) – *High-level overview of Fortytwo architecture*
191
+
192
+ ---
193
+
194
+ ## Intended Use
195
+
196
+ - Rust code generation, completion, and documentation
197
+ - Automated refactoring and test generation
198
+ - Integration into code copilots and multi-agent frameworks
199
+ - Research on domain-specialized model training and evaluation
200
+
201
+ ### Limitations
202
+ - May underperform on purely algorithmic or multi-language tasks (e.g., HumanEval-style puzzles).
203
+ - Not suitable for generating unverified production code without compilation and test validation.
204
+
205
+ ---
206
+
207
+ ## Integration with Fortytwo Network
208
+
209
+ Strand-Rust-Coder models are integrated into **Fortytwo’s decentralized Swarm Inference Network**, where specialized models collaborate and rank each other’s outputs.
210
+ This structure enables **peer-reviewed inference**, improving reliability while reducing hallucinations and cost.
211
+
212
+ To run a Fortytwo node or contribute your own models and fine-tunes, visit: [fortytwo.network](https://fortytwo.network)
213
+
214
+ ---
215
+
216
+ ## Inference Examples
217
+
218
+ ### Using `pipeline`
219
+
220
+ ```python
221
+ from transformers import pipeline
222
+
223
+ pipe = pipeline("text-generation", model="Fortytwo-Network/Strand-Rust-Coder-14B-v1")
224
+ messages = [
225
+ {"role": "user", "content": "Write a Rust function that finds the first string longer than 10 characters in a vector."},
226
+ ]
227
+ pipe(messages)
228
+ ```
229
+
230
+ ### Using Transformers Directly
231
+
232
+ ```python
233
+ # Load model directly
234
+ from transformers import AutoTokenizer, AutoModelForCausalLM
235
+
236
+ tokenizer = AutoTokenizer.from_pretrained("Fortytwo-Network/Strand-Rust-Coder-14B-v1")
237
+ model = AutoModelForCausalLM.from_pretrained("Fortytwo-Network/Strand-Rust-Coder-14B-v1")
238
+
239
+ messages = [
240
+ {"role": "user", "content": "Write a Rust function that finds the first string longer than 10 characters in a vector."},
241
+ ]
242
+
243
+ inputs = tokenizer.apply_chat_template(
244
+ messages,
245
+ add_generation_prompt=True,
246
+ tokenize=True,
247
+ return_dict=True,
248
+ return_tensors="pt",
249
+ ).to(model.device)
250
+
251
+ outputs = model.generate(**inputs, max_new_tokens=40)
252
+ print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))
253
+ ```
254
+
255
+ ---
256
+
257
+ ## Quantized Versions
258
+
259
+ Optimized GGUF quantizations of **Strand-Rust-Coder-14B-v1** are available for local and Fortytwo Node deployment, offering reduced memory footprint with minimal performance trade-off.
260
+
261
+ These builds are compatible with **llama.cpp**, **Jan**, **LM Studio**, **Ollama**, and other runtimes supporting the GGUF format.
262
+
263
+ | **Quantization** | **Size** | **Bit Precision** | **Description** |
264
+ |------------------|-----------|------------------|----------------|
265
+ | **Q8_0** | 15.7 GB | **8-bit** | Near-full precision, for most demanding local inference |
266
+ | **Q6_K** | 12.1 GB | **6-bit** | Balanced performance and efficiency |
267
+ | **Q5_K_M** | 10.5 GB | **5-bit** | Lightweight deployment with strong accuracy retention |
268
+ | **Q4_K_M** | 8.99 GB | **4-bit** | Ultra-fast, compact variant for consumer GPUs and laptops |
269
+
270
+ Quant versions: [Fortytwo-Network/Strand-Rust-Coder-14B-v1-GGUF](https://huggingface.co/Fortytwo-Network/Strand-Rust-Coder-14B-v1-GGUF)
271
+
272
+ ---
273
+
274
+ **Fortytwo – An open, networked intelligence shaped collectively by its participants**
275
+
276
+ Join the swarm: [fortytwo.network](https://fortytwo.network)
277
+
278
+ X: [@fortytwo](https://x.com/fortytwo)
279
+
280
+ <!--End Original Model Card-->
281
+
282
+ ---
283
+
284
+ # <span id="testllm" style="color: #7F7FFF;">🚀 If you find these models useful</span>
285
+
286
+ Help me test my **AI-Powered Quantum Network Monitor Assistant** with **quantum-ready security checks**:
287
+
288
+ 👉 [Quantum Network Monitor](https://readyforquantum.com/?assistant=open&utm_source=huggingface&utm_medium=referral&utm_campaign=huggingface_repo_readme)
289
+
290
+
291
+ The full Open Source Code for the Quantum Network Monitor Service available at my github repos ( repos with NetworkMonitor in the name) : [Source Code Quantum Network Monitor](https://github.com/Mungert69). You will also find the code I use to quantize the models if you want to do it yourself [GGUFModelBuilder](https://github.com/Mungert69/GGUFModelBuilder)
292
+
293
+ 💬 **How to test**:
294
+ Choose an **AI assistant type**:
295
+ - `TurboLLM` (GPT-4.1-mini)
296
+ - `HugLLM` (Hugginface Open-source models)
297
+ - `TestLLM` (Experimental CPU-only)
298
+
299
+ ### **What I’m Testing**
300
+ I’m pushing the limits of **small open-source models for AI network monitoring**, specifically:
301
+ - **Function calling** against live network services
302
+ - **How small can a model go** while still handling:
303
+ - Automated **Nmap security scans**
304
+ - **Quantum-readiness checks**
305
+ - **Network Monitoring tasks**
306
+
307
+ 🟡 **TestLLM** – Current experimental model (llama.cpp on 2 CPU threads on huggingface docker space):
308
+ - ✅ **Zero-configuration setup**
309
+ - ⏳ 30s load time (slow inference but **no API costs**) . No token limited as the cost is low.
310
+ - 🔧 **Help wanted!** If you’re into **edge-device AI**, let’s collaborate!
311
+
312
+ ### **Other Assistants**
313
+ 🟢 **TurboLLM** – Uses **gpt-4.1-mini** :
314
+ - **It performs very well but unfortunatly OpenAI charges per token. For this reason tokens usage is limited.
315
+ - **Create custom cmd processors to run .net code on Quantum Network Monitor Agents**
316
+ - **Real-time network diagnostics and monitoring**
317
+ - **Security Audits**
318
+ - **Penetration testing** (Nmap/Metasploit)
319
+
320
+ 🔵 **HugLLM** – Latest Open-source models:
321
+ - 🌐 Runs on Hugging Face Inference API. Performs pretty well using the lastest models hosted on Novita.
322
+
323
+ ### 💡 **Example commands you could test**:
324
+ 1. `"Give me info on my websites SSL certificate"`
325
+ 2. `"Check if my server is using quantum safe encyption for communication"`
326
+ 3. `"Run a comprehensive security audit on my server"`
327
+ 4. '"Create a cmd processor to .. (what ever you want)" Note you need to install a [Quantum Network Monitor Agent](https://readyforquantum.com/Download/?utm_source=huggingface&utm_medium=referral&utm_campaign=huggingface_repo_readme) to run the .net code on. This is a very flexible and powerful feature. Use with caution!
328
+
329
+ ### Final Word
330
+
331
+ I fund the servers used to create these model files, run the Quantum Network Monitor service, and pay for inference from Novita and OpenAI—all out of my own pocket. All the code behind the model creation and the Quantum Network Monitor project is [open source](https://github.com/Mungert69). Feel free to use whatever you find helpful.
332
+
333
+ If you appreciate the work, please consider [buying me a coffee](https://www.buymeacoffee.com/mahadeva) ☕. Your support helps cover service costs and allows me to raise token limits for everyone.
334
+
335
+ I'm also open to job opportunities or sponsorship.
336
+
337
+ Thank you! 😊