Instructions to use Jadson/Nanbeige4.2-3B-dlora-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Jadson/Nanbeige4.2-3B-dlora-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 Jadson/Nanbeige4.2-3B-dlora-GGUF:IQ4_NL # Run inference directly in the terminal: llama cli -hf Jadson/Nanbeige4.2-3B-dlora-GGUF:IQ4_NL
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Jadson/Nanbeige4.2-3B-dlora-GGUF:IQ4_NL # Run inference directly in the terminal: llama cli -hf Jadson/Nanbeige4.2-3B-dlora-GGUF:IQ4_NL
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 Jadson/Nanbeige4.2-3B-dlora-GGUF:IQ4_NL # Run inference directly in the terminal: ./llama-cli -hf Jadson/Nanbeige4.2-3B-dlora-GGUF:IQ4_NL
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 Jadson/Nanbeige4.2-3B-dlora-GGUF:IQ4_NL # Run inference directly in the terminal: ./build/bin/llama-cli -hf Jadson/Nanbeige4.2-3B-dlora-GGUF:IQ4_NL
Use Docker
docker model run hf.co/Jadson/Nanbeige4.2-3B-dlora-GGUF:IQ4_NL
- LM Studio
- Jan
- vLLM
How to use Jadson/Nanbeige4.2-3B-dlora-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Jadson/Nanbeige4.2-3B-dlora-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": "Jadson/Nanbeige4.2-3B-dlora-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Jadson/Nanbeige4.2-3B-dlora-GGUF:IQ4_NL
- Ollama
How to use Jadson/Nanbeige4.2-3B-dlora-GGUF with Ollama:
ollama run hf.co/Jadson/Nanbeige4.2-3B-dlora-GGUF:IQ4_NL
- Unsloth Desktop
- Pi
How to use Jadson/Nanbeige4.2-3B-dlora-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Jadson/Nanbeige4.2-3B-dlora-GGUF:IQ4_NL
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": "Jadson/Nanbeige4.2-3B-dlora-GGUF:IQ4_NL" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use Jadson/Nanbeige4.2-3B-dlora-GGUF with Docker Model Runner:
docker model run hf.co/Jadson/Nanbeige4.2-3B-dlora-GGUF:IQ4_NL
- Lemonade
How to use Jadson/Nanbeige4.2-3B-dlora-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Jadson/Nanbeige4.2-3B-dlora-GGUF:IQ4_NL
Run and chat with the model
lemonade run user.Nanbeige4.2-3B-dlora-GGUF-IQ4_NL
List all available models
lemonade list
- Hermes Agent
How to use Jadson/Nanbeige4.2-3B-dlora-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 Jadson/Nanbeige4.2-3B-dlora-GGUF:IQ4_NL
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 Jadson/Nanbeige4.2-3B-dlora-GGUF:IQ4_NL
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use Jadson/Nanbeige4.2-3B-dlora-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Jadson/Nanbeige4.2-3B-dlora-GGUF:IQ4_NL
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 "Jadson/Nanbeige4.2-3B-dlora-GGUF:IQ4_NL" \ --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"
Nanbeige4.2-3B dlora (GGUF, IQ4_NL)
Nanbeige/Nanbeige4.2-3B with a diffusion-generated FFN LoRA ("dlora"), in GGUF for llama.cpp. A small diffusion model, the LoRADiffuser (22 M parameters), generates a rank-16 LoRA for the gate, up, and down projections of every FFN, for every token. It's conditioned on what attention produced for that token. The backbone is frozen; only the diffuser was trained.
This GGUF needs the llama.cpp fork with dlora support: jadsongmatos/llama.cpp, branch teste3-nanbeige-dlora. Stock
llama.cpp rejects the extra diffuser.* tensors.
Files
| File | Size | Weights |
|---|---|---|
Nanbeige4.2-3B-dlora-IQ4_NL.gguf |
2.60 GB | backbone: 128 IQ4_NL, 45 F32, 27 Q5_K, 1 Q6_K; diffuser: 22 F32 |
SHA-256: f33e25892ccf308df659d7025990929ea070216a473cc4ab6cdd1615e983a0e2
The backbone weights are the NF4 weights the diffuser was trained against, dequantized to bf16 and quantized to
IQ4_NL with llama.cpp's default IQ4_NL mix (llama-quantize --tensor-type diffuser=f32 ... IQ4_NL). The diffuser
stays in F32.
Run
Build the fork and serve the model with the OpenAI-compatible API:
git clone -b teste3-nanbeige-dlora https://github.com/jadsongmatos/llama.cpp
cd llama.cpp
cmake -B build -DGGML_CUDA=ON # leave out -DGGML_CUDA=ON for a CPU-only build
cmake --build build -j --target llama-server
./build/bin/llama-server -m Nanbeige4.2-3B-dlora-IQ4_NL.gguf -ngl 99 -np 1 -c 36864
The model reasons before it answers (its chat template opens <think>), so give it room: MMLU-Pro answers
average about 5,384 tokens. llama-server returns the reasoning in reasoning_content and the
answer in content.
How it works
- The looped backbone runs its 22 layers twice, so the FFN runs 44 times per token. One diffuser serves all 44.
- At each FFN, the diffuser takes the attention output at that point (
x_attn), normalizes it, and projects it to a 32-dimensional context. It starts from a projection of that context plus a fixed noise draw (σ = 1.0, seed 42, stored in the GGUF), runs 4 DDIM steps with a small MLP denoiser, and decodes the LoRA's A and B matrices for the gate, up, and down projections. - Training: the backbone loaded in NF4 and frozen; a sample of epfml/FineWeb2-HQ in 20 languages, without English and with the same number of tokens per language; whole documents packed into 262,144-token sequences; about 80 M tokens (step 152). Each document drew 4 noise samples and trained on the best one.
Evaluation: MMLU-Pro with CoT
The official TIGER-Lab harness (evaluate_from_api.py): 5-shot chain of thought, greedy decoding, through
llama-server's API. Each answer can use up to 32,768 tokens instead of the harness's 4,000; at 4,000, 44% of
this model's answers were cut while still reasoning. The answer is extracted from content, after the reasoning.
Official accuracy counts an unanswered question as a random guess, as the harness does; strict accuracy counts
it as wrong.
bf16 weights, all 12,032 questions
| Measure | Value |
|---|---|
| Official accuracy | 77.98% |
| Strict accuracy | 77.86% (standard error ±0.38 points) |
| No extracted answer | 161 (1.3%) |
| Hit the 32,768-token limit | 178 (1.5%) |
| Tokens per answer | 5,384 |
| Category | Questions | Official | Strict |
|---|---|---|---|
| math | 1,351 | 92.30% | 92.08% |
| biology | 717 | 88.01% | 87.87% |
| chemistry | 1,132 | 87.63% | 87.54% |
| physics | 1,299 | 87.61% | 87.45% |
| business | 789 | 84.16% | 84.03% |
| economics | 844 | 82.82% | 82.82% |
| computer science | 410 | 81.22% | 81.22% |
| psychology | 798 | 77.69% | 77.69% |
| health | 818 | 71.15% | 71.15% |
| engineering | 969 | 69.66% | 69.04% |
| philosophy | 499 | 69.14% | 69.14% |
| other | 924 | 66.02% | 66.02% |
| history | 381 | 65.09% | 65.09% |
| law | 1,101 | 54.41% | 54.31% |
This IQ4_NL file
This file wasn't evaluated on MMLU-Pro; the numbers above are for the bf16 weights.
Limitations
- The file needs the fork above; stock llama.cpp can't load it.
- There's no same-protocol run of the plain Nanbeige4.2-3B yet, so this card doesn't measure how much the diffuser adds. The instruct model has no published MMLU-Pro number; 63.8 is for Nanbeige4.2-3B-Base, with the protocol not stated.
- The diffuser was trained against the NF4 backbone, and this file re-quantizes that backbone to IQ4_NL.
- The diffuser makes decoding slower: the graph has about 3.5 times as many nodes as the plain model.
- Inference uses one fixed noise draw; training drew a new one for every document.
License
Apache-2.0, the license of Nanbeige4.2-3B. This repository adds the trained diffuser and re-quantizes the backbone weights.
- Downloads last month
- 84
4-bit