File size: 4,939 Bytes
1730175
 
4e6c9d4
 
 
761a095
 
 
 
1730175
ae69a1e
 
25d7d8a
ae69a1e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
761a095
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
---
license: mit
base_model: inclusionAI/Ling-3.0-tiny
base_model_relation: quantized
tags:
- gguf
- moe
- bailingmoe3
pipeline_tag: text-generation
---
# Ling-3.0 Tiny β€” Apex Quant GGUF Models

This repository contains 3 quantized GGUF profiles of the **inclusionAI/Ling-3.0-tiny** model, produced using Apex-Quant technology.

## πŸ“¦ Model Profile Summary

| Profile | Size | BPW | Use Case |
|---------|------|-----|----------|
| **i-quality** | 5.4 GB | 5.83 | Highest quality, production environments |
| **i-balanced** | 5.6 GB | 6.02 | Balanced quality and performance |
| **i-compact** | 3.7 GB | 4.03 | Compact deployment, low RAM |

> **BPW** = Bits Per Weight. Higher value = better quality.

## πŸ“ File Structure

```
models/
β”œβ”€β”€ Ling-3.0-tiny-i-quality.gguf   # 5.4 GB β€” Highest quality
β”œβ”€β”€ Ling-3.0-tiny-i-balanced.gguf  # 5.6 GB β€” Balanced
└── Ling-3.0-tiny-i-compact.gguf   # 3.7 GB β€” Compact
```

## πŸ”— Source Model

These models were created based on the **inclusionAI/Ling-3.0-tiny** model from HuggingFace.

- **Model Page:** https://huggingface.co/inclusionAI/Ling-3.0-tiny
- **Architecture:** BailingMoeV3ForCausalLM (Mixture-of-Experts)
- **Parameter Count:** 128Γ—1.0B (128 experts, each with 1B parameters)
- **Context Length:** 131,072 tokens
- **Vocabulary:** 157,184 tokens
- **License:** MIT

## πŸ› οΈ Technology

These quantized models were produced using **Apex-Quant** technology.

- **Apex-Quant:** MoE-aware mixed-precision quantization
- **Infrastructure:** llama.cpp (`llama-quantize`)
- **Quantize Script:** `apex-quant/scripts/quantize.sh`

## πŸ™ Acknowledgments

- **[localai-org/apex-quant](https://github.com/localai-org/apex-quant)** β€” Apex-Quant MoE-aware mixed-precision quantization framework
- **[ggerganov/llama.cpp](https://github.com/ggerganov/llama.cpp)** β€” GGUF format and quantization engine
- **[inclusionAI](https://huggingface.co/inclusionAI)** β€” Original Ling-3.0-tiny model creators

## πŸ“‹ Technical Details

### Architecture Information
- **Architecture:** `bailingmoe3`
- **Block Count:** 24 layers
- **Expert Count:** 128 experts
- **Expert Used Count:** 8 experts/token
- **Expert Group Count:** 8
- **Expert Group Used Count:** 4
- **Expert Gating Function:** Top-K (k=8)
- **Hidden Size:** 1,536
- **Feed Forward Size:** 4,608
- **Attention Heads:** 16
- **Attention Head Count KV:** [0, 0, 0, 1, ...] (grouped query attention)
- **Rope Frequency Base:** 6,000,000
- **Layer Norm Epsilon:** 1e-6

### Quantize Profile Details

#### i-quality (Q6_K/Q5_K/IQ4_XS)
- **Expert FFN:** Q6_K / Q5_K / IQ4_XS (mixed)
- **Shared FFN:** Q8_0
- **Attention:** Q6_K
- **BPW:** 5.83
- **File Size:** 5.4 GB

#### i-balanced (Q6_K/Q5_K)
- **Expert FFN:** Q6_K / Q5_K (mixed)
- **Shared FFN:** Q8_0
- **Attention:** Q6_K
- **BPW:** 6.02
- **File Size:** 5.6 GB

#### i-compact (Q4_K/Q3_K)
- **Expert FFN:** Q4_K / Q3_K (mixed)
- **Shared FFN:** Q6_K
- **Attention:** Q4_K
- **BPW:** 4.03
- **File Size:** 3.7 GB

## πŸ’» Usage

### With llama.cpp

```bash
# Run with i-quality profile
./main -m models/Ling-3.0-tiny-i-quality.gguf -n 128 -p "Hello, how are you?"

# Run with i-compact profile
./main -m models/Ling-3.0-tiny-i-compact.gguf -n 128 -p "Hello, how are you?"
```

### With Ollama

```bash
# Create Dockerfile or Ollamafile
FROM llama.cpp
COPY models/Ling-3.0-tiny-i-quality.gguf /model.gguf
```

### With Python (llama-cpp-python)

```python
from llama_cpp import Llama

llm = Llama(
    model_path="models/Ling-3.0-tiny-i-quality.gguf",
    n_ctx=4096,
    n_threads=8
)

output = llm(
    "Hello, how are you?",
    max_tokens=128
)
print(output["choices"][0]["text"])
```

## πŸ“Š Model Comparison

| Criterion | i-quality | i-balanced | i-compact |
|-----------|-----------|------------|-----------|
| **Quality** | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐⭐ |
| **Speed** | ⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐⭐⭐⭐ |
| **RAM** | High | Medium | Low |
| **Size** | 5.4 GB | 5.6 GB | 3.7 GB |
| **BPW** | 5.83 | 6.02 | 4.03 |

## πŸ“ Notes

- All models are in **GGUF v3** format.
- The **BailingMoeV3** architecture uses Mixture-of-Experts (MoE) technology.
- The model uses **grouped query attention (GQA)** and **rope** positional embeddings.
- The `i-mini` profile cannot be quantized without `imatrix`. ~100-200 inference samples must be run on the model to generate the importance matrix.

## πŸ“„ License

The original model is distributed under the **MIT** license. The quantized models are shared under the same license.

## πŸ”— Related Links

- **Original Model:** https://huggingface.co/inclusionAI/Ling-3.0-tiny
- **Apex-Quant:** https://github.com/localai-org/apex-quant
- **llama.cpp:** https://github.com/ggerganov/llama.cpp
- **GGUF Format:** https://github.com/ggerganov/ggml/blob/master/docs/gguf.md

---

**Note:** These models are quantized for local use. Check the original model's license for commercial use.