vincespeed commited on
Commit
ae69a1e
Β·
verified Β·
1 Parent(s): c545a1f

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +168 -0
README.md CHANGED
@@ -1,3 +1,171 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: mit
3
  ---
 
1
+ # Ling-3.0 Tiny β€” Apex Quant GGUF Models
2
+
3
+ This repository contains 4 quantized GGUF profiles of the **inclusionAI/Ling-3.0-tiny** model, produced using Apex-Quant technology.
4
+
5
+ ## πŸ“¦ Model Profile Summary
6
+
7
+ | Profile | Size | BPW | Use Case |
8
+ |---------|------|-----|----------|
9
+ | **i-quality** | 5.4 GB | 5.83 | Highest quality, production environments |
10
+ | **i-balanced** | 5.6 GB | 6.02 | Balanced quality and performance |
11
+ | **i-compact** | 3.7 GB | 4.03 | Compact deployment, low RAM |
12
+ | **i-mini** | β€” | β€” | ⚠️ Requires `imatrix`, not yet quantized |
13
+
14
+ > **BPW** = Bits Per Weight. Higher value = better quality.
15
+
16
+ ## πŸ“ File Structure
17
+
18
+ ```
19
+ models/
20
+ β”œβ”€β”€ Ling-3.0-tiny-i-quality.gguf # 5.4 GB β€” Highest quality
21
+ β”œβ”€β”€ Ling-3.0-tiny-i-balanced.gguf # 5.6 GB β€” Balanced
22
+ └── Ling-3.0-tiny-i-compact.gguf # 3.7 GB β€” Compact
23
+ ```
24
+
25
+ ## πŸ”— Source Model
26
+
27
+ These models were created based on the **inclusionAI/Ling-3.0-tiny** model from HuggingFace.
28
+
29
+ - **Model Page:** https://huggingface.co/inclusionAI/Ling-3.0-tiny
30
+ - **Architecture:** BailingMoeV3ForCausalLM (Mixture-of-Experts)
31
+ - **Parameter Count:** 128Γ—1.0B (128 experts, each with 1B parameters)
32
+ - **Context Length:** 131,072 tokens
33
+ - **Vocabulary:** 157,184 tokens
34
+ - **License:** MIT
35
+
36
+ ## πŸ› οΈ Technology
37
+
38
+ These quantized models were produced using **Apex-Quant** technology.
39
+
40
+ - **Apex-Quant:** MoE-aware mixed-precision quantization
41
+ - **Infrastructure:** llama.cpp (`llama-quantize`)
42
+ - **Quantize Script:** `apex-quant/scripts/quantize.sh`
43
+
44
+ ## πŸ™ Acknowledgments
45
+
46
+ - **[localai-org/apex-quant](https://github.com/localai-org/apex-quant)** β€” Apex-Quant MoE-aware mixed-precision quantization framework
47
+ - **[ggerganov/llama.cpp](https://github.com/ggerganov/llama.cpp)** β€” GGUF format and quantization engine
48
+ - **[inclusionAI](https://huggingface.co/inclusionAI)** β€” Original Ling-3.0-tiny model creators
49
+
50
+ ## πŸ“‹ Technical Details
51
+
52
+ ### Architecture Information
53
+ - **Architecture:** `bailingmoe3`
54
+ - **Block Count:** 24 layers
55
+ - **Expert Count:** 128 experts
56
+ - **Expert Used Count:** 8 experts/token
57
+ - **Expert Group Count:** 8
58
+ - **Expert Group Used Count:** 4
59
+ - **Expert Gating Function:** Top-K (k=8)
60
+ - **Hidden Size:** 1,536
61
+ - **Feed Forward Size:** 4,608
62
+ - **Attention Heads:** 16
63
+ - **Attention Head Count KV:** [0, 0, 0, 1, ...] (grouped query attention)
64
+ - **Rope Frequency Base:** 6,000,000
65
+ - **Layer Norm Epsilon:** 1e-6
66
+
67
+ ### Quantize Profile Details
68
+
69
+ #### i-quality (Q6_K/Q5_K/IQ4_XS)
70
+ - **Expert FFN:** Q6_K / Q5_K / IQ4_XS (mixed)
71
+ - **Shared FFN:** Q8_0
72
+ - **Attention:** Q6_K
73
+ - **BPW:** 5.83
74
+ - **File Size:** 5.4 GB
75
+
76
+ #### i-balanced (Q6_K/Q5_K)
77
+ - **Expert FFN:** Q6_K / Q5_K (mixed)
78
+ - **Shared FFN:** Q8_0
79
+ - **Attention:** Q6_K
80
+ - **BPW:** 6.02
81
+ - **File Size:** 5.6 GB
82
+
83
+ #### i-compact (Q4_K/Q3_K)
84
+ - **Expert FFN:** Q4_K / Q3_K (mixed)
85
+ - **Shared FFN:** Q6_K
86
+ - **Attention:** Q4_K
87
+ - **BPW:** 4.03
88
+ - **File Size:** 3.7 GB
89
+
90
+ #### i-mini (Q3_K/IQ2_S) β€” ⚠️ Not Quantized
91
+ - **Expert FFN:** Q3_K / IQ2_S (mixed)
92
+ - **Shared FFN:** Q5_K / Q4_K
93
+ - **Attention:** Q4_K / Q3_K
94
+ - **BPW:** ~3.5 (estimated)
95
+ - **Status:** Requires `imatrix` (importance matrix). Inference must be run on the model to generate the importance matrix before quantization.
96
+
97
+ ## πŸ’» Usage
98
+
99
+ ### With llama.cpp
100
+
101
+ ```bash
102
+ # Run with i-quality profile
103
+ ./main -m models/Ling-3.0-tiny-i-quality.gguf -n 128 -p "Hello, how are you?"
104
+
105
+ # Run with i-compact profile
106
+ ./main -m models/Ling-3.0-tiny-i-compact.gguf -n 128 -p "Hello, how are you?"
107
+ ```
108
+
109
+ ### With Ollama
110
+
111
+ ```bash
112
+ # Create Dockerfile or Ollamafile
113
+ FROM llama.cpp
114
+ COPY models/Ling-3.0-tiny-i-quality.gguf /model.gguf
115
+ ```
116
+
117
+ ### With Python (llama-cpp-python)
118
+
119
+ ```python
120
+ from llama_cpp import Llama
121
+
122
+ llm = Llama(
123
+ model_path="models/Ling-3.0-tiny-i-quality.gguf",
124
+ n_ctx=4096,
125
+ n_threads=8
126
+ )
127
+
128
+ output = llm(
129
+ "Hello, how are you?",
130
+ max_tokens=128
131
+ )
132
+ print(output["choices"][0]["text"])
133
+ ```
134
+
135
+ ## πŸ“Š Model Comparison
136
+
137
+ | Criterion | i-quality | i-balanced | i-compact |
138
+ |-----------|-----------|------------|-----------|
139
+ | **Quality** | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐⭐ |
140
+ | **Speed** | ⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐⭐⭐⭐ |
141
+ | **RAM** | High | Medium | Low |
142
+ | **Size** | 5.4 GB | 5.6 GB | 3.7 GB |
143
+ | **BPW** | 5.83 | 6.02 | 4.03 |
144
+
145
+ ## πŸ“ Notes
146
+
147
+ - All models are in **GGUF v3** format.
148
+ - The **BailingMoeV3** architecture uses Mixture-of-Experts (MoE) technology.
149
+ - The model uses **grouped query attention (GQA)** and **rope** positional embeddings.
150
+ - The `i-mini` profile cannot be quantized without `imatrix`. ~100-200 inference samples must be run on the model to generate the importance matrix.
151
+
152
+ ## πŸ“„ License
153
+
154
+ The original model is distributed under the **MIT** license. The quantized models are shared under the same license.
155
+
156
+ ## πŸ”— Related Links
157
+
158
+ - **Original Model:** https://huggingface.co/inclusionAI/Ling-3.0-tiny
159
+ - **Apex-Quant:** https://github.com/localai-org/apex-quant
160
+ - **llama.cpp:** https://github.com/ggerganov/llama.cpp
161
+ - **GGUF Format:** https://github.com/ggerganov/ggml/blob/master/docs/gguf.md
162
+
163
+ ---
164
+
165
+ **Note:** These models are quantized for local use. Check the original model's license for commercial use.
166
+
167
+
168
+
169
  ---
170
  license: mit
171
  ---