Instructions to use Liontix/Qwen3-4B-Advanced-Reasoning-Distill-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use Liontix/Qwen3-4B-Advanced-Reasoning-Distill-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="Liontix/Qwen3-4B-Advanced-Reasoning-Distill-GGUF", filename="qwen3-4B-gpt4.5-claude3.7_Q4_K_M.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Liontix/Qwen3-4B-Advanced-Reasoning-Distill-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 Liontix/Qwen3-4B-Advanced-Reasoning-Distill-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf Liontix/Qwen3-4B-Advanced-Reasoning-Distill-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 Liontix/Qwen3-4B-Advanced-Reasoning-Distill-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf Liontix/Qwen3-4B-Advanced-Reasoning-Distill-GGUF:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf Liontix/Qwen3-4B-Advanced-Reasoning-Distill-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf Liontix/Qwen3-4B-Advanced-Reasoning-Distill-GGUF:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf Liontix/Qwen3-4B-Advanced-Reasoning-Distill-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf Liontix/Qwen3-4B-Advanced-Reasoning-Distill-GGUF:Q4_K_M
Use Docker
docker model run hf.co/Liontix/Qwen3-4B-Advanced-Reasoning-Distill-GGUF:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use Liontix/Qwen3-4B-Advanced-Reasoning-Distill-GGUF with Ollama:
ollama run hf.co/Liontix/Qwen3-4B-Advanced-Reasoning-Distill-GGUF:Q4_K_M
- Unsloth Studio
How to use Liontix/Qwen3-4B-Advanced-Reasoning-Distill-GGUF with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Liontix/Qwen3-4B-Advanced-Reasoning-Distill-GGUF to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Liontix/Qwen3-4B-Advanced-Reasoning-Distill-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Liontix/Qwen3-4B-Advanced-Reasoning-Distill-GGUF to start chatting
- Pi
How to use Liontix/Qwen3-4B-Advanced-Reasoning-Distill-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Liontix/Qwen3-4B-Advanced-Reasoning-Distill-GGUF:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "Liontix/Qwen3-4B-Advanced-Reasoning-Distill-GGUF:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use Liontix/Qwen3-4B-Advanced-Reasoning-Distill-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 Liontix/Qwen3-4B-Advanced-Reasoning-Distill-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 Liontix/Qwen3-4B-Advanced-Reasoning-Distill-GGUF:Q4_K_M
Run Hermes
hermes
- Atomic Chat new
- OpenClaw new
How to use Liontix/Qwen3-4B-Advanced-Reasoning-Distill-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Liontix/Qwen3-4B-Advanced-Reasoning-Distill-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 "Liontix/Qwen3-4B-Advanced-Reasoning-Distill-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"
- Docker Model Runner
How to use Liontix/Qwen3-4B-Advanced-Reasoning-Distill-GGUF with Docker Model Runner:
docker model run hf.co/Liontix/Qwen3-4B-Advanced-Reasoning-Distill-GGUF:Q4_K_M
- Lemonade
How to use Liontix/Qwen3-4B-Advanced-Reasoning-Distill-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Liontix/Qwen3-4B-Advanced-Reasoning-Distill-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.Qwen3-4B-Advanced-Reasoning-Distill-GGUF-Q4_K_M
List all available models
lemonade list
Question about Fine-Tuning Setup / Preferences
Hello! Thanks so much for using my datasets. I hope they were helpful! Those are two of my most favorite ones.
I'd be curious if you'd be willing to share more details about your fine-tuning process? I currently use Unsloth, and while it "gets the job done", the results can be a bit rough sometimes.
I noticed you mentioned several thousand steps of fine-tuning. So I'm just interested in what your setup and params look like. (Example: LoRA rank and alpha, what layers you had activated (q,v,k,o,up,down,mlp,etc.) Learning rate, anything else you got!
Hoping to hear from you, keep on coding! - Michael
Hey,
Firstly, I want to thank you for your amazing datasets and models. They inspired me to start working on my own models and datasets.
I also use Unsloth notebooks for fine-tuning, but I haven't changed any LoRA parameters and just hoped that it would work.
The only parts I changed were the learning rate (2e-5 instead of 2e-4) for some of my distills and the sequence length (higher = better result).
After starting to work on these distills, I started collaborating with @armand0e (forming TeichAI). Since then, he's been tweaking the parameters and training the models.
I focus on creating the synthetic prompts for the datasets and exploring other methods (besides SFT) to improve our distills.
Here is a fine-tuning run with heavy overfitting (should have decreased the steps), but that was the base notebook at the time.
https://huggingface.co/Liontix/Qwen3-8B-Gemini-2.5-Pro-Distill/blob/main/Unsloth_Qwen3_Reasoning_Conversational_Edited.ipynb
Maybe @armand0e can give you more insights regarding parameter tweaking.
Thanks for the work and effort you put into your models and datasets!
Regards, Liontix
We made a sloppy attempt to publish our training code and some info for beginners to try and replicate what we do at https://docs.teichai.com (note: the open in colab buttons wont work atm as we havent made the notebooks on github).
But again as @Liontix mentioned it does vary a lot depending on factors like the base model (number of params, architecture, etc), dataset size, how much context you want to train on, etc.
I normally start with the r, alpha, learning rate, and epochs/steps from the docs attached above and make small adjustments and/or experiment with different checkpoints saved along the way. Overfitting is still a big issue we face and we're actively exploring alternative training methods so we can transfer style without degrading the original model has become capable. For now this is the best advice I can give for a general sense)
As for which modules to target and things like that I usually stick with whatever unsloth recommends for those models (based on their published notebooks). Otherwise I just try the standard linear attention layers. The only exception to this has been gpt-oss-20b as something just doesn't seem to be working for this model.
Hope all goes well! Please don't hesitate to reach out if you have any questions 😊
I'd be curious if you'd be willing to share more details about your fine-tuning process? I currently use Unsloth, and while it "gets the job done", the results can be a bit rough sometimes.
I noticed you mentioned several thousand steps of fine-tuning. So I'm just interested in what your setup and params look like. (Example: LoRA rank and alpha, what layers you had activated (q,v,k,o,up,down,mlp,etc.) Learning rate, anything else you got!
Hoping to hear from you, keep on coding! - Michael
For this tune and a lot of our older tunes we used these parameters:
Lora config:
r=32,
lora_alpha=32,
lora_dropout=0,
bias="none",
use_gradient_checkpointing="unsloth",
random_state=3407,
use_rslora=False,
loftq_config=None,
SFT Trainer Config:
per_device_train_batch_size = 2,
gradient_accumulation_steps = 4, # as long as effective batch size is 8 you should see similar results
warmup_steps = 5,
max_steps = 2000, # or about 3 epochs depending on dataset size
learning_rate = 2e-4,
optim = "adamw_8bit",
weight_decay = 0.01,
lr_scheduler_type = "linear",
seed = 3447,
Lmk if you have any other questions :)
Thanks so much @armand0e ! One last question: do you know if you used QVKO, QVO,or a different combination of attention projections?
Thank you so much for answering these questions! Super helpful.
QKVO, Gate, Up, and Down
model = FastLanguageModel.get_peft_model(
model,
r = 32,
target_modules = ["q_proj", "k_proj", "v_proj", "o_proj",
"gate_proj", "up_proj", "down_proj",],
lora_alpha = 32,
lora_dropout = 0,
bias = "none",
use_gradient_checkpointing = "unsloth",
random_state = 3407,
use_rslora = False,
loftq_config = None,
)
Always happy to help.