Instructions to use llm-jp/llm-jp-4.1-8b-thinking-gguf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use llm-jp/llm-jp-4.1-8b-thinking-gguf with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="llm-jp/llm-jp-4.1-8b-thinking-gguf") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("llm-jp/llm-jp-4.1-8b-thinking-gguf", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use llm-jp/llm-jp-4.1-8b-thinking-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 llm-jp/llm-jp-4.1-8b-thinking-gguf:BF16 # Run inference directly in the terminal: llama cli -hf llm-jp/llm-jp-4.1-8b-thinking-gguf:BF16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf llm-jp/llm-jp-4.1-8b-thinking-gguf:BF16 # Run inference directly in the terminal: llama cli -hf llm-jp/llm-jp-4.1-8b-thinking-gguf:BF16
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 llm-jp/llm-jp-4.1-8b-thinking-gguf:BF16 # Run inference directly in the terminal: ./llama-cli -hf llm-jp/llm-jp-4.1-8b-thinking-gguf:BF16
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 llm-jp/llm-jp-4.1-8b-thinking-gguf:BF16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf llm-jp/llm-jp-4.1-8b-thinking-gguf:BF16
Use Docker
docker model run hf.co/llm-jp/llm-jp-4.1-8b-thinking-gguf:BF16
- LM Studio
- Jan
- vLLM
How to use llm-jp/llm-jp-4.1-8b-thinking-gguf with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "llm-jp/llm-jp-4.1-8b-thinking-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": "llm-jp/llm-jp-4.1-8b-thinking-gguf", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/llm-jp/llm-jp-4.1-8b-thinking-gguf:BF16
- SGLang
How to use llm-jp/llm-jp-4.1-8b-thinking-gguf with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "llm-jp/llm-jp-4.1-8b-thinking-gguf" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "llm-jp/llm-jp-4.1-8b-thinking-gguf", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "llm-jp/llm-jp-4.1-8b-thinking-gguf" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "llm-jp/llm-jp-4.1-8b-thinking-gguf", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use llm-jp/llm-jp-4.1-8b-thinking-gguf with Ollama:
ollama run hf.co/llm-jp/llm-jp-4.1-8b-thinking-gguf:BF16
- Unsloth Desktop
- Pi
How to use llm-jp/llm-jp-4.1-8b-thinking-gguf with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf llm-jp/llm-jp-4.1-8b-thinking-gguf:BF16
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "llm-jp/llm-jp-4.1-8b-thinking-gguf:BF16" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use llm-jp/llm-jp-4.1-8b-thinking-gguf with Docker Model Runner:
docker model run hf.co/llm-jp/llm-jp-4.1-8b-thinking-gguf:BF16
- Lemonade
How to use llm-jp/llm-jp-4.1-8b-thinking-gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull llm-jp/llm-jp-4.1-8b-thinking-gguf:BF16
Run and chat with the model
lemonade run user.llm-jp-4.1-8b-thinking-gguf-BF16
List all available models
lemonade list
- Hermes Agent
How to use llm-jp/llm-jp-4.1-8b-thinking-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 llm-jp/llm-jp-4.1-8b-thinking-gguf:BF16
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 llm-jp/llm-jp-4.1-8b-thinking-gguf:BF16
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use llm-jp/llm-jp-4.1-8b-thinking-gguf with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf llm-jp/llm-jp-4.1-8b-thinking-gguf:BF16
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 "llm-jp/llm-jp-4.1-8b-thinking-gguf:BF16" \ --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"
llm-jp-4.1-8b-thinking
LLM-jp-4.1 is a series of large language models developed by the Research and Development Center for Large Language Models at the National Institute of Informatics.
This repository provides the llm-jp-4.1-8b-thinking model. For an overview of the LLM-jp-4.1 models across different parameter sizes, please refer to:
Base models are trained with pre-training and mid-training only. Post-trained models are aligned using supervised fine-tuning (SFT) and direct preference optimization (DPO), without reinforcement learning.
For more details on the training procedures and evaluation results, please refer to our technical blog (in Japanese).
For practical usage examples and detailed instructions on how to use the models, please also refer to our cookbook.
To support the continued development of LLM-jp, we would greatly appreciate it if you could share how you utilize LLM-jp outcomes via the survey form.
Usage
Please refer to our cookbook for practical usage examples and detailed instructions on how to use the models.
Running this model with
llama.cppcurrently requires a fork ofllama.cpp. The upstreamggml-org/llama.cppdoes not yet include the required tokenizer-handling fixes, so chat parsing will fail for this model when using it as-is. See the LLM-jp-4 llama.cpp guide for build and usage instructions.
Model Details
- Model type: Transformer-based Language Model
- Architectures:
Dense model:
| Params | Layers | Hidden size | Heads | Context length | Embedding parameters | Non-embedding parameters | Total parameters |
|---|---|---|---|---|---|---|---|
| 8B | 32 | 4,096 | 32 | 65,536 | 805,306,368 | 7,784,894,464 | 8,590,200,832 |
| 33B | 64 | 5,120 | 40 | 65,536 | 1,006,632,960 | 32,212,915,200 | 33,219,548,160 |
MoE model:
| Params | Layers | Hidden size | Heads | Routed Experts | Activated Experts | Context length | Embedding parameters | Non-embedding parameters | Activated parameters | Total parameters |
|---|---|---|---|---|---|---|---|---|---|---|
| 32B-A3B | 32 | 2,560 | 40 | 128 | 8 | 65,536 | 503,316,480 | 31,635,712,512 | 3,827,476,992 | 32,139,028,992 |
Tokenizer
The tokenizer of this model is based on a Unigram byte-fallback model implemented with huggingface/tokenizers.
The vocabulary entries were converted from llm-jp-tokenizer v4.0.
Please refer to README.md of llm-jp-tokenizer for details on the vocabulary construction procedure (the pure SentencePiece training does not reproduce our vocabulary).
The chat template of this model is designed to be compatible with the OpenAI Harmony response format. However, the tokenizer differs from the one assumed by the
openai-harmonylibrary, and therefore direct tokenization withopenai-harmonyis not supported. For correct behavior, please use the tokenizer provided with this model. For detailed usage, please refer to our cookbook.
Training
Pre-training
This model was trained through a multi-stage pipeline consisting of pre-training and mid-training phases, using a total of 11.7T tokens.
The corpora used for pre-training and mid-training are publicly available at the following links:
Although most of the corpora have been released, some portions are excluded from public release due to licensing constraints.
Post-training
We have fine-tuned the pre-trained checkpoint using SFT and further aligned it with DPO.
The datasets used for post-training are also publicly available at the following links:
- SFT
- DPO (for llm-jp-4.1-8b-thinking model)
- DPO (for llm-jp-4.1-32b-a3b-thinking model)
- DPO (for llm-jp-4.1-33b-thinking model)
Evaluation
We evaluated llm-jp-4.1 on a variety of benchmarks covering general capabilities, safety, and tool calling.
For more detailed evaluation results and analysis, please refer to our technical blog.
swallow-evaluation-instruct
We evaluated the models on a range of benchmarks covering the following six categories:
- Math
- Math 500
- AIME 2024 (pass@1, pass@32)
- AIME 2025 (pass@1, pass@32)
- AIME 2026 (pass@1, pass@32)
- MCLM Math 100 (pass@1, pass@4)
- PolyMath JA High
- PolyMath JA Top
- Science
- GPQA Diamond (pass@1, pass@4)
- JGPQA Diamond
- Knowledge & QA
- JAM-CQA
- JEMHopQA
- JMMLU
- MMLU-ProX JA
- MMLU-ProX EN
- Code
- LiveCodeBench v6 (pass@1, pass@10)
- JHumanEval (pass@1, pass@10)
- HumanEval+ (pass@1, pass@10)
- Instruction Following (IF)
- MIFEval JA
- IFBench
- Machine Translation (MT)
- WMT20 EN-JA
- WMT20 JA-EN
For LLM-jp and gpt-oss models, reasoning_effort was set to high.
For Olmo-3-7B-Think, Olmo-3.1-32B-Think, Qwen3, Qwen3.5, Qwen3.6, and Gemma 4, enable_thinking was set to True.
For Qwen3.8-27B and Muse-Glimmer-30B, reasoning_effort was set to xhigh.
The figure below shows the average score across the benchmarks in each category.
llm-jp-judge
We evaluated the models using an LLM-as-a-Judge framework on the following benchmarks:
- MT-Bench (JA/EN): A benchmark for measuring multi-turn conversational task-solving ability.
- AnswerCarefully: A benchmark for evaluating safety in Japanese. We used 336 questions from the v2.0 test set.
- llm-jp-instructions: A set of human-created single-turn question-answer pairs. We used 400 questions from the test set.
We used gpt-5.4-2026-03-05 as the judge. For models that support reasoning_effort, it was set to medium.
The scores represent the average values obtained from three rounds of inference and evaluation. For more details, please refer to the evaluation code.
| Model Name | MT-Bench (JA) | MT-Bench (EN) | AnswerCarefully | llm-jp-instructions |
|---|---|---|---|---|
| gpt-4o-2024-08-06 | 7.29 | 7.69 | 4.00 | 4.07 |
| gpt-5.4-2026-03-05 | 8.87 | 8.89 | 4.43 | 4.82 |
| gpt-oss-20b | 7.33 | 7.85 | 3.55 | 3.16 |
| llm-jp-4-8b-thinking | 7.54 | 7.79 | 3.69 | 3.54 |
| llm-jp-4.1-8b-thinking | 7.58 | 7.67 | 3.92 | 3.67 |
| llm-jp-4-32b-a3b-thinking | 7.82 | 7.86 | 3.70 | 3.61 |
| llm-jp-4.1-32b-a3b-thinking | 7.69 | 7.85 | 3.91 | 3.79 |
| llm-jp-4-33b-thinking | 8.00 | 8.24 | 3.79 | 3.79 |
| llm-jp-4.1-33b-thinking | 7.76 | 7.98 | 4.08 | 3.83 |
Tool Calling
We evaluated the models on the following tool calling benchmarks:
For BFCL, we evaluated the models using only the categories available up to v3, so the web search and memory categories introduced in v4 are excluded.
For tau2-bench, we used Azure's gpt-5.1-2025-11-13 as both the user simulator and the NL-assertion judge, and the scores represent the average values obtained from two rounds of inference and evaluation.
For all LLM-jp models, reasoning_effort was set to medium.
The figure below shows the scores on each benchmark.
Risks and Limitations
The models released here are research and development models and are not intended for direct use in production services. Although the models have undergone post-training for instruction following and safety, they may still generate inaccurate, inappropriate, or otherwise undesirable outputs. Users should carefully evaluate the models for their intended use cases.
Send Questions to
llm-jp(at)nii.ac.jp
License
Acknowledgements
To develop this model, we used the NINJAL Web Japanese Corpus (whole-NWJC) from the National Institute for Japanese Language and Linguistics (NINJAL).
Model Card Authors
The names are listed in alphabetical order.
Hirokazu Kiyomaru, Takashi Kodama, and Yunang Wu.
- Downloads last month
- 612
4-bit
16-bit


