selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

h2oai logo

h2o-lightning-31b

h2oai·Instruct·released 20 Oct 2026

h2o-model-non-commercial-licence-v1.131.3B≈21 GBgated
Your GPU
vllm serve h2oai/h2o-lightning-31b
All 3 runners ↓

H2O-Lightning-31B is a 31B-parameter decision model from H2O.ai, built on google/gemma-4-31B-it. It answers typed decision questions about a record (a document, a ticket, a policy, a conversation), and about images that come with the record. It returns a probability for every option:

Notify me when

How much VRAM does h2o-lightning-31b need?

At Q4_K_M h2o-lightning-31b needs about 21 GB with an 8K context (21 GB at Q4, 64 GB at full precision). Pick your GPU to see what fits and how fast it runs.

--vram
any
--gpus
--quant

Needs: ≈21 GB · Q4_K_M · 8K context — Pick a GPU to check the fit.

Change quant, context or KV cache to compare
Advanced: context 8K · KV cache 16-bit
Context
KV cache

Smallest GPU for each quant and context (KV cache 16-bit)

Quantisation4K8K16K32K64K128K
Q3_K_M
Q4_K_M
Q5_K_M
Q6_K
Q8_0
FP16

≤16 GB card24–32 GB48–96 GBmore

QuantisationQualityWeightsKV cacheTotal
Q2_KHeavy lossSmallest, noticeably worse qualityHeavy loss9.6 GB 2.0 GB*≈13 GB
Q3_K_MNoticeable lossSmall, some quality lossNoticeable loss14 GB 2.0 GB*≈17 GB
Q4_K_MrecommendedSmall lossRecommended default for local useSmall loss18 GB 2.0 GB*≈21 GB
Q5_K_MNear-losslessNear-lossless for most tasksNear-lossless21 GB 2.0 GB*≈24 GB
Q6_KNear-losslessPractically losslessNear-lossless24 GB 2.0 GB*≈28 GB
Q8_0LosslessLossless in practice, twice the size of Q4Lossless31 GB 2.0 GB*≈35 GB
FP16 / BF16LosslessFull precision, as releasedLossless58 GB 2.0 GB*≈64 GB

Estimates for 8K tokens of context: weights + KV cache + runtime overhead. Speed assumes memory-bound decoding at your GPU’s bandwidth. Pick a GPU above and the fit column checks every row against it.

How to pick a quant

Take the biggest quant that fits with room left for context. Q4_K_M is the usual sweet spot. Below Q4 quality drops fast, above Q6 you mostly pay memory for nothing. Big models (70B+, large MoE) tolerate low quants better than small ones.

  • LosslessF16, Q8_0
  • Near-losslessQ6_K, Q5_K_M
  • Small lossQ5_K_S, Q4_K_M, IQ4_NL, IQ4_XS, Q4_K_S
  • Noticeable lossQ4_0, Q3_K_L, Q3_K_M, IQ3_M
  • Heavy lossIQ3_XXS, Q3_K_S, IQ2_M, Q2_K

Typical quality loss, not measured per model. Tiers come from KL divergence against FP16 on Llama 3 8B: llama.cpp perplexity README: LLaMA 3 8B scoreboard (KLD and ΔPPL vs FP16, Wikitext-2); llama.cpp quantize tool: ΔPPL per quant type @ Llama-3-8B

How much context fits?

Model quant
KV cache

At 8K context, Q4_K_M needs ≈21 GB(18 GB weights + 2.0 GB KV cache + 1.4 GB overhead). Pick a GPU above to see how much context fits.

02040601K2K4K8K16K32K64K128KGB

Weights + overheadKV cache

Can the Tesla P40 run h2o-lightning-31b? →

Speed vs quality per quant

Smaller quants run faster and fit in less memory, but lose quality.

Q2_KQ3_K_MQ4_K_MQ5_K_MQ6_KQ8_0F16

Fits in VRAMTight fitCPU offload✕ won't runQuality is typical KL divergence vs FP16, not measured for this model.

Real-world speed of h2o-lightning-31b

Tokens per second measured by people running it at home. A GPU shows a median once 3 reports agree on the same setup. Reports far from our estimate wait for a review. Measure yours with llama-bench →

No medians yet. Be one of the first 3 to report a setup.

All reports

Run h2o-lightning-31b locally

These commands load the original weights from Hugging Face.

Serve an OpenAI-compatible APIdocs
vllm serve h2oai/h2o-lightning-31b

Gated on Hugging Face: accept the licence on the model page and export HF_TOKEN first.

Docker Compose (NVIDIA)docs
yaml
services:
  vllm:
    image: vllm/vllm-openai:latest
    command: h2oai/h2o-lightning-31b
    ports:
      - "8000:8000"
    ipc: host
    volumes:
      - ~/.cache/huggingface:/root/.cache/huggingface
    environment:
      - HF_TOKEN=${HF_TOKEN}
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: all
              capabilities: [gpu]

API on port 8000.

Install vLLM

