CoolFace
Modelpublic

BachDaThan/Qwen3-30B-A3B-Vietnamese-Instruct-GGUF

sourceHugging Faceapache-2.0updated 20d agoView on Hugging Face
0likes115downloads
Model Card

🇻🇳 Qwen3-30B-A3B Vietnamese Instruct — GGUF Q4KM

<div align="center">

Vietnamese-optimized Qwen3 MoE model, LoRA merged and quantized to GGUF Q4KM.

![Base Model](https://huggingface.co/Qwen/Qwen3-30B-A3B) ![LoRA](https://huggingface.co/danghuyhoang/qwen3-30b-vietnamese-instruct) ![Format]() ![License](https://www.apache.org/licenses/LICENSE-2.0)

</div>


🌍 English Summary

A Vietnamese-optimized Qwen3-30B-A3B model merged with a Vietnamese instruction-tuning LoRA, then quantized to GGUF Q4KM format (~18.6 GB). This model is designed to run efficiently on consumer hardware: - NVIDIA RTX 3060 12GB or better with GPU offload - Apple Silicon M1/M2/M3/M4 with 24GB+ unified memory - CPU-only systems with 24GB+ RAM ### Key Features | Feature | Details | |---|---| | Architecture | Qwen3 Mixture-of-Experts, ~30.5B total parameters | | Active Parameters | ~3.3B parameters per token | | Primary Language | Vietnamese, also supports English and many other languages | | Thinking Mode | Supports <think>...</think> reasoning blocks | | Context Length | 32,768 tokens native, extendable with YaRN | | Quantization | GGUF Q4KM | | File Size | Approximately 18.6 GB | | License | Apache 2.0 | ### Hardware Requirements | Setup | Minimum / Recommended | |---|---| | CPU only | 24 GB RAM, 20 GB free disk | | GPU offload | RTX 3060 12GB+ or RTX 4060 Ti 16GB | | Apple Silicon | M1 Pro / M2 / M3 / M4 with 24GB+ unified memory | ### Quick Start with llama.cpp ``bash wget https://huggingface.co/BachDaThan/Qwen3-30B-A3B-Vietnamese-Instruct-GGUF/resolve/main/Qwen3-30B-A3B-Vietnamese-Instruct-Q4_K_M.gguf ./llama-cli -m Qwen3-30B-A3B-Vietnamese-Instruct-Q4_K_M.gguf -c 8192 -ngl 99 --chat-template chatml ` ### Quick Start with Ollama `bash cat > Modelfile << 'EOF' FROM ./Qwen3-30B-A3B-Vietnamese-Instruct-Q4_K_M.gguf TEMPLATE """{{ if .System }}<|im_start|>system {{ .System }}<|im_end|> {{ end }} <|im_start|>user {{ .Prompt }}<|im_end|> <|im_start|>assistant """ SYSTEM "Bạn là trợ lý AI thông minh và hữu ích, trả lời bằng tiếng Việt." PARAMETER temperature 0.6 PARAMETER top_p 0.95 PARAMETER top_k 20 PARAMETER repeat_penalty 1.1 PARAMETER num_ctx 8192 EOF ollama create qwen3-viet -f Modelfile ollama run qwen3-viet `` ### Recommended Sampling Parameters | Parameter | Value | |---|---| | temperature | 0.6 | | topp | 0.95 | | topk | 20 | | repeat_penalty | 1.1 | | context length | 8192 or higher if supported |

🇻🇳 Tiếng Việt — Tài liệu đầy đủ

Đây là phiên bản GGUF Q4_K_M của model Qwen3-30B-A3B đã được tối ưu cho tiếng Việt bằng LoRA. LoRA được merge vào base model, sau đó chuyển sang GGUF và quantize để chạy trên máy cá nhân.

Điểm nổi bật

Tính năngChi tiết
Kiến trúcMixture-of-Experts, chỉ kích hoạt khoảng 3.3B params mỗi token
Ngôn ngữ chínhTiếng Việt, đồng thời hỗ trợ tiếng Anh và nhiều ngôn ngữ khác
Thinking ModeHỗ trợ suy luận với <think>...</think>
Context32,768 tokens mặc định
Định dạngGGUF Q4KM
Kích thướcKhoảng 18.6 GB
Phù hợpCPU, GPU consumer, Apple Silicon

🏗️ Thông số kiến trúc

Thông sốGiá trị
Kiến trúcQwen3 MoE Transformer
Tổng tham số~30.5B
Tham số kích hoạt mỗi token~3.3B
Số layers48
Hidden size2048
Attention heads32
KV heads4
Head dim128
Tổng số experts128
Experts kích hoạt mỗi token8
Vocabulary size151,936
Context mặc định32,768 tokens
Precision gốcBFloat16

📦 Chi tiết Quantization

Thuộc tínhGiá trị
Định dạngGGUF
QuantizationQ4KM
Kích thước ước tính~18.6 GB
Kích thước gốc BF16~61 GB
Công cụllama.cpp
Quy trìnhHF BF16 → GGUF F16 → GGUF Q4KM

So sánh các mức quantize

QuantKích thướcRAM/VRAM đề xuấtChất lượng
Q3KM~15 GB~18 GBKhá
Q4KM~18.6 GB~21 GBTốt, cân bằng nhất
Q5KM~22 GB~25 GBRất tốt
Q6_K~25 GB~28 GBRất gần bản gốc
Q8_0~33 GB~36 GBGần BF16 nhất

💻 Yêu cầu phần cứng

CPU only

Thành phầnYêu cầu
RAM24 GB trở lên
Ổ cứng20 GB trống
OSLinux, macOS, Windows

GPU offload

Thành phầnYêu cầu
GPURTX 3060 12GB trở lên
RAM16 GB trở lên
Ổ cứngSSD 20 GB trống

Apple Silicon

Thành phầnYêu cầu
ChipM1 Pro, M2, M3, M4 hoặc mới hơn
Unified Memory24 GB trở lên, khuyến nghị 32 GB

🚀 Hướng dẫn sử dụng

1. llama.cpp

bash
wget https://huggingface.co/BachDaThan/Qwen3-30B-A3B-Vietnamese-Instruct-GGUF/resolve/main/Qwen3-30B-A3B-Vietnamese-Instruct-Q4_K_M.gguf

./llama-cli -m Qwen3-30B-A3B-Vietnamese-Instruct-Q4_K_M.gguf -c 8192 -ngl 99 --chat-template chatml

Chạy server API tương thích OpenAI:

bash
./llama-server -m Qwen3-30B-A3B-Vietnamese-Instruct-Q4_K_M.gguf -c 8192 -ngl 99 --host 0.0.0.0 --port 8080

2. Ollama

bash
cat > Modelfile << 'EOF'
FROM ./Qwen3-30B-A3B-Vietnamese-Instruct-Q4_K_M.gguf

TEMPLATE """{{ if .System }}<|im_start|>system
{{ .System }}<|im_end|>
{{ end }}
<|im_start|>user
{{ .Prompt }}<|im_end|>
<|im_start|>assistant
"""

SYSTEM "Bạn là trợ lý AI thông minh và hữu ích, trả lời bằng tiếng Việt."

PARAMETER temperature 0.6
PARAMETER top_p 0.95
PARAMETER top_k 20
PARAMETER repeat_penalty 1.1
PARAMETER num_ctx 8192
EOF

ollama create qwen3-viet -f Modelfile
ollama run qwen3-viet

3. LM Studio

  1. 1.Mở LM Studio.
  2. 2.Import file Qwen3-30B-A3B-Vietnamese-Instruct-Q4_K_M.gguf.
  3. 3.Load model.
  4. 4.Cấu hình khuyến nghị:
  5. 5.Temperature: 0.6
  6. 6.Top P: 0.95
  7. 7.Top K: 20
  8. 8.Repeat penalty: 1.1
  9. 9.Context: 8192
  10. 10.GPU layers: tối đa nếu có GPU

4. Python với llama-cpp-python

python
from llama_cpp import Llama

llm = Llama(
    model_path="./Qwen3-30B-A3B-Vietnamese-Instruct-Q4_K_M.gguf",
    n_ctx=8192,
    n_gpu_layers=-1,
    verbose=False,
)

response = llm.create_chat_completion(
    messages=[
        {"role": "system", "content": "Bạn là trợ lý AI thông minh, trả lời bằng tiếng Việt."},
        {"role": "user", "content": "Giải thích machine learning cho học sinh cấp 3."},
    ],
    temperature=0.6,
    top_p=0.95,
    top_k=20,
    repeat_penalty=1.1,
    max_tokens=2048,
)

print(response["choices"][0]["message"]["content"])

🧠 Thinking Mode

Qwen3 hỗ trợ hai chế độ:

Thinking Mode

Phù hợp cho toán học, lập trình, suy luận phức tạp. Model có thể tạo khối suy luận:

text
<think>
...
</think>

Khuyến nghị:

text
temperature = 0.6
top_p = 0.95
top_k = 20

Non-thinking Mode

Phù hợp cho chat nhanh, hội thoại thông thường.

Khuyến nghị:

text
temperature = 0.7
top_p = 0.8
top_k = 20

🔧 Quy trình build

text
1. Tải base model Qwen3-30B-A3B BF16
2. Tải Vietnamese LoRA adapter
3. Merge LoRA vào base model trên CPU
4. Lưu merged model dạng safetensors
5. Convert HF sang GGUF F16 bằng llama.cpp
6. Quantize F16 sang Q4_K_M bằng llama-quantize
7. Upload GGUF và README lên Hugging Face
8. Dọn dẹp file tạm

Toàn bộ pipeline được thiết kế để chạy bằng CPU trong Hugging Face Space.


⚠️ Hạn chế

  1. 1.Model được tối ưu cho tiếng Việt, có thể giảm hiệu năng ở ngôn ngữ khác.
  2. 2.Quantization Q4KM có thể giảm chất lượng nhẹ so với BF16 gốc.
  3. 3.Có thể xảy ra hallucination.
  4. 4.Không nên dùng cho tư vấn y tế, pháp lý, tài chính quan trọng mà không có chuyên gia kiểm duyệt.
  5. 5.Với ngữ cảnh rất dài, chất lượng có thể giảm nếu vượt quá độ dài huấn luyện hiệu dụng.

📖 Citation

bibtex
@software{qwen3_vietnamese_gguf_2026,
  title = {Qwen3-30B-A3B Vietnamese Instruct GGUF},
  author = {BachDaThan},
  year = {2026},
  url = {https://huggingface.co/BachDaThan/Qwen3-30B-A3B-Vietnamese-Instruct-GGUF},
  license = {Apache-2.0}
}

🙏 Credits

Thành phầnCredit
Base modelQwen Team / Alibaba Cloud
Vietnamese LoRAVietnamese LLM community
GGUF toolsllama.cpp contributors
Build and uploadBachDaThan

<div align="center">

If this model is useful, please consider leaving a like on the Hugging Face repository.

Nếu model này hữu ích, hãy thả tim repo trên Hugging Face nhé!

</div>