Instructions to use Igriscodes/qwen3-4b-tool-gguf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use Igriscodes/qwen3-4b-tool-gguf with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="Igriscodes/qwen3-4b-tool-gguf", filename="qwen3-4b-tool-f16.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use Igriscodes/qwen3-4b-tool-gguf with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf Igriscodes/qwen3-4b-tool-gguf:Q4_K_M # Run inference directly in the terminal: llama-cli -hf Igriscodes/qwen3-4b-tool-gguf:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf Igriscodes/qwen3-4b-tool-gguf:Q4_K_M # Run inference directly in the terminal: llama-cli -hf Igriscodes/qwen3-4b-tool-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 Igriscodes/qwen3-4b-tool-gguf:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf Igriscodes/qwen3-4b-tool-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 Igriscodes/qwen3-4b-tool-gguf:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf Igriscodes/qwen3-4b-tool-gguf:Q4_K_M
Use Docker
docker model run hf.co/Igriscodes/qwen3-4b-tool-gguf:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use Igriscodes/qwen3-4b-tool-gguf with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Igriscodes/qwen3-4b-tool-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": "Igriscodes/qwen3-4b-tool-gguf", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Igriscodes/qwen3-4b-tool-gguf:Q4_K_M
- Ollama
How to use Igriscodes/qwen3-4b-tool-gguf with Ollama:
ollama run hf.co/Igriscodes/qwen3-4b-tool-gguf:Q4_K_M
- Unsloth Studio new
How to use Igriscodes/qwen3-4b-tool-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 Igriscodes/qwen3-4b-tool-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 Igriscodes/qwen3-4b-tool-gguf to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Igriscodes/qwen3-4b-tool-gguf to start chatting
- Pi new
How to use Igriscodes/qwen3-4b-tool-gguf with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf Igriscodes/qwen3-4b-tool-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": "Igriscodes/qwen3-4b-tool-gguf:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use Igriscodes/qwen3-4b-tool-gguf with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf Igriscodes/qwen3-4b-tool-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 Igriscodes/qwen3-4b-tool-gguf:Q4_K_M
Run Hermes
hermes
- Docker Model Runner
How to use Igriscodes/qwen3-4b-tool-gguf with Docker Model Runner:
docker model run hf.co/Igriscodes/qwen3-4b-tool-gguf:Q4_K_M
- Lemonade
How to use Igriscodes/qwen3-4b-tool-gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Igriscodes/qwen3-4b-tool-gguf:Q4_K_M
Run and chat with the model
lemonade run user.qwen3-4b-tool-gguf-Q4_K_M
List all available models
lemonade list
Qwen3-4B-Agentic-MCP-RL - GGUF
This repository contains the GGUF quantization files for Igriscodes/qwen-tool, a fine-tuned Qwen/Qwen3-1.7B model optimized for multi-step tool use and structured payload delivery via the Model Context Protocol (MCP).
The base model was aligned using Proximal Policy Optimization (PPO) on strict JSON validation, execution tracking, and tool-error recovery loops. These GGUF files allow for low-latency, low-memory local inference on edge devices, CPU-only systems, and Apple Silicon.
Available Quantizations
- Q2_K: Maximum compression. Significant loss in logic, not recommended for complex tool-use but fits on ultra-low-memory devices.
- Q3_K_M: Balanced 3-bit compression. Better logic than Q2, suitable for highly constrained memory footprints.
- Q4_0: Standard legacy 4-bit quantization. Faster on certain older hardware architectures but slightly lower quality than K-quants.
- Q4_K_M: Recommended. Optimal balance of reasoning performance, generation speed, and VRAM savings.
- Q5_0: Standard legacy 5-bit quantization. Good middle ground, but outpaced by K-quants.
- Q5_K_M: High quality 5-bit compression. Retains nearly all unquantized capabilities while saving substantial VRAM.
- Q6_K: 6-bit quantization. Near-zero degradation from F16 while shaving off a decent chunk of file size.
- Q8_0: Maximum 8-bit fidelity. Extremely close to native F16 performance, ideal for strict syntax and reliable tool-calling.
- F16: Unquantized baseline. High fidelity, near-native performance for systems with more memory overhead.
Local Deployment Quickstart
Using Ollama
Ollama supports running models directly from Hugging Face via the hf.co registry prefix. You can pull and run your preferred precision instantly:
# Q2_K (Extreme compression)
ollama run hf.co/Igriscodes/qwen3-4b-tool-gguf:Q2_K
# Q3_K_M (Medium 3-bit)
ollama run hf.co/Igriscodes/qwen3-4b-tool-gguf:Q3_K_M
# Q4_0 (Legacy 4-bit)
ollama run hf.co/Igriscodes/qwen3-4b-tool-gguf:Q4_0
# Q4_K_M (Recommended balanced version)
ollama run hf.co/Igriscodes/qwen3-4b-tool-gguf:Q4_K_M
# Q5_0 (Legacy 5-bit)
ollama run hf.co/Igriscodes/qwen3-4b-tool-gguf:Q5_0
# Q5_K_M (High-fidelity 5-bit)
ollama run hf.co/Igriscodes/qwen3-4b-tool-gguf:Q5_K_M
# Q6_K (Deep 6-bit)
ollama run hf.co/Igriscodes/qwen3-4b-tool-gguf:Q6_K
# Q8_0 (Near-lossless 8-bit)
ollama run hf.co/Igriscodes/qwen3-4b-tool-gguf:Q8_0
# F16 (High-fidelity unquantized float version)
ollama run hf.co/Igriscodes/qwen3-4b-tool-gguf:F16
or
Ollama Setup Guide
To run this model locally with full tool-calling (function calling) and thinking capabilities, you can easily package it into an Ollama model using the provided template configuration.
1. Create the Modelfile
Save the configuration block below exactly as a file named Modelfile in the same directory where your downloaded GGUF file is located.
💡 Note: If you are using a different quantization format than the
q4_k_mexample below, make sure to update theFROMline to match your exact.gguffilename.
# Point to your quantized GGUF file
FROM ./qwen3-4b-tool-q4_k_m.gguf
# Custom template optimizing tool-use syntax and thought blocks
TEMPLATE """{{- $lastUserIdx := -1 -}}
{{- range $idx, $msg := .Messages -}}
{{- if eq $msg.Role "user" }}{{ $lastUserIdx = $idx }}{{ end -}}
{{- end }}
{{- if or .System .Tools }}<|im_start|>system
{{ if .System }}{{ .System }}
{{ end }}
{{- if .Tools }}# Tools
You may call one or more functions to assist with the user query.
You are provided with function signatures within <tools></tools> XML tags:
<tools>
{{- range .Tools }}
{"type": "function", "function": {{ .Function }}}
{{- end }}
</tools>
For each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:
<tool_call>
{"name": <function-name>, "arguments": <args-json-object>}
</tool_call>
{{- end -}}
<|im_end|>
{{ end }}
{{- range $i, $_ := .Messages }}
{{- $last := eq (len (slice $.Messages $i)) 1 -}}
{{- if eq .Role "user" }}<|im_start|>user
{{ .Content }}<|im_end|>
{{ else if eq .Role "assistant" }}<|im_start|>assistant
{{ if (and $.IsThinkSet (and .Thinking (or $last (gt $i $lastUserIdx)))) -}}
<think>{{ .Thinking }}</think>
{{ end -}}
{{ if .Content }}{{ .Content }}{{ end }}
{{- if .ToolCalls }}
{{- range .ToolCalls }}
<tool_call>
{"name": "{{ .Function.Name }}", "arguments": {{ .Function.Arguments }}}
</tool_call>
{{- end }}
{{- end }}{{ if not $last }}<|im_end|>
{{ end }}
{{- else if eq .Role "tool" }}<|im_start|>user
<tool_response>
{{ .Content }}
</tool_response><|im_end|>
{{ end }}
{{- if and (ne .Role "assistant") $last }}<|im_start|>assistant
<think>
{{ end }}
{{- end }}"""
# Inference parameters optimized for structured reasoning
PARAMETER temperature 0.6
PARAMETER num_ctx 8192
PARAMETER num_gpu -1
PARAMETER top_k 20
PARAMETER top_p 0.95
PARAMETER repeat_penalty 1
PARAMETER stop <|im_start|>
PARAMETER stop <|im_end|>
2. Build and Run the Model
Open your terminal, navigate to the directory containing your Modelfile and your .gguf file, and execute the build command:
ollama create qwen3-4b-tool --file Modelfile
Once the build process completes, you can launch and interact with your new custom model natively via Ollama:
ollama run qwen3-4b-tool
Using Python (llama-cpp-python)
First, ensure you have the library installed:
pip install llama-cpp-python
Depending on your hardware constraints, you can load either the uncompressed precision or the quantized version using the snippets below:
Option 1: High Fidelity (F16 Precision)
from llama_cpp import Llama
llm = Llama.from_pretrained(
repo_id="Igriscodes/qwen3-4b-tool-gguf",
filename="qwen3-4b-tool-f16.gguf",
n_ctx=2048,
n_gpu_layers=-1 # Use -1 to offload all layers to GPU (Metal/CUDA)
)
Option 2: Low Resource (Q4 Quantization)
from llama_cpp import Llama
llm = Llama.from_pretrained(
repo_id="Igriscodes/qwen3-4b-tool-gguf",
filename="qwen3-4b-tool-q4.gguf",
n_ctx=2048,
n_gpu_layers=-1 # Optimized for CPU execution or limited VRAM
)
- Downloads last month
- 473
2-bit
3-bit
4-bit
5-bit
6-bit
8-bit
16-bit