Views
No views yet
convert_hf_to_gguf.py (from llama.cpp)llama-quantize| Quantization | Filename | Size (GiB) | Notes |
|---|---|---|---|
| FP16 | Qwen3-4B-SafeRL-FP16.gguf | ~8.05 | Full precision (baseline) |
| Q2_K | Qwen3-4B-SafeRL-Q2_K.gguf | ~1.67 | Smallest, lowest accuracy |
| Q3_K_M | Qwen3-4B-SafeRL-Q3_K_M.gguf | ~2.08 | Balanced small size |
| Q4_0 | Qwen3-4B-SafeRL-Q4_0.gguf | ~2.37 | Good balance, faster |
| Q4_K_M | Qwen3-4B-SafeRL-Q4_K_M.gguf | ~2.50 | Standard, widely used |
| Q5_K_M | Qwen3-4B-SafeRL-Q5_K_M.gguf | ~2.89 | Better accuracy |
| Q6_K | Qwen3-4B-SafeRL-Q6_K.gguf | ~3.31 | High accuracy |
| Q8_0 | Qwen3-4B-SafeRL-Q8_0.gguf | ~4.28 | Near FP16 quality |
./main -m Qwen3-4B-SafeRL-Q4_K_M.gguf -p "Hello, SafeRL!"1from huggingface_hub import hf_hub_download
2from llama_cpp import Llama
3
4model_path = hf_hub_download(
5 repo_id="YOUR_USERNAME/Qwen3-4B-SafeRL-GGUF",
6 filename="Qwen3-4B-SafeRL-Q4_K_M.gguf"
7)
8
9llm = Llama(model_path=model_path)
10
11output = llm.create_chat_completion(
12 messages=[
13 {"role": "system", "content": "You are a safe RL assistant."},
14 {"role": "user", "content": "Hello, SafeRL!"}
15 ],
16 max_tokens=100
17)
18
19print(output["choices"][0]["message"]["content"])llama.cpp, Ollama, and LM Studio.