Instructions to use h2oai/h2o-lightning-4b-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 h2oai/h2o-lightning-4b-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 h2oai/h2o-lightning-4b-gguf:Q4_K_M # Run inference directly in the terminal: llama cli -hf h2oai/h2o-lightning-4b-gguf:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf h2oai/h2o-lightning-4b-gguf:Q4_K_M # Run inference directly in the terminal: llama cli -hf h2oai/h2o-lightning-4b-gguf:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf h2oai/h2o-lightning-4b-gguf:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf h2oai/h2o-lightning-4b-gguf:Q4_K_M
Use Docker
docker model run hf.co/h2oai/h2o-lightning-4b-gguf:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use h2oai/h2o-lightning-4b-gguf with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "h2oai/h2o-lightning-4b-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": "h2oai/h2o-lightning-4b-gguf", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/h2oai/h2o-lightning-4b-gguf:Q4_K_M
- Ollama
How to use h2oai/h2o-lightning-4b-gguf with Ollama:
ollama run hf.co/h2oai/h2o-lightning-4b-gguf:Q4_K_M
- Unsloth Desktop
- Pi
How to use h2oai/h2o-lightning-4b-gguf with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf h2oai/h2o-lightning-4b-gguf:Q4_K_M
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:9931/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "h2oai/h2o-lightning-4b-gguf:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use h2oai/h2o-lightning-4b-gguf with Docker Model Runner:
docker model run hf.co/h2oai/h2o-lightning-4b-gguf:Q4_K_M
- Lemonade
How to use h2oai/h2o-lightning-4b-gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull h2oai/h2o-lightning-4b-gguf:Q4_K_M
Run and chat with the model
lemonade run user.h2o-lightning-4b-gguf-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use h2oai/h2o-lightning-4b-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 h2oai/h2o-lightning-4b-gguf:Q4_K_M
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:9931/v1 hermes config set model.default h2oai/h2o-lightning-4b-gguf:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use h2oai/h2o-lightning-4b-gguf with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf h2oai/h2o-lightning-4b-gguf:Q4_K_M
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:9931/v1 \ --custom-model-id "h2oai/h2o-lightning-4b-gguf:Q4_K_M" \ --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"
H2O Lightning 4B GGUF
GGUF files of H2O-Lightning-4B v2.0 (revision 47a1d726) for
llama.cpp. For the model description, training and general benchmarks, see the model page.
llama.cpp reads the model one-way (causally) and returns no hidden states, so the model page's two-way reading and
calibration head are not available here. Probabilities use per-type temperatures fitted on one-way llama.cpp reads of
the BF16 file instead: in the files' metadata, choice 0.76 (2 options), 0.91 (3 to 5), 1.05 (6 or more), yes/no and
score 0.97, and 0.93 for requests with images (these metadata values were fitted on the full calibration pool,
including the 2,000-row sample of the comparison below, and no comparison number on this page measures them); the shim (the stock- path) uses the same fit per option count,
refitted with the gate's 2,000-row comparison sample left out (choice 0.76 / 0.94 / 0.83 / 0.97 / 1.05 for 2 / 3 / 4 / 5 / 6 or more options; images 0.97 / 0.82 / 0.82 / 0.97 /
1.15, fitted on reads at 1,600 tokens per image). A temperature never changes which option is most probable.
The model answers typed decisions with probabilities: named choice options, true/false noul, ordered score
levels, and box (a bounding box in an image).
Leading on Benchmarks
- #1 of 46 — Composite (open-weight Jev-class models; #2 of 55 Jev-class models, open or API), ImageJevBench edition v0.3.0, page read 2026-10-31, its row for release v1.4.1 @d7f1b05a, measured 2026-10-28 at image temperature 1.0; ahead of Drex Max (Nace AI, 44.65), Jev 1.13.0 + images (TypeSafe, 26.43), Clef-Flash (Cloudflare, 20.41) and Liquid d1-3B (4.10) (details)
- #2 of 46 — Intelligence (open-weight Jev-class models; #6 of 55 Jev-class models, open or API), ImageJevBench edition v0.3.0, page read 2026-10-31, its row for release v1.4.1 @d7f1b05a, measured 2026-10-28 at image temperature 1.0; ahead of Clef (Cloudflare, 47.40) and Liquid d1-3B (16.31) (details)
- #2 of 46 — Capability (open-weight Jev-class models; #6 of 55 Jev-class models, open or API), ImageJevBench edition v0.3.0, page read 2026-10-31, its row for release v1.4.1 @d7f1b05a, measured 2026-10-28 at image temperature 1.0; ahead of Clef (Cloudflare, 58.08) and Liquid d1-3B (47.78) (details)
- #2 of 170 — Composite (open-weight Jev-class models; #12 of 201 Jev-class models, open or API), JevBench board of 2026-10-28, its row for release v1.1, measured 2026-10-04; ahead of d1 (Liquid AI, 72.82), Microsoft-Decision-1 (69.08), OpenAI Decisions (62.37) and pplx-decider-flash (Perplexity, 54.01) (details)
- #1 of 4 — Box Capability (open-weight Jev-class systems; #1 of 5 Jev-class systems, open or API; Jev-class on this
track: within 2x the latency and cost of Jev 1.14.0), ImageJevBench Box track (PREVIEW), edition v0.3.0, page read
2026-10-29, its row for release v1.4.1 through the H2O serving package, measured 2026-10-29; ahead of
Jev 1.14.0 (TypeSafe, 75.71) (details)
(measured on the main model through its own
serve.sh; these GGUF files answer Box questions through the shim, measured on our own 600-item box set, not the board's: see Image references and the Box question) - #1 of 46 — Computer-use Composite (open-weight Jev-class systems; #3 of 55 Jev-class systems, open or API, behind two API systems scored on the board's smaller hosted-API item set), ImageJevBench computer-use track, edition v0.3.0, page read 2026-10-31, its row for release v1.4.1 @d7f1b05a, measured 2026-10-28 at image temperature 1.0; ahead of Liquid d1-3B (Liquid AI, 66.22) and Clef-Flash (Cloudflare, 55.29) (details)
These board rows are the model's (the releases each row names, served as the model page describes), not these files. For these files, see the table below.
Which file should I use
Precision (-hf tag) |
Size | Native llama-server: same answer as BF16 | Native: Decision Index sample vs BF16 (95 % CI) | Native: correct / 231 | Launcher, decision_index mode: same answer as BF16 |
Launcher: Decision Index sample vs BF16 (95 % CI) | Launcher: correct / 231 |
|---|---|---|---|---|---|---|---|
:BF16 |
8.42 GB | (reference) | (reference: 58.97) | 202 | (reference) | (reference: 61.77) | 202 |
:Q8_0 (recommended) |
4.48 GB | 99.9% | −0.36 (−0.92 to +0.21), within noise | 203 | 99.7% | −0.08 (−0.45 to +0.25), within noise | 202 |
:Q5_K_M |
3.07 GB | 99.5% | −0.61 (−1.51 to +0.31), within noise | 204 | 99.1% | +0.17 (−1.16 to +1.75), within noise | 203 |
:Q4_K_M |
2.71 GB | 99.2% | +0.31 (−1.18 to +2.01), within noise | 201 | 98.7% | −0.02 (−1.15 to +1.36), within noise | 202 |
:mixed-IQ3_XXS |
2.16 GB | 98.0% | +0.09 (−1.99 to +2.16), within noise | 198 | 96.9% | −2.04 (−4.37 to +0.33), within noise | 201 |
:IQ3_XXS |
1.90 GB | 97.7% | −0.94 (−3.14 to +1.21), within noise | 199 | 96.5% | −0.32 (−2.70 to +2.20), within noise | 203 |
Blackwell GPUs and the IQ3_XXS files. On NVIDIA Blackwell GPUs, llama.cpp built with CUDA toolkit 13.2.0 or 13.2.1
gives near-random answers for :IQ3_XXS and :mixed-IQ3_XXS (h2o-lightning-4b-IQ3_XXS.gguf and
h2o-lightning-4b-mixed-IQ3_XXS.gguf; both contain IQ2_S tensors, and the IQ3_XXS file also IQ3_S tensors). This is a
compiler fault in those two toolkit releases, llama.cpp issue
#28581. Affected: compute capability 12.0 (GeForce RTX 50 series, RTX PRO 6000; we measured an RTX PRO 6000) and, as reported upstream (not tested by us), 10.x
(B200, GB200, GB300). We measured this on the previous release's (v1.4) files: on our RTX PRO 6000 with llama.cpp build 11773 built with
CUDA 13.2.0, its two IQ3 files scored 67 and 81 of JevBench's 231 questions, and 201 and 199 built with CUDA 12.9;
its other four files answered normally with CUDA 13.2.0. The v2.0 files in the table were read with CUDA 12.9 / 12.8 builds. The official llama.cpp release
downloads and Docker images are built with other toolkits and are not affected (see
Blackwell GPUs). Other GPUs, such as the L40S and H100, are not affected according to the issue; we
have not re-measured these two files on them.
Files are named h2o-lightning-4b-<TAG>.gguf, for example h2o-lightning-4b-Q8_0.gguf for :Q8_0; each also has a
stock- file for the launcher. Q8_0 is the recommended file for its size: about half of BF16, with 99.9 % of answers
the same as BF16 natively (99.7 % through the launcher) and a Decision Index score within noise of it. Q5_K_M and
Q4_K_M are smaller and also within noise of BF16 but change more answers. The two IQ3_XXS files fit tight memory but
change 2 to 3.5 % of answers; their index differences are within noise, with wide intervals (mixed-IQ3_XXS through the
launcher: −2.04, interval −4.37 to +0.33).
How the table was measured. Native: each file loaded directly into llama-server (llama.cpp build 11773, commit
7e3eeee04) and asked through its own POST /v1/systemone (one read per question), on one NVIDIA RTX PRO 6000
(Blackwell), on a fixed 2,000-row sample of the Decision Index 0.3 public text suite (14,996 questions; the toolkit's own
sampler, seed 20261024; its 0.3 scorer), with the yes/no floor of 0.801 applied (see Yes/no floor).
Launcher, decision_index mode: each stock- file through the launcher (the shim on stock llama.cpp
7e3eeee04, --mode decision_index) on NVIDIA B200s, on a second, separate 2,000-row sample of the same suite (7,825
questions, drawn after the temperatures were fixed and left out of their fit). The two samples differ, so compare
numbers within a column group, not across them. Same answer as BF16: the share of questions whose top answer equals
:BF16's on the same path, so it measures quantization alone. Decision Index sample vs BF16: the difference in the
Decision Index 0.3 index (0-100), with a 95 % confidence interval from a paired bootstrap over the toolkit's groups
within each benchmark, 1,000 draws; "within noise" where the interval includes 0. Correct / 231: JevBench's 231
public questions answered correctly, with JevBench's own CLI (commit bb05a33), on the same path.
Against the release served on vLLM 0.30.0 one-way with one read per question (the reading of the native path), :BF16
on llama.cpp gives the same top answer on 99.8 % of questions, with an index 0.07 higher (95 % CI −0.21 to +0.33) on
the first sample: the engine difference, separate from quantization. The launcher's decision_index mode matches the
release on vLLM one-way in the same mode within noise (see Modes).
Against the published v1.4 GGUF
The v2.0 launcher in decision_index mode against the v1.4 launcher as published (its own package, configuration and
pinned llama.cpp 10a60cf3, one read per question), each with the stock- file of the same precision, on the second
sample (pre-registered before any read; the v1.4 release has no stock- IQ3 files). This compares what you get from
each launcher, the new Decision Index mode included, not the weights alone.
| Precision | v1.4 launcher (published) | v2.0 launcher, decision_index mode |
Difference (95 % CI) | Same answer | Correct / 231: v1.4 launcher | v2.0 launcher, jevbench mode |
|---|---|---|---|---|---|---|
BF16 |
58.73 | 61.77 | +3.04 (+0.12 to +6.08) | 91.1% | 201 | 202 |
Q8_0 |
58.92 | 61.69 | +2.77 (+0.00 to +5.63) | 91.2% | 201 | 203 |
Q5_K_M |
59.08 | 61.94 | +2.86 (−0.92 to +5.96) | 91.3% | 203 | not read |
Q4_K_M |
57.61 | 61.75 | +4.14 (+1.00 to +7.19) | 90.9% | 201 | not read |
Images, the same way (Decision Index 0.3 public vision suite, all 12,210 rows, BF16, each launcher with its own
projector; the kit's own score, the top answer per row; paired 95 % intervals over rows within each benchmark):
| Vision index | Difference vs v1.4 launcher (95 % CI) | Rows not read | |
|---|---|---|---|
| v1.4 launcher (published; 1,024 image tokens) | 61.62 | 468 | |
v2.0 launcher, decision_index mode (1,600 image tokens) |
68.54 | +6.92 (+5.73 to +8.05) | 0 |
Most of the gain over v1.4 is the 468 RealWorldQA WebP rows v1.4 cannot decode; on the 11,742 rows both versions read, v2.0 is +0.86 (95% CI −0.32 to +2.11).
The v2.0 row is one full read of the final package (commit 3f11fbb6a) started by its own launcher, with Pillow 13.0.0 and CUDA graphs off. The 468 rows are RealWorldQA's
WebP images, which llama.cpp cannot decode: the v1.4 launcher refuses them (scored wrong), and the v2.0 launcher
converts them to PNG with Pillow, a required dependency for images (see Run with one command).
These files need llama.cpp build 11773 (commit 7e3eeee04) or later (see How to run); every precision
also has a stock- file for the shim. Image decisions also need the vision projector, mmproj-lightning-f16.gguf
(0.67 GB, loaded automatically by -hf).
How to run
There are two ways; both use the same weights.
- llama.cpp, build 11773 (commit
7e3eeee04) or later:llama-serveranswers decisions itself onPOST /v1/systemone, using the files in the table. Runllama-server -hf h2oai/h2o-lightning-4b-gguf:Q8_0 ...with the tag of the file you chose (details). It reads images; it has noboxquestion type. - The included Python shim on a pinned llama.cpp: an unmodified
llama-serverat build 11773 (commit7e3eeee04) runs the model and the shim serves the decision API. Use thestock-file of the same precision, for exampleh2o-lightning-4b-stock-Q8_0.gguf(every precision in the table has one). The one-command launcher downloads, checks and starts everything for any of these, and reads images by default.
llama.cpp builds older than 11773 cannot load the files in the table (they do not know the decision type), and
llama-server with a stock- file alone gives ordinary chat, not the decision API.
About the files
Each file in the table has the same weights, tensor for tensor, as its stock- copy, plus decision
metadata: the decision type h2o-lightning, the option labels, the per-type temperatures, the temperature for
requests with images, the prompt template, the Qwen3.5 pre-tokenizer setting and the NFC normalization flag (see
Differences from the shim). The files are quantized from the released weights with
llama.cpp's default per-tensor types and an importance matrix; the mixed IQ3_XXS file keeps a few small projections
at 6 to 8 bits: in the recurrent layers, the decay and update-strength projections (8-bit) and the output gate and
output projections (6-bit); in the attention layers, the output projection (6-bit). The model's multi-token-prediction
head, which decisions never use, is not included.
With no tag, llama-server -hf h2oai/h2o-lightning-4b-gguf picks Q4_K_M (llama.cpp's default when no tag is given,
not our recommendation); add :Q8_0 for the recommended file. A stock- copy is picked with its full tag, for example
:stock-Q4_K_M.
Storage sizes exclude runtime memory. Sizes and SHA-256 hashes of all files are in artifact_manifest_v6.json; if your copy's SHA-256 does not match, download it again. Older versions: see the repo's tags.
llama.cpp
Get llama-server
Use llama.cpp build 11773 (commit 7e3eeee04) or later: a release tagged b11773 or higher from
github.com/ggml-org/llama.cpp/releases, or a build from source.
Building needs Git, CMake and a C++ compiler; CUDA also needs a CUDA toolkit; -hf downloads need OpenSSL headers (for
example libssl-dev).
git clone https://github.com/ggml-org/llama.cpp
cd llama.cpp
# CPU
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release -j --target llama-server
# or CUDA
cmake -B build -DGGML_CUDA=ON -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release -j --target llama-server
./build/bin/llama-server --version shows the build number (it counts the commits, so it needs a full clone; a
shallow one reports build 1).
Blackwell GPUs
On a Blackwell GPU (GeForce RTX 50 series, RTX PRO 6000, B200, GB200, GB300), a build made with CUDA toolkit 13.2.0 or 13.2.1 gives wrong results for the IQ3_XXS files (see the note under the table). Check the toolkit before building:
nvcc --version
If it says release 13.2, V13.2.51 (13.2.0) or release 13.2, V13.2.78 (13.2.1), install CUDA 12.9 (or 13.2.2 or
later, per the issue) next to it, for example on Ubuntu with NVIDIA's CUDA apt repository set up, and build with that compiler:
sudo apt install cuda-toolkit-12-9
git clone https://github.com/ggml-org/llama.cpp
cd llama.cpp
cmake -B build -DGGML_CUDA=ON -DCMAKE_CUDA_COMPILER=/usr/local/cuda-12.9/bin/nvcc -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release -j --target llama-server test-backend-ops
Then check the GPU's matrix-multiplication kernels:
./build/bin/test-backend-ops -b CUDA0 test -o MUL_MAT
A good build ends with Backend CUDA0: OK and no FAIL lines. On our RTX PRO 6000, a CUDA 12.9 build of the current
llama.cpp (build 11923) passed all 2,445 MUL_MAT tests; the same source built with CUDA 13.2.0 failed 147 of them, all on
type_a=iq1_s, type_a=iq2_s and type_a=iq3_s lines.
The release downloads need no rebuild: the Ubuntu CUDA 12.8 and CUDA 13.4 builds on
github.com/ggml-org/llama.cpp/releases (they need glibc 2.38, for
example Ubuntu 24.04) and the Docker images ghcr.io/ggml-org/llama.cpp:server-cuda (CUDA 12.8) and :server-cuda13
(CUDA 13.4) scored 201 of 231 with :IQ3_XXS on our RTX PRO 6000 (release b11773; the images as pulled on
2026-10-27).
Run
./build/bin/llama-server -hf h2oai/h2o-lightning-4b-gguf:Q8_0 --alias h2oai/h2o-lightning-4b \
-c 40960 -np 1 --no-kv-unified --image-max-tokens 1600 --port 8080
# or with downloaded files
hf download h2oai/h2o-lightning-4b-gguf h2o-lightning-4b-Q8_0.gguf mmproj-lightning-f16.gguf --local-dir .
./build/bin/llama-server -m h2o-lightning-4b-Q8_0.gguf --mmproj mmproj-lightning-f16.gguf --alias h2oai/h2o-lightning-4b \
-c 40960 -np 1 --no-kv-unified --image-max-tokens 1600 --port 8080
These are the settings the numbers on this card were measured with. -c 40960 leaves room for a 32,000-token state
plus the question; -np 1 --no-kv-unified gives one slot the whole context (with more slots, the questions of one
request share the state's prompt and their probabilities can differ slightly); --image-max-tokens 1600 reads an
image at up to about 1.6 megapixels, as the model's vLLM serving does (1,638,400 pixels; the image temperatures were
fitted at the same 1,600 tokens per image); --alias sets the model field of the response. Use another tag from
the table for another precision. llama.cpp offloads to a GPU when it finds one; -ngl
controls it. -hf also loads the vision projector; pass --no-mmproj for text only.
Request
curl http://127.0.0.1:8080/v1/systemone -H 'Content-Type: application/json' -d '{
"state": {"customer": "I was charged twice for order 1182 and nobody has replied.", "plan": "pro"},
"questions": {
"route": {"type": "choice", "instructions": "Which team should handle this?", "criteria": {"billing": "payments and refunds", "shipping": "delivery problems", "technical": "app or website errors"}},
"angry": {"type": "noul", "instructions": "Is the customer upset?"},
"urgency": {"type": "score", "instructions": "How urgent is this?", "criteria": ["can wait", "this week", "today", "right now"]}}}'
Response, measured with the BF16 file on one NVIDIA RTX PRO 6000 (numbers rounded to 4 digits here):
{
"model": "h2oai/h2o-lightning-4b",
"answers": {
"route": {"type": "choice", "choice": "billing",
"probabilities": {"billing": 0.9234, "shipping": 0.0328, "technical": 0.0438}, "confidence": 0.8851},
"angry": {"type": "noul", "noul": 0.8873},
"urgency": {"type": "score", "score": 2.5619,
"legend": {"0": "can wait", "1": "this week", "2": "today", "3": "right now"},
"probabilities": {"0": 0.0390, "1": 0.0639, "2": 0.1934, "3": 0.7038}, "confidence": 0.5619}
},
"usage": {"input_tokens": 311, "output_tokens": 0}
}
Images go in a top-level images array of data URLs ("images": ["data:image/png;base64,..."]).
Yes/no floor
noul probabilities are the raw calibrated values. llama-server applies no yes/no floor (it ignores a "noul_floor"
request field); the model's vLLM serving and the included shim apply a floor of 0.801 by default: a noul
probability between 0.199 and 0.801 is moved to the nearer of the two, so the answer does not change; set
SHIM_NOUL_FLOOR=0 in the launcher's environment to turn it off. To get the floored numbers from llama-server, apply
the floor to the returned value: if max(p, 1 - p) < 0.801: p = 0.801 if p >= 0.5 else 0.199.
Parity with the shim
On the same llama.cpp server (build 11773) and the BF16 file, llama-server's own /v1/systemone and the shim (in its
jevbench mode, one read per question, floor off) were compared on 21 test questions: on the 10 that hit none of the
differences below, the prompts were identical, the top answers the same and the probabilities within 0.0003; the other
11 were built to hit a listed difference (or a state over 16,000 tokens) and differ as described. The shim's default
mode (aa) adds a second read for a text question answered with confidence under 0.9, which llama-server does not.
Differences from the shim
- Text normalization: the shim converts text to the standard composed Unicode form (NFC) before tokenizing it;
llama.cpp tokenizes it as sent, so text that is not in NFC (for example "é" written as "e" plus a separate accent
mark) can give different tokens and different answers. Most text is already NFC. To be safe, normalize every string
you send, including JSON keys and nested values, with
unicodedata.normalize("NFC", text)in Python. The files in the table carry thetokenizer.ggml.normalizer.nfcflag, which llama.cpp does not yet apply for this model's tokenizer type. - Numbers: integers beyond 64 bits in a JSON state are written as floats.
- Response: llama.cpp's shape,
model,answersandusage(input_tokens,output_tokens). The shim's extra fields (probability_source,effort_used,usage.latency_ms,threshold/decisionfor anoulthreshold) are not returned. - Floor: not applied by llama-server; the shim applies 0.801 by default (see Yes/no floor).
- Images: send them as data URLs in the top-level
imagesarray (or asimage_urlparts of chat messages instate). Images elsewhere instate, http(s) URLs, multipart uploads and the shim's other image fields (image,image_url,image_urls,image_data,image_base64) are not read as images; there is no 4-image cap (llama.cpp takes up to 8) and no[image N]placeholder in the state. - Control tokens: both quote the model's control-token spellings (such as
<|im_end|>) written in request text, so they are read as text; the shim'sSHIM_LLAMA_QUOTE_CONTROLS=0turns that off. - Temperatures: the files carry one temperature for every request with images and one per option-count bucket (see the top of this card); the shim uses one per option count.
- Image references (
assets) are read by the shim only. Box questions: llama-server's own/v1/systemonehas noboxquestion type; the shim answers them by default and refuses them (HTTP 422) withSHIM_LLAMA_BOX=0(see Image references and the Box question).
The shim on a pinned llama.cpp
Run with one command
Requires Python 3.12, Git, CMake and a C++ compiler. Install the Python dependencies, every one pinned by version and
wheel hash (huggingface_hub 1.32.0, pillow 13.0.0 and what they need), with
python -m pip install --require-hashes -r https://huggingface.co/h2oai/h2o-lightning-4b-gguf/resolve/c76cf6b36f4ac7cd2648b9226b8b74f7685e61eb/package/requirements.txt.
Pillow is needed for images: the launcher stops at start without it, or with a Pillow older than 13.0.0 or built with a
libwebp older than 1.3.2 (CVE-2023-4863), unless you pass --text-only. Images over 16,777,216 pixels
(4096 x 4096) are refused with HTTP 422. CUDA additionally requires a compatible CUDA toolkit. No Hugging Face login is required.
python -c 'import hashlib,runpy; from huggingface_hub import hf_hub_download; p=hf_hub_download("h2oai/h2o-lightning-4b-gguf","bootstrap.py",revision="8a15e8470b3b98f10fa2aa3f9567f8db57bbe4fb",token=False); assert hashlib.sha256(open(p,"rb").read()).hexdigest()=="7705586566dd032170355e281188970a1428147ec732ab8144448f0a34a27225"; runpy.run_path(p,run_name="__main__")' --backend cpu
BF16 is the default; --variant picks another precision: Q8_0 (the recommended smaller file), Q5_K_M, Q4_K_M,
IQ3_XXS or mixed-IQ3_XXS (see Which file should I use). Use
--backend cuda --gpu 0 for CUDA. Images are on by default (the launcher downloads the vision projector);
--text-only leaves it out, and then image questions are refused. --prepare-only downloads and verifies without
building or starting a server.
The launcher downloads pinned code and the stock- file of the chosen precision (checked by SHA-256), builds stock
llama.cpp at 7e3eeee0480902c90cbdff172f407dc063cf0770 (build 11773), checks provenance and 48 tokenizer probes,
then starts the stock backend and the shim. For decisions, use the launcher; a stock- file loaded directly into
llama-server gives ordinary chat. Ctrl-C stops its owned children. Logs remain in lightning-llamacpp-logs/.
In another terminal:
curl http://127.0.0.1:8761/v1/systemone -H 'Content-Type: application/json' -d '{"state":{"status":"paid"},"questions":{"status":{"type":"choice","instructions":"What status is recorded?","criteria":{"a":"paid","b":"unpaid"}}}}'
The backend has one 40,960-token slot; concurrent requests queue. State text is capped at 32,000 tokens in the
decision_index and aa modes and 16,000 in jevbench mode, with head/tail truncation. Full question/instruction overhead still needs to fit. Images are read with llama.cpp's image budget of 1,600 tokens each (--image-max-tokens 1600, about 1.6 megapixels, as
the model's vLLM serving; the image temperatures were fitted at the same budget).
Up to 4 images per request by default; set MAX_IMAGES=N (1 to 16) before starting to allow up to N (each image takes up to
1,600 tokens of the 40,960-token slot: a long state sent with images is cut to leave them room). Control-token
spellings in request text are quoted by default (set SHIM_LLAMA_QUOTE_CONTROLS=0 to read them as control tokens),
the required Qwen3.5/NFC tokenizer normalization is applied by the shim, and llama-server's prompt cache is off
(SHIM_LLAMA_CACHE_PROMPT=0) unless you set it; direct completion calls do not apply that contract. Box questions are
answered (SHIM_LLAMA_BOX=0 refuses them). JPEG and PNG images are sent to llama.cpp as they are; any other image
(WebP, which llama.cpp cannot decode at all, GIF, TIFF, BMP, and PNG with an alpha channel) is converted by the shim
with Pillow, at full resolution, to a PNG of the pixels the model's vLLM serving reads (transparency on white);
llama-server on its own refuses WebP. CUDA graphs are off when images are enabled: llama.cpp image requests hang with
graphs on B200 (seen at build 7e3eeee04). The launcher sets GGML_CUDA_DISABLE_GRAPHS=1 for llama-server whenever the
projector is loaded; set GGML_CUDA_DISABLE_GRAPHS=0 before starting to keep graphs on.
Modes
The launcher serves the same request modes as the full v2.0 shim, with the same names. --mode on the launcher (or
SHIM_DEFAULT_MODE) sets the server's default; a request can pick its own with "mode" (or kwargs.mode), and the
response reports it in effort_used.mode. An unknown mode is refused (400 for a request; the launcher will not start
with an unknown default), and the launcher checks that the server it started serves the default you asked for.
| Mode | What it does | DI 0.3 slice index (launcher, BF16) | Full v2.0 on vLLM, one-way, same mode | Difference [95% CI] | Same top answer |
|---|---|---|---|---|---|
aa (default) |
decision_index plus the "I don't know" cutoff: on a choice question that offers an "I don't know" option, the answer is "I don't know" when the other options' renormalised top is under 0.80 (as the full model on vLLM) |
not read separately | - | - | - |
decision_index |
the conditional text re-read (below 0.90), state up to 32,000 tokens | 61.90 | 62.07 | -0.17 [-0.62, +0.17] | 99.95% |
jevbench |
one read per question, state cut at 16,000 tokens | 58.95 | 58.90 | +0.05 [-0.15, +0.27] | 99.93% |
python -c '...as above...' --backend cuda --gpu 0 --mode decision_index
curl http://127.0.0.1:8761/v1/systemone -H 'Content-Type: application/json' -d '{"mode":"jevbench","state":{"status":"paid"},"questions":{"status":{"type":"choice","instructions":"What status is recorded?","criteria":{"a":"paid","b":"unpaid"}}}}'
Measured on the 2,000-row DI 0.3 text slice (14,996 questions) with the yes/no floor 0.801 on both sides, 1,000-draw
grouped bootstrap, with the package's temperatures before their final refit (choice 3 / 4 options 0.97 / 0.84; now 0.94 / 0.83). Each mode is the full shim's own code path: the package's tests serve every default and every
request mode from this launcher and from the full v2.0 shim and require identical answers. Choose decision_index (or
the default) for decisions. The default now re-reads a question when the first read is unsure (below 0.90), so a
request can take more time and tokens than the single read of the v1.4 GGUF launcher; jevbench reproduces the one-read reading JevBench scores use. In decision_index mode the
launcher scores about 3 points above its jevbench mode on this slice (61.90 vs 58.95).
What the GGUF does not do that the full model does, in every mode: it reads one-way with no calibration head (the full model served two-way with its head scores 63.94 on the same slice, 2.04 above the GGUF in decision_index mode); the image re-read is off (image questions are read once); the state cap is 32,000 tokens (llama.cpp's 40,960-token slot) where the full model's decision-index profile allows 126,976; and the GGUF uses its own fitted temperatures. With the full v2.0 temperatures instead, decision_index mode scores 61.81 (-0.26 [-0.67, 0.00] vs the full model one-way), so the temperatures are not where the difference is.
Image references and the Box question
Images can be sent by reference: put each image once under "assets"
({"<ref>": {"type": "image", "format": "png", "data_base64": "..."}}, "jpg" for JPEG) and write <ref> wherever
the image belongs in state; the shim replaces the reference with the image. References match as plain text, so
every occurrence counts, even inside a longer word (photo also matches "a photo of"); each distinct reference is
sent to the model once, and every occurrence points at that image. Pick references that cannot occur in your text,
such as IMG_1. PNG and JPEG only, 16 MiB per file,
every asset referenced at least once, no URL fetching; a malformed asset map is a 400.
A box question, {"type": "box", "instructions": "the coffee mug in `photo`"}, answers with a bounding box
{"left", "top", "right", "bottom"} in fractions of the image, confidence, present (the probability that the
target is in the image) and found (whether a box was located; if not, the box is the whole image with confidence 0).
Box questions are answered by default when images are on (SHIM_LLAMA_BOX=0 in the launcher's environment refuses
them with HTTP 422). The box comes from one constrained generation, so the backend must accept a JSON-schema response
format; one that does not refuses a request with a box question with HTTP 422, and requests without one are unaffected.
The box is not generated exactly as on the model's vLLM serving (llama.cpp's constrained generation and image
preprocessing differ), so we measured it: on our own 600-item box set (RefCOCOg val referring expressions, disjoint by
image from the box items the calibration was fitted on; not the board's items), the BF16 file through the launcher
against the full model on vLLM, same requests, paired over items:
| GGUF BF16 (launcher) | full model (vLLM) | GGUF − vLLM [95% CI] | |
|---|---|---|---|
| Mean IoU × 100 | 80.71 | 80.88 | −0.17 [−0.77, 0.41] |
| IoU ≥ 0.5 | 87.0 % | 87.8 % | −0.8 pt [−1.8, 0.0] |
| Calibration, 100 × (1 − ECE/0.5) | 96.08 | 94.11 | +1.97 [−1.76, 3.53] |
| Box capability (mean of IoU × 100 and calibration) | 88.39 | 87.49 | +0.90 [−0.93, 1.57] |
The two agree on IoU ≥ 0.5 for 98.8 % of the items (mean absolute IoU difference 0.011). Both use the shipped confidence map (a 0.7165, b 2.1989); the files' Box answers were measured on BF16 only.
On a --text-only launch, a box question
is refused with HTTP 422 and a message naming images. Both go through the shim; the /v1/systemone endpoint of llama-server reads
neither.
ImageJevBench's Box track is measured on the main model through its own serve.sh, not on these files: see
For benchmark maintainers: ImageJevBench Box track.
License
Apache-2.0, Copyright 2026 H2O.ai, Inc. See LICENSE and package/NOTICE. Built on
Qwen/Qwen3.5-4B (Apache-2.0, Copyright Alibaba Cloud); runs on
llama.cpp (MIT). The shim's third-party portions are under the licences in
package/ (LICENSE-cygnet, LICENSE-flexdm, LICENSE-wcole3 and LICENSE-APACHE-2.0), as package/NOTICE lists.
- Downloads last month
- 25,685
3-bit
4-bit
5-bit
8-bit
16-bit

