Views
No views yet
convert_hf_to_gguf.py cannot convert the llm-jp-4 Unigram tokenizer
correctly, so this repository fills that gap. All credit for the model goes
to the LLM-jp project.| File | Size | Note |
|---|---|---|
llm-jp-4-33b-thinking-Q4_K_M.gguf | 20.2 GB | recommended for inference |
llm-jp-4-33b-thinking-BF16.gguf | 66.4 GB | lossless; for re-quantization |
llmjp-b10442.patch | — | required llama.cpp patches (see below) |
convert-llmjp4-33b.py | — | conversion script used to produce these files |
llama.cpp needs two patches to run llm-jp-4 GGUF models correctly
(llmjp-b10442.patch in this repo, written against b10442; both issues
also affect the official llm-jp-4 8b/32b-a3b GGUFs):reasoning_content extraction) breaks.\n / \t in your prompt
becomes <|unk|> (reproducible with the official 8b GGUF on upstream
and on the LLM-jp fork). The patch implements the same
"replace unk spans with <0xXX> byte tokens" post-processing as HF
tokenizers' byte_fallback: true. With it, tokenization is byte-exact
vs. AutoTokenizer (verified on Japanese text, multi-line code, CRLF and
rare characters).1git clone https://github.com/ggml-org/llama.cpp && cd llama.cpp
2git checkout b10442 # patch written against this tag; nearby tags likely fine
3git am llmjp-b10442.patch # or: git apply
4cmake -B build -DCMAKE_BUILD_TYPE=Release # add -DGGML_VULKAN=ON / -DGGML_CUDA=ON as needed
5cmake --build build -j --target llama-server llama-cli1llama-server -m llm-jp-4-33b-thinking-Q4_K_M.gguf --jinja -ngl 99 \
2 --ctx-size 32768 --host 0.0.0.0 --port 8093low / medium / high, default medium) can be set
per request:1{"model": "llm-jp-4-33b-thinking",
2 "messages": [{"role": "user", "content": "..."}],
3 "chat_template_kwargs": {"reasoning_effort": "low"}}reasoning_content (English —
by design of the model) and the final answer into content.tokenizer.json (HF Unigram) as GGUF
tokenizer.ggml.model = "t5" (UGM), mirroring the representation used by
the official
llm-jp-4-8b-thinking-gguf:
352 special tokens as CONTROL with score -1000.0, 256 byte tokens,
add_space_prefix=true, remove_extra_whitespaces=false.tokenizer.* metadata key including the chat template were verified
identical to the official 8b GGUF (the two models share
llm-jp-tokenizer v4.0). See convert-llmjp4-33b.py.llama-quantize from the BF16 GGUF, without an
importance matrix (the official 8b release uses one; contributions of an
imatrix-based re-quantization from the BF16 file are welcome).