Serve an OpenAI-compatible APIdocs
sglang serve h2oai/h2o-lightning-31b --host 0.0.0.0 --port 30000

Gated on Hugging Face: accept the licence on the model page and export HF_TOKEN first.

Docker Compose (NVIDIA)docs
yaml
services:
  sglang:
    image: lmsysorg/sglang:latest
    command: sglang serve h2oai/h2o-lightning-31b --host 0.0.0.0 --port 30000
    ports:
      - "30000:30000"
    ipc: host
    volumes:
      - ~/.cache/huggingface:/root/.cache/huggingface
    environment:
      - HF_TOKEN=${HF_TOKEN}
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: all
              capabilities: [gpu]

API on port 30000.

Install SGLang

Ask about an imagedocs
python
from transformers import pipeline

pipe = pipeline("image-text-to-text", model="h2oai/h2o-lightning-31b", dtype="auto", device_map="auto")
messages = [
    {
        "role": "user",
        "content": [
            {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/bee.jpg"},
            {"type": "text", "text": "Describe this image."},
        ],
    }
]
out = pipe(text=messages, max_new_tokens=256)
print(out[0]["generated_text"][-1]["content"])

Gated on Hugging Face: accept the licence on the model page and export HF_TOKEN first.

Install Transformers

  • llama.cpp logollama.cppofficial · inference server

About h2o-lightning-31b

H2O-Lightning-31B is a 31B-parameter decision model from H2O.ai, built on google/gemma-4-31B-it. It answers typed decision questions about a record (a document, a ticket, a policy, a conversation), and about images that come with the record. It returns a probability for every option: • choice: picks one of a set of named options. • yes/no (noul): gives the probability that a statement is true. • score: gives an ordinal level on a stated scale, with its probability distribution.

Full model card on Hugging Face →

Alternatives to h2o-lightning-31b

All alternatives →
Qwen logo

Qwen3.8-27B

Qwen·Vision

≈19 GB

Following the widespread community adoption of the Qwen3.5 and Qwen3.6 series, we are pleased to introduce Qwen3.8, the most capable generation in the Qwen open-model family to date.

27.8B256K ctx Apache 2.0
6.6MAug 2026ollama
google logo

gemma-4-31B-it

google·Vision

≈27 GB

Gemma is a family of open models built by Google DeepMind. Gemma 4 models are multimodal, handling text and image input (with audio supported on E2B, E4B, and 12B) and generating text output. This release includes open-weights models in both pre-trained and instruction-tuned variants.

31.3B256K ctx Apache 2.0
6.1MMar 2026ollama
openbmb logo

MiniCPM-V-4.7-35B-A3B

openbmb·Vision

≈22 GB

GitHub · On-device results · Evaluation · Examples · Usage · Model weights

35.2BA3B256K ctx Apache 2.0
869KOct 2026gguf
Qwen logo

Qwen3.6-35B-A3B

Qwen·Vision

≈22 GB

Following the February release of the Qwen3.5 series, we're pleased to share the first open-weight variant of Qwen3.6. Built on direct feedback from the community, Qwen3.6 prioritizes stability and real-world utility, offering developers a more intuitive, responsive, and genuinely productive coding…

36BA3B256K ctx Apache 2.0
3.9MApr 2026ollama
Qwen logo

Qwen3.6-27B

Qwen·Vision

≈19 GB

Following the February release of the Qwen3.5 series, we're pleased to share the first open-weight variant of Qwen3.6. Built on direct feedback from the community, Qwen3.6 prioritizes stability and real-world utility, offering developers a more intuitive, responsive, and genuinely productive coding…

27.8B256K ctx Apache 2.0
2.5MApr 2026ollama
google logo

gemma-4-26B-A4B-it

google·Vision

≈18 GB

Gemma is a family of open models built by Google DeepMind. Gemma 4 models are multimodal, handling text and image input (with audio supported on E2B, E4B, and 12B) and generating text output. This release includes open-weights models in both pre-trained and instruction-tuned variants.

25.8BA4B256K ctx Apache 2.0
4.9MMar 2026ollama

h2o-lightning-31b FAQ

How much VRAM does h2o-lightning-31b need?
About 21 GB at Q4_K_M with an 8K context. Q8_0 needs about 35 GB and full precision about 64 GB. Longer contexts need more memory for the KV cache.
Can h2o-lightning-31b run on the Tesla P40?
Yes. It fits at Q4_K_M (about 21 GB), at an estimated 10 tokens/s. It fits comfortably on the Radeon RX 7900 XTX, Instinct MI50 32GB, RTX 5090.
Can I use h2o-lightning-31b commercially?
No. It is released under h2o-model-non-commercial-licence-v1.1. Custom licence: read the model card before using it commercially.
How do I run h2o-lightning-31b locally?
With vLLM: vllm serve h2oai/h2o-lightning-31b.

Data from Hugging Face, the model card and public leaderboards. Memory and speed figures are estimates; real numbers depend on the runtime, context length and drivers. Always check the licence yourself before commercial use.