Views
No views yet
| File | Size | Bits/weight | Use case |
|---|---|---|---|
Nanbeige4.2-3B-F16.gguf | ~8.2 GB | 16 | Full precision, lossless |
Nanbeige4.2-3B-BF16.gguf | ~8.2 GB | 16 (bfloat16) | Faster loading, equivalent quality |
Nanbeige4.2-3B-Q8_0.gguf | ~4.3 GB | 8 | Near-lossless |
Nanbeige4.2-3B-Q6_K.gguf | ~3.4 GB | 6 | Excellent quality |
Nanbeige4.2-3B-Q5_K_M.gguf | ~2.9 GB | ~5.5 | High quality |
Nanbeige4.2-3B-Q4_K_M.gguf | ~2.5 GB | ~4.5 | Recommended default |
Nanbeige4.2-3B-Q3_K_L.gguf | ~2.3 GB | ~3.5 | Tight memory, lowest viable quality |
llama-cli -m Nanbeige4.2-3B-Q4_K_M.gguf -c 4096 --color -i --temp 0.1 --top-k 50 --repeat-penalty 1.1llama-cli -hf nicolasembleton/Nanbeige4.2-3B-GGUF:Q4_K_M -c 4096 --color -i1from llama_cpp import Llama
2
3llm = Llama(
4 model_path="Nanbeige4.2-3B-Q4_K_M.gguf",
5 n_ctx=4096,
6 n_threads=8,
7 n_gpu_layers=99, # offload all layers to GPU if available
8)
9print(llm("Hello, how are you?", max_tokens=256)["choices"][0]["text"])Modelfile:FROM ./Nanbeige4.2-3B-Q4_K_M.gguf1ollama create nanbeige4.2-3b -f Modelfile
2ollama run nanbeige4.2-3bnicolasembleton/Nanbeige4.2-3B-ONNX — BF16 weights with a working num_loops=2 unroll. Works in Chrome, Firefox, Edge (WebGPU fast path) and Apple Safari 17+ macOS (WASM fallback).1import * as ort from "onnxruntime-web";
2
3const session = await ort.InferenceSession.create(
4 "https://huggingface.co/nicolasembleton/Nanbeige4.2-3B-ONNX/resolve/main/model.onnx",
5 { executionProviders: ["webgpu", "wasm"] }, // Safari 17 macOS falls back to WASM
6);
7
8const inputIds = BigInt64Array.from(/* your token ids */);
9const feeds = {
10 input_ids: new ort.Tensor("int64", inputIds, [1, inputIds.length]),
11 attention_mask: new ort.Tensor("int64", new BigInt64Array(inputIds.length).fill(1n), [1, inputIds.length]),
12 position_ids: new ort.Tensor("int64", [...Array(inputIds.length).keys()].map(BigInt), [1, inputIds.length]),
13};
14const { logits } = await session.run(feeds);Michionlion/Nanbeige4.2-3B-ONNX-WebGPU — Q4F16 WebGPU-optimized, smaller (~3 GB) but no WASM fallback.1import { pipeline } from "@huggingface/transformers";
2
3const generator = await pipeline(
4 "text-generation",
5 "Michionlion/Nanbeige4.2-3B-ONNX-WebGPU",
6 {
7 device: "webgpu",
8 dtype: "q4f16",
9 model_file_name: "model_webgpu_mlp",
10 use_external_data_format: 2,
11 },
12);
13const output = await generator("Hello, how are you?", { max_new_tokens: 256 });Architecture note: Nanbeige'snum_loops=2(two passes per physical layer) was previously only available in community ONNX exports via custom kernels (MatMulNBitsMlp). Our export unrolls the loop at the Python level — 44 sequential layer calls with shared 22 weights — producing a standard ONNX graph that runs in stock ONNX Runtime Web.
Note: This GGUF repo is for native/server-side inference (llama.cpp, Ollama, LM Studio). The ONNX repo above covers browser inference with cross-browser support including Apple Safari WASM fallback.
NanbeigeForCausalLM — loop transformer with 22 layers, num_loops=2 (two passes per layer). 48 heads, 8 KV heads, 3072 hidden, 166144 vocab, 256K context.b10276 (Aug 2026) — the first release to include Nanbeige architecture support.*.gguf — quantized model filesREADME.md — this file1@misc{nanbeige42-3b-gguf,
2 title = {{Nanbeige4.2-3B-GGUF}},
3 author = {{Nanbeige, quantizations by nicolasembleton}},
4 year = {{2026}},
5 howpublished = {{Hugging Face}},
6 note = {{GGUF quantizations of Nanbeige4.2-3B. For browser inference use nicolasembleton/Nanbeige4.2-3B-ONNX (cross-browser including Apple Safari) or Michionlion/Nanbeige4.2-3B-ONNX-WebGPU (WebGPU-only).}},
7}}