danielhanchen commited on
Commit
e1e23cf
·
verified ·
1 Parent(s): d43589b

Add llama.cpp PR #24260 build and run instructions

Browse files
Files changed (1) hide show
  1. README.md +75 -0
README.md CHANGED
@@ -29,6 +29,81 @@ tags:
29
  </div>
30
 
31
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  # **Model Card for North Mini Code**
33
 
34
  ## **Model Summary**
 
29
  </div>
30
 
31
 
32
+ ## Run these GGUFs with llama.cpp
33
+
34
+ These are GGUF quants of North-Mini-Code-1.0. The model uses the `cohere2moe` architecture, which is not in a stock llama.cpp release yet. Until [llama.cpp PR #24260](https://github.com/ggml-org/llama.cpp/pull/24260) is merged, build llama.cpp from that PR branch to load these files. Once the PR lands in a release, these same GGUFs will run on stock llama.cpp with no re-download, because they already declare `general.architecture = cohere2moe`.
35
+
36
+ ### 1. Build llama.cpp from PR #24260
37
+
38
+ ```bash
39
+ git clone https://github.com/ggml-org/llama.cpp
40
+ cd llama.cpp
41
+ git fetch origin pull/24260/head:cohere2-moe
42
+ git checkout cohere2-moe
43
+
44
+ # CUDA build. Drop -DGGML_CUDA=ON for a CPU only build.
45
+ cmake -B build -DGGML_CUDA=ON
46
+ cmake --build build --config Release -j
47
+ ```
48
+
49
+ The binaries are written to `build/bin/` (`llama-cli`, `llama-server`, `llama-quantize`).
50
+
51
+ ### 2. Download a quant
52
+
53
+ ```bash
54
+ pip install huggingface_hub
55
+
56
+ hf download unsloth/North-Mini-Code-1.0-GGUF \
57
+ --include "North-Mini-Code-1.0-UD-Q4_K_XL.gguf" \
58
+ --local-dir North-Mini-Code-1.0-GGUF
59
+ ```
60
+
61
+ Every quant here is a single file except `BF16/`, which is split into two shards. To use a split set, download the whole folder and point llama.cpp at the first shard (`...-00001-of-00002.gguf`); it loads the rest automatically.
62
+
63
+ ### 3. Run
64
+
65
+ Interactive chat with llama-cli:
66
+
67
+ ```bash
68
+ ./build/bin/llama-cli \
69
+ --model North-Mini-Code-1.0-GGUF/North-Mini-Code-1.0-UD-Q4_K_XL.gguf \
70
+ --jinja \
71
+ --n-gpu-layers 99 \
72
+ --ctx-size 16384 \
73
+ --temp 1.0 --top-p 0.95 \
74
+ -p "Write a python program to check if a string is a palindrome."
75
+ ```
76
+
77
+ OpenAI compatible server with llama-server:
78
+
79
+ ```bash
80
+ ./build/bin/llama-server \
81
+ --model North-Mini-Code-1.0-GGUF/North-Mini-Code-1.0-UD-Q4_K_XL.gguf \
82
+ --jinja \
83
+ --n-gpu-layers 99 \
84
+ --ctx-size 16384 \
85
+ --host 0.0.0.0 --port 8080
86
+ ```
87
+
88
+ Then query it:
89
+
90
+ ```bash
91
+ curl http://localhost:8080/v1/chat/completions \
92
+ -H "Content-Type: application/json" \
93
+ -d '{
94
+ "messages": [{"role": "user", "content": "Write a python program to check if a string is a palindrome."}],
95
+ "temperature": 1.0,
96
+ "top_p": 0.95
97
+ }'
98
+ ```
99
+
100
+ Notes:
101
+
102
+ - Pass `--jinja` so the model chat template, including tool calling, is applied.
103
+ - Recommended sampling settings are `temperature=1.0` and `top_p=0.95`.
104
+ - Set `--n-gpu-layers 99` to offload all layers to GPU, or lower it to fit your VRAM. Use `--ctx-size` to set the context window (the model supports up to 256K).
105
+ - `imatrix_unsloth.gguf_file` is the importance matrix used to build these quants. It is not a model and is not loaded at runtime.
106
+
107
  # **Model Card for North Mini Code**
108
 
109
  ## **Model Summary**