Views
No views yet
Qwen/Qwen3-1.7B model optimized for multi-step tool use and structured payload delivery via the Model Context Protocol (MCP).hf.co registry prefix. You can pull and run your preferred precision instantly:1# Q2_K (Extreme compression)
2ollama run hf.co/Igriscodes/qwen3-1.7b-tool-gguf:Q2_K
3
4# Q3_K_M (Medium 3-bit)
5ollama run hf.co/Igriscodes/qwen3-1.7b-tool-gguf:Q3_K_M
6
7# Q4_0 (Legacy 4-bit)
8ollama run hf.co/Igriscodes/qwen3-1.7b-tool-gguf:Q4_0
9
10# Q4_K_M (Recommended balanced version)
11ollama run hf.co/Igriscodes/qwen3-1.7b-tool-gguf:Q4_K_M
12
13# Q5_0 (Legacy 5-bit)
14ollama run hf.co/Igriscodes/qwen3-1.7b-tool-gguf:Q5_0
15
16# Q5_K_M (High-fidelity 5-bit)
17ollama run hf.co/Igriscodes/qwen3-1.7b-tool-gguf:Q5_K_M
18
19# Q6_K (Deep 6-bit)
20ollama run hf.co/Igriscodes/qwen3-1.7b-tool-gguf:Q6_K
21
22# Q8_0 (Near-lossless 8-bit)
23ollama run hf.co/Igriscodes/qwen3-1.7b-tool-gguf:Q8_0
24
25# F16 (High-fidelity unquantized float version)
26ollama run hf.co/Igriscodes/qwen3-1.7b-tool-gguf:F16
27Modelfile in the same directory where your downloaded GGUF file is located.💡 Note: If you are using a different quantization format than theq4_k_mexample below, make sure to update theFROMline to match your exact.gguffilename.
1# Point to your quantized GGUF file
2FROM ./qwen3-1.7b-tool-q4_k_m.gguf
3
4# Custom template optimizing tool-use syntax and thought blocks
5TEMPLATE """{{- $lastUserIdx := -1 -}}
6{{- range $idx, $msg := .Messages -}}
7{{- if eq $msg.Role "user" }}{{ $lastUserIdx = $idx }}{{ end -}}
8{{- end }}
9{{- if or .System .Tools }}<|im_start|>system
10{{ if .System }}{{ .System }}
11
12{{ end }}
13{{- if .Tools }}# Tools
14
15You may call one or more functions to assist with the user query.
16
17You are provided with function signatures within <tools></tools> XML tags:
18<tools>
19{{- range .Tools }}
20{"type": "function", "function": {{ .Function }}}
21{{- end }}
22</tools>
23
24For each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:
25<tool_call>
26{"name": <function-name>, "arguments": <args-json-object>}
27</tool_call>
28{{- end -}}
29<|im_end|>
30{{ end }}
31{{- range $i, $_ := .Messages }}
32{{- $last := eq (len (slice $.Messages $i)) 1 -}}
33{{- if eq .Role "user" }}<|im_start|>user
34{{ .Content }}<|im_end|>
35{{ else if eq .Role "assistant" }}<|im_start|>assistant
36{{ if (and $.IsThinkSet (and .Thinking (or $last (gt $i $lastUserIdx)))) -}}
37<think>{{ .Thinking }}</think>
38{{ end -}}
39{{ if .Content }}{{ .Content }}{{ end }}
40{{- if .ToolCalls }}
41{{- range .ToolCalls }}
42<tool_call>
43{"name": "{{ .Function.Name }}", "arguments": {{ .Function.Arguments }}}
44</tool_call>
45{{- end }}
46{{- end }}{{ if not $last }}<|im_end|>
47{{ end }}
48{{- else if eq .Role "tool" }}<|im_start|>user
49<tool_response>
50{{ .Content }}
51</tool_response><|im_end|>
52{{ end }}
53{{- if and (ne .Role "assistant") $last }}<|im_start|>assistant
54<think>
55{{ end }}
56{{- end }}"""
57
58# Inference parameters optimized for structured reasoning
59PARAMETER temperature 0.6
60PARAMETER num_ctx 8192
61PARAMETER num_gpu -1
62PARAMETER top_k 20
63PARAMETER top_p 0.95
64PARAMETER repeat_penalty 1
65PARAMETER stop <|im_start|>
66PARAMETER stop <|im_end|>
67Modelfile and your .gguf file, and execute the build command:1ollama create qwen3-1.7b-tool --file Modelfile
21ollama run qwen3-1.7b-tool
2llama-cpp-python)pip install llama-cpp-python1from llama_cpp import Llama
2
3llm = Llama.from_pretrained(
4 repo_id="Igriscodes/qwen3-1.7b-tool-gguf",
5 filename="qwen3-1.7b-tool-f16.gguf",
6 n_ctx=2048,
7 n_gpu_layers=-1 # Use -1 to offload all layers to GPU (Metal/CUDA)
8)
91from llama_cpp import Llama
2
3llm = Llama.from_pretrained(
4 repo_id="Igriscodes/qwen3-1.7b-tool-gguf",
5 filename="qwen3-1.7b-tool-q4.gguf",
6 n_ctx=2048,
7 n_gpu_layers=-1 # Optimized for CPU execution or limited VRAM
8)
9