CoolFace
Modelpublic

GetSoloTech/Qwen3-Code-Reasoning-4B-GGUF

sourceHugging Faceapache-2.0updated 1y agoView on Hugging Face
9likes186downloads
Model Card

GetSoloTech/Qwen3-Code-Reasoning-4B-GGUF

This is the GGUF quantized version of the Qwen3-Code-Reasoning-4B model, specifically optimized for competitive programming and code reasoning tasks. This model has been trained on the high-quality Code-Reasoning dataset to enhance its capabilities in solving complex programming problems with detailed reasoning.

๐Ÿš€ Key Features

  • โ€”Enhanced Code Reasoning: Specifically trained on competitive programming problems
  • โ€”Thinking Capabilities: Inherits the advanced reasoning capabilities from the base model
  • โ€”High-Quality Solutions: Trained on solutions with โ‰ฅ85% test case pass rates
  • โ€”Structured Output: Optimized for generating well-reasoned programming solutions
  • โ€”Efficient Inference: GGUF format enables fast inference on CPU and GPU
  • โ€”Multiple Quantization Levels: Available in various precision levels for different hardware requirements

Dataset Statistics

  • โ€”Split: Python
  • โ€”Source: High-quality competitive programming problems from TACO, APPS, CodeContests, and Codeforces
  • โ€”Quality Filter: Only correctly solved problems with โ‰ฅ85% test case pass rates

๐Ÿ”ง Usage

Using with llama.cpp

bash
# Download the model (choose your preferred quantization)
wget https://huggingface.co/GetSoloTech/Qwen3-Code-Reasoning-4B-GGUF/resolve/main/qwen3-code-reasoning-4b.Q4_K_M.gguf

# Run inference
./llama.cpp -m qwen3-code-reasoning-4b.Q4_K_M.gguf -n 4096 --repeat_penalty 1.1 -p "You are an expert competitive programmer. Read the problem and produce a correct, efficient solution. Include reasoning if helpful.\n\nProblem: Your programming problem here..."

Using with Python (llama-cpp-python)

python
from llama_cpp import Llama

# Load the model
llm = Llama(
    model_path="./qwen3-code-reasoning-4b.Q4_K_M.gguf",
    n_ctx=4096,
    n_threads=4
)

# Prepare input for competitive programming problem
prompt = """You are an expert competitive programmer. Read the problem and produce a correct, efficient solution. Include reasoning if helpful.

Problem: Your programming problem here..."""

# Generate solution
output = llm(
    prompt,
    max_tokens=4096,
    temperature=0.7,
    top_p=0.8,
    top_k=20,
    repeat_penalty=1.1
)

print(output['choices'][0]['text'])

Using with Ollama

bash
# Create a Modelfile
cat > Modelfile << EOF
FROM ./qwen3-code-reasoning-4b.Q4_K_M.gguf
TEMPLATE """{{ if .System }}<|im_start|>system
{{ .System }}<|im_end|>
{{ end }}{{ if .Prompt }}<|im_start|>user
{{ .Prompt }}<|im_end|>
{{ end }}<|im_start|>assistant
"""
PARAMETER temperature 0.7
PARAMETER top_p 0.8
PARAMETER top_k 20
PARAMETER repeat_penalty 1.1
EOF

# Create and run the model
ollama create qwen3-code-reasoning -f Modelfile
ollama run qwen3-code-reasoning "Solve this competitive programming problem: [your problem here]"

๐Ÿ“Š Available Quantizations

QuantizationSizeMemory UsageQualityUse Case
Q3KM2.08 GB~3 GBGoodCPU inference, limited memory
Q4KM2.5 GB~4 GBBetterBalanced performance/memory
Q5KM2.89 GB~5 GBVery GoodHigh quality, moderate memory
Q6_K3.31 GB~6 GBExcellentHigh quality, more memory
Q8_04.28 GB~8 GBBestMaximum quality, high memory
F168.05 GB~16 GBOriginalMaximum quality, GPU recommended

๐Ÿ“ˆ Performance Expectations

This GGUF quantized model maintains the performance characteristics of the original finetuned model:

  • โ€”Competitive Programming Problems: Better understanding of problem constraints and requirements
  • โ€”Code Generation: More accurate and efficient solutions
  • โ€”Reasoning Quality: Enhanced step-by-step reasoning for complex problems
  • โ€”Solution Completeness: More comprehensive solutions with proper edge case handling

๐ŸŽ›๏ธ Recommended Settings

For Code Generation

  • โ€”Temperature: 0.7
  • โ€”Top-p: 0.8
  • โ€”Top-k: 20
  • โ€”Max New Tokens: 4096 (adjust based on problem complexity)
  • โ€”Repeat Penalty: 1.1

For Reasoning Tasks

  • โ€”Temperature: 0.6
  • โ€”Top-p: 0.95
  • โ€”Top-k: 20
  • โ€”Max New Tokens: 8192 (for complex reasoning)
  • โ€”Repeat Penalty: 1.1

๐Ÿ› ๏ธ Hardware Requirements

Minimum Requirements

  • โ€”RAM: 4 GB (for Q3KM quantization)
  • โ€”Storage: 2.5 GB free space
  • โ€”CPU: Multi-core processor recommended

Recommended Requirements

  • โ€”RAM: 8 GB or more
  • โ€”Storage: 5 GB free space
  • โ€”GPU: NVIDIA GPU with 4GB+ VRAM (optional, for faster inference)

๐Ÿค Contributing

This GGUF model was converted from the original LoRA-finetuned model. For questions about:

๐Ÿ“„ License

This model follows the same license as the base model (Apache 2.0). Please refer to the base model license for details.

๐Ÿ™ Acknowledgments

  • โ€”Qwen Team for the excellent base model
  • โ€”Unsloth Team for the efficient training framework
  • โ€”NVIDIA Research for the original OpenCodeReasoning-2 dataset
  • โ€”llama.cpp community for the GGUF format and tools

๐Ÿ“ž Contact

For questions about this GGUF model, please open an issue in the repository.


Note: This model is specifically optimized for competitive programming and code reasoning tasks. The GGUF format enables efficient inference on various hardware configurations while maintaining the model's reasoning capabilities.