CoolFace
Modelpublic

ShahzebKhoso/Qwen3-4B-SafeRL-GGUF

sourceHugging Faceapache-2.0updated 1y agoView on Hugging Face
0likes131downloads
Model Card

Qwen3-4B-SafeRL - GGUF Quantized Versions

This repository provides GGUF quantized versions of Qwen/Qwen3-4B-SafeRL, converted with llama.cpp.

The base model was first exported from Hugging Face format to GGUF (FP16) and then quantized into multiple formats. These variants offer different trade-offs between model size, inference speed, and output quality.


๐Ÿ”ง Model Details

  • โ€”Base model: Qwen/Qwen3-4B-SafeRL
  • โ€”Architecture: Qwen 3 (4B parameters)
  • โ€”Format: GGUF
  • โ€”Intended use: Safe RL research & alignment tasks
  • โ€”Conversion tool: convert_hf_to_gguf.py (from llama.cpp)
  • โ€”Quantization tool: llama-quantize

๐Ÿ“Š Quantized Versions

QuantizationFilenameSize (GiB)Notes
FP16Qwen3-4B-SafeRL-FP16.gguf~8.05Full precision (baseline)
Q2_KQwen3-4B-SafeRL-Q2_K.gguf~1.67Smallest, lowest accuracy
Q3_K_MQwen3-4B-SafeRL-Q3_K_M.gguf~2.08Balanced small size
Q4_0Qwen3-4B-SafeRL-Q4_0.gguf~2.37Good balance, faster
Q4_K_MQwen3-4B-SafeRL-Q4_K_M.gguf~2.50Standard, widely used
Q5_K_MQwen3-4B-SafeRL-Q5_K_M.gguf~2.89Better accuracy
Q6_KQwen3-4B-SafeRL-Q6_K.gguf~3.31High accuracy
Q8_0Qwen3-4B-SafeRL-Q8_0.gguf~4.28Near FP16 quality

๐Ÿš€ Usage

๐Ÿ–ฅ๏ธ llama.cpp

bash
./main -m Qwen3-4B-SafeRL-Q4_K_M.gguf -p "Hello, SafeRL!"

๐Ÿ Python

python
from huggingface_hub import hf_hub_download
from llama_cpp import Llama

model_path = hf_hub_download(
    repo_id="YOUR_USERNAME/Qwen3-4B-SafeRL-GGUF",
    filename="Qwen3-4B-SafeRL-Q4_K_M.gguf"
)

llm = Llama(model_path=model_path)

output = llm.create_chat_completion(
    messages=[
        {"role": "system", "content": "You are a safe RL assistant."},
        {"role": "user", "content": "Hello, SafeRL!"}
    ],
    max_tokens=100
)

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

These GGUF versions are optimized for fast inference with CPU/GPU runtimes like llama.cpp, Ollama, and LM Studio.