Views
No views yet


llama.cpp. Unlike auto-generated quants, these weights have been tested against WikiText-2 to ensure the best balance between speed and accuracy.llama.cpp on a standard CPU setup.| Model Version | Size | Perplexity (PPL) | Quality Loss | Gen Speed (CPU) | Memory Usage |
|---|---|---|---|---|---|
| F16 (Original) | 2.30 GB | 13.99 | Baseline | 15.73 t/s | ~2.4 GB |
| Q8_0 | 1.22 GB | 14.01 | ~0.1% (Negligible) | 28.43 t/s | ~1.3 GB |
| Q4_K_M | 762 MB | 14.49 | ~3.5% (Acceptable) | 42.60 t/s 🚀 | ~640 MB |
Conclusion: The Q4_K_M model offers the best trade-off, running 2.7x faster than the original with minimal quality loss.
| Filename | Description | Use Case |
|---|---|---|
llama-3.2-1b-q4_k_m.gguf | 🏆 Recommended. Balanced speed & accuracy. | Chatbots, Android/iOS Apps, RAG |
llama-3.2-1b-q8_0.gguf | High precision, larger size. | Research, Creative Writing |
llama-3.2-1b-f16.gguf | Uncompressed weights. | Fine-Tuning, Conversion |
1# pip install llama-cpp-python huggingface_hub
2
3from huggingface_hub import hf_hub_download
4from llama_cpp import Llama
5
6model_path = hf_hub_download(
7 repo_id="Habibur2/Llama-3.2-1B-Instruct-GGUF",
8 filename="llama-3.2-1b-q4_k_m.gguf"
9)
10
11llm = Llama(
12 model_path=model_path,
13 n_ctx=2048,
14 verbose=False
15)
16
17response = llm.create_chat_completion(
18 messages=[{"role": "user", "content": "Hello! Explain AI in one sentence."}]
19)
20print(response['choices'][0]['message']['content'])
21
22llama.cpp (CPU Backend). The results show that quantization has negligible impact on model quality while significantly reducing memory usage.| Model Version | VRAM/RAM Usage | Perplexity (Lower is Better) | Accuracy Loss |
|---|---|---|---|
| F16 (Original) | 2,357 MB | 13.99 | Baseline (0%) |
| Q8_0 | 1,252 MB | 14.01 | +0.01 (Negligible) |
Analysis: The Q8_0 version retains 99.99% of the original model's performance while using 47% less memory.
llama.cpp. Unlike auto-generated quants, these weights have been manually benchmarked to ensure the best balance between speed and accuracy.llama.cpp on a standard CPU setup (8 threads).| Quantization | Size (MB) | Compression | Perplexity (PPL) | Speed (CPU) | Recommended For |
|---|---|---|---|---|---|
| F16 (Original) | 2,300 MB | 0% | Baseline | 15.73 t/s | Research / GPU |
| Q8_0 | 1,220 MB | 47% | Low Loss | 28.43 t/s | High Accuracy Needs |
| Q4_K_M | 762 MB | 68% | Balanced | 42.60 t/s 🚀 | Edge / Real-time Chat |
Note: Speed may vary depending on your hardware. GPU offloading will significantly increase these numbers.
| Filename | Description |
|---|---|
llama-3.2-1b-q4_k_m.gguf | 🏆 Best Choice. High speed, low memory, negligible quality loss. |
llama-3.2-1b-q8_0.gguf | Near-original quality. Use if you have 4GB+ RAM. |
llama-3.2-1b-f16.gguf | Uncompressed weights. Use for further conversion or research. |
1git clone https://github.com/ggml-org/llama.cpp.git
2./llama-cli -m llama-3.2-1b-q4_k_m.gguf -cnv -p "You are a helpful assistant."
from llama_cpp import Llama
llm = Llama(
model_path="./llama-3.2-1b-q4_k_m.gguf",
chat_format="llama-3",
n_gpu_layers=-1 # Set to 0 if no GPU
)
response = llm.create_chat_completion(
messages=[{"role": "user", "content": "Hello, explain Quantum Physics in simple terms."}]
)
print(response['choices'][0]['message']['content'])