Instructions to use netprojects/h2o-lightning-4b-mlx-q4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use netprojects/h2o-lightning-4b-mlx-q4 with MLX:
# Make sure mlx-vlm is installed # pip install --upgrade mlx-vlm from mlx_vlm import load, generate from mlx_vlm.prompt_utils import apply_chat_template from mlx_vlm.utils import load_config # Load the model model, processor = load("netprojects/h2o-lightning-4b-mlx-q4") config = load_config("netprojects/h2o-lightning-4b-mlx-q4") # Prepare input image = ["http://images.cocodataset.org/val2017/000000039769.jpg"] prompt = "Describe this image." # Apply chat template formatted_prompt = apply_chat_template( processor, config, prompt, num_images=1 ) # Generate output output = generate(model, processor, formatted_prompt, image) print(output) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use netprojects/h2o-lightning-4b-mlx-q4 with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "netprojects/h2o-lightning-4b-mlx-q4"
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "netprojects/h2o-lightning-4b-mlx-q4" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent
How to use netprojects/h2o-lightning-4b-mlx-q4 with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "netprojects/h2o-lightning-4b-mlx-q4"
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 netprojects/h2o-lightning-4b-mlx-q4
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use netprojects/h2o-lightning-4b-mlx-q4 with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "netprojects/h2o-lightning-4b-mlx-q4"
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 "netprojects/h2o-lightning-4b-mlx-q4" \ --custom-provider-id mlx-lm \ --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 β MLX 4-bit
Built and tested on Apple M5 Max (128 GB) Β· upstream revision H2O-Lightning-4B v1.4.2 (708e939)
A 4-bit MLX conversion (affine, group size 64; mlx-vlm 0.7.8) of h2oai/h2o-lightning-4b v1.4.2 (commit 708e93926a034195d908e033fcb796c55398a6f5; the weights are unchanged since v1.4.1, so this build was not reconverted), for Apple Silicon. 2.9 GB. The smallest build, for one-way reading. Box questions work.
Published by NetProjects (Internet Projects Ltd). Not affiliated with H2O.ai. Linked from H2O.ai's official model card.
This is a decision model, not a chat model. It returns a probability for each answer option (or, for a Box question, a bounding box), not free text.
Serve it with the H2O shim, not with
mlx_lm.serveror a plainmlx_vlmgenerate call. The generic "Use this model" snippets Hugging Face shows for MLX models do not return the label probabilities this model is made for. The commands below set it up with H2O's official shim, unmodified, on top of h2o-lightning-mlx, which reads the label log-probabilities with a float32 head, as the original does on vLLM.
JevBench public (231, JevBench v1.2.1, --adapter typesafe), one-way, v1.4.2 serving files (29 October 2026) |
|
|---|---|
| this checkpoint | 205 / 231 (48/48 Β· 71/72 Β· 86/111) |
| original weights on MLX (bf16) | 201 / 231 (48/48 Β· 70/72 Β· 83/111) |
| H2O's model card (vLLM), one-way | 202 / 231 |
| vs bf16 on MLX | 221 / 231 answers identical; probability drift mean 0.035, p95 0.160 |
Which build? This build serves one-way reading: start it with TWO_WAY=0. (H2O's shim checks a build against its recorded two-way answers before serving two-way; this 4-bit build is 0.090 away, above the 0.05 tolerance, so the shim keeps it to one-way.) For H2O's two-way reading (205 / 231; H2O's own result 206) and for the closest match to the original's calibration, use the 8-bit build (4.8 GB).
Box questions (always on since v1.4.0) work on this build too: on H2O's receipt example it finds the total-amount line with confidence 0.90 (8-bit: 0.97).
Speed (MacBook Pro M5 Max, 27 October 2026, through serve.sh, one request at a time): about 59 ms per JevBench item, a 2,000-token record in 0.36 s, a 32K-token state in 7.4 s. MLX peak memory 5.7 GB at 4K tokens and 6.8 GB at 32K.
Images. Image input works through the unchanged shim. On H2O's own receipt example this build gives the same answers as the original weights. It is not a reproduction of H2O's image benchmark.
About v1.4.1 (from H2O's card): the v1.4.0 fine-tune continued on more training data, with unchanged calibration constants; stronger on retrieval and on six task families the added data covers, level on H2O's held-out decision skills overall. This build ships the training tokenizer (tokenizer/), which the shim checks at start.
v1.4.2 (29 October 2026). Carries v1.4.2 (708e939): weights unchanged, new serving files (H2O's shim and serve_config.json; the matching serve.sh options are in h2o-lightning-mlx). Yes/no answers are now served without the 0.801 floor by default (H2O's routing mode is the default); PROFILE=di ./serve.sh (h2o-lightning-mlx) restores the floor and turns on H2O's Decision Index re-read (a choice or score question under 0.8 is read once more with the input written twice, 2:1 in favour of the first read). Images up to 1,638,400 pixels are read whole (was 1,048,576); larger ones are resized to that size, as on vLLM (this needs h2o-lightning-mlx at v1.4.2, whose facade now applies the shim's image size cap). A request may also give the attention mode as kwargs.attention_mode, as on H2O's hosted gateway. A client that disconnects before its answer no longer leaves an error in the server log. Checked on this build: JevBench public 205 / 231 one-way, re-measured with the v1.4.2 files (original weights on MLX: 201 / 231; 221 / 231 identical answers); tokenizer contract 24 / 24, text, image and Box requests, kwargs.attention_mode (one-way; a two-way request is refused, as before), and the new image size limit.
28 October 2026 revision. H2O updated v1.4.1 in place; the weights did not change, so this build was not reconverted, and it now ships the updated shim, serve_config.json and the new selector_v2.py. Over-long records are now trimmed to fit the context by BM25 selection instead of a fixed cut at 32,000 tokens, so a request never fails for length: on a 60,000-token test record with one key line in the middle, this build now answers correctly (0.95, one-way). Image answers are read at temperature 1.0 instead of 0.65: the top answers stay the same and the confidence values are lower (receipt item count 0.94 β 0.81 one-way). Text requests that fit the context are read exactly as before.
Limits (as for the original): mostly evaluated in English; works best with about 16 answer options or fewer; no explanations and no video input.
git clone https://github.com/internet-projects/h2o-lightning-mlx && cd h2o-lightning-mlx && ./setup.sh
hf download netprojects/h2o-lightning-4b-mlx-q4 --local-dir mlx-q4
TWO_WAY=0 MODEL=mlx-q4 ./serve.sh # http://127.0.0.1:8741/v1/systemone
Versions. main is H2O v1.4.2 (tag v1.4.2). The 28 October v1.4.1 files stay available with --revision v1.4.1-oct28, and the original 27 October v1.4.1 files with --revision v1.4.1-initial. Earlier builds stay available: H2O v1.4.0 (one-way, 202 / 231) with --revision v1.4.0, H2O v1.3.1 (one-way, 199 / 231) with --revision v1.3.1, and H2O v1.2.3 (207 / 231) with --revision v1.2.3; use each with the matching tag in the GitHub repo.
Credits: H2O.ai (H2O-Lightning-4B, Apache-2.0), Qwen team (Qwen3.5-4B, Apache-2.0). This conversion is not affiliated with H2O.ai.
More NetProjects MLX builds: NetProjects MLX builds collection Β· all models at huggingface.co/netprojects
- Downloads last month
- 436
4-bit