Instructions to use sizzlebop/CodeThink-V4-Qwen3-4B-Mix-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sizzlebop/CodeThink-V4-Qwen3-4B-Mix-GGUF with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="sizzlebop/CodeThink-V4-Qwen3-4B-Mix-GGUF")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("sizzlebop/CodeThink-V4-Qwen3-4B-Mix-GGUF", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use sizzlebop/CodeThink-V4-Qwen3-4B-Mix-GGUF with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf sizzlebop/CodeThink-V4-Qwen3-4B-Mix-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf sizzlebop/CodeThink-V4-Qwen3-4B-Mix-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf sizzlebop/CodeThink-V4-Qwen3-4B-Mix-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf sizzlebop/CodeThink-V4-Qwen3-4B-Mix-GGUF:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf sizzlebop/CodeThink-V4-Qwen3-4B-Mix-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf sizzlebop/CodeThink-V4-Qwen3-4B-Mix-GGUF:Q4_K_M
Use Docker
docker model run hf.co/sizzlebop/CodeThink-V4-Qwen3-4B-Mix-GGUF:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use sizzlebop/CodeThink-V4-Qwen3-4B-Mix-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sizzlebop/CodeThink-V4-Qwen3-4B-Mix-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sizzlebop/CodeThink-V4-Qwen3-4B-Mix-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/sizzlebop/CodeThink-V4-Qwen3-4B-Mix-GGUF:Q4_K_M
- SGLang
How to use sizzlebop/CodeThink-V4-Qwen3-4B-Mix-GGUF with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "sizzlebop/CodeThink-V4-Qwen3-4B-Mix-GGUF" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sizzlebop/CodeThink-V4-Qwen3-4B-Mix-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "sizzlebop/CodeThink-V4-Qwen3-4B-Mix-GGUF" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sizzlebop/CodeThink-V4-Qwen3-4B-Mix-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use sizzlebop/CodeThink-V4-Qwen3-4B-Mix-GGUF with Ollama:
ollama run hf.co/sizzlebop/CodeThink-V4-Qwen3-4B-Mix-GGUF:Q4_K_M
- Unsloth Desktop
- Pi
How to use sizzlebop/CodeThink-V4-Qwen3-4B-Mix-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf sizzlebop/CodeThink-V4-Qwen3-4B-Mix-GGUF:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "sizzlebop/CodeThink-V4-Qwen3-4B-Mix-GGUF:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use sizzlebop/CodeThink-V4-Qwen3-4B-Mix-GGUF with Docker Model Runner:
docker model run hf.co/sizzlebop/CodeThink-V4-Qwen3-4B-Mix-GGUF:Q4_K_M
- Lemonade
How to use sizzlebop/CodeThink-V4-Qwen3-4B-Mix-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull sizzlebop/CodeThink-V4-Qwen3-4B-Mix-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.CodeThink-V4-Qwen3-4B-Mix-GGUF-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use sizzlebop/CodeThink-V4-Qwen3-4B-Mix-GGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf sizzlebop/CodeThink-V4-Qwen3-4B-Mix-GGUF:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default sizzlebop/CodeThink-V4-Qwen3-4B-Mix-GGUF:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use sizzlebop/CodeThink-V4-Qwen3-4B-Mix-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf sizzlebop/CodeThink-V4-Qwen3-4B-Mix-GGUF:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "sizzlebop/CodeThink-V4-Qwen3-4B-Mix-GGUF:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
CodeThink-V4-Qwen3-4B-Mix GGUF
This repository provides GGUF quantizations for modrill/CodeThink-V4-Qwen3-4B-Mix.
CodeThink-V4-Qwen3-4B-Mix is a code reasoning model built on Qwen/Qwen3-4B-Base fine-tuned using a Mix Distillation recipe (0.2 traces from Qwen3-30B-A3B-Thinking and 0.8 traces from Qwen3-4B-Thinking across 4,155 competitive programming and code reasoning problems). The final LoRA adapter was merged into full weights at the 2-epoch endpoint.
All GGUF files were converted from the original safetensors weights using llama.cpp at native BF16 precision, followed by quantization into standard k-quant variants.
Available Files and Quantizations
| File | Quant Type | Size | Description / Recommendation |
|---|---|---|---|
CodeThink-V4-Qwen3-4B-Mix-BF16.gguf |
BF16 | 8.22 GB | Full precision base conversion. Highest fidelity reference weights. |
CodeThink-V4-Qwen3-4B-Mix-Q8_0.gguf |
Q8_0 | 4.37 GB | Near-lossless 8-bit quantization. Recommended for evaluation and high accuracy. |
CodeThink-V4-Qwen3-4B-Mix-Q6_K.gguf |
Q6_K | 3.38 GB | High quality retention with minimal degradation. Excellent balance for general development. |
CodeThink-V4-Qwen3-4B-Mix-Q5_K_M.gguf |
Q5_K_M | 2.94 GB | Balanced medium 5-bit quant. Strong code generation quality with moderate memory footprint. |
CodeThink-V4-Qwen3-4B-Mix-Q4_K_M.gguf |
Q4_K_M | 2.53 GB | Fast, lightweight 4-bit quant. Recommended default for everyday coding and local tool use. |
CodeThink-V4-Qwen3-4B-Mix-Q3_K_M.gguf |
Q3_K_M | 2.09 GB | Compact footprint when memory headroom is strictly limited. |
CodeThink-V4-Qwen3-4B-Mix-Q2_K.gguf |
Q2_K | 1.67 GB | Maximum compression for testing in ultra-constrained environments. |
Technical Specifications
- Architecture: Qwen3 (
Qwen3ForCausalLM) - Parameter Count: 4.41B
- Context Window: 32,768 tokens
- Attention Configuration: 32 attention heads, 8 key-value heads, head dimension 128
- Base Precision: bfloat16
- License: Apache-2.0
Prompt Format
This model uses the standard ChatML / Qwen conversation format, supporting explicit <think> reasoning blocks:
<|im_start|>system
You are a helpful coding assistant.<|im_end|>
<|im_start|>user
Write a Python function to check if a number is prime.<|im_end|>
<|im_start|>assistant
<think>
Need to verify if n <= 1, then check divisors up to sqrt(n).
</think>
def is_prime(n: int) -> bool:
if n <= 1:
return False
if n <= 3:
return True
if n % 2 == 0 or n % 3 == 0:
return False
i = 5
while i * i <= n:
if n % i == 0 or n % (i + 2) == 0:
return False
i += 6
return True
<|im_end|>
Quickstart Guide
Option 1: llama.cpp CLI
Run local interactive inference directly with llama-cli:
# Run 4-bit quantized model
llama-cli -m CodeThink-V4-Qwen3-4B-Mix-Q4_K_M.gguf \
-p "<|im_start|>user\nWrite a quicksort implementation in Python.<|im_end|>\n<|im_start|>assistant\n" \
-n 512 \
-ngl 99
Option 2: llama.cpp Server
Launch an OpenAI-compatible HTTP server:
llama-server -m CodeThink-V4-Qwen3-4B-Mix-Q4_K_M.gguf \
--port 8080 \
-c 32768 \
-ngl 99
Query the endpoint:
curl http://localhost:8080/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "CodeThink-V4-Qwen3-4B-Mix",
"messages": [
{"role": "user", "content": "Explain how Dijkstra algorithm works."}
],
"temperature": 0.6
}'
Option 3: Ollama
Create an Ollama model using a custom Modelfile:
FROM ./CodeThink-V4-Qwen3-4B-Mix-Q4_K_M.gguf
TEMPLATE """{{- if .System }}<|im_start|>system
{{ .System }}<|im_end|>
{{- end }}
{{- range .Messages }}
<|im_start|>{{ .Role }}
{{ .Content }}<|im_end|>
{{- end }}
<|im_start|>assistant
"""
PARAMETER stop "<|im_end|>"
PARAMETER stop "<|endoftext|>"
PARAMETER temperature 0.6
PARAMETER top_p 0.95
Build and run with Ollama:
ollama create codethink-4b -f Modelfile
ollama run codethink-4b "Write a binary search function in Rust."
Option 4: LM Studio
- Copy the desired
.gguffile into your local LM Studio models folder. - Select
CodeThink-V4-Qwen3-4B-Mix-Q4_K_M.gguffrom the model picker. - Use the ChatML prompt preset with system and user markers.
Original Model and Citation
- Original Hugging Face Checkpoint: modrill/CodeThink-V4-Qwen3-4B-Mix
- Base Architecture Reference: Qwen/Qwen3-4B-Base
- Mix Distillation Methodology: Li et al., 2025, "Small Models Struggle to Learn from Strong Reasoners", arXiv:2502.12143
- Downloads last month
- 173
2-bit
3-bit
4-bit
5-bit
6-bit
8-bit
16-bit