Instructions to use jesdga/Gemma-4-Basalt with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Basalt
How to use jesdga/Gemma-4-Basalt with Basalt:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Gemma 4 for Basalt
Website: basalt.jgulfo.com
Model files for Basalt, a local inference engine for NVIDIA Blackwell GPUs (sm_120) with an OpenAI- and Anthropic-compatible API. Basalt runs every model here on one Blackwell card: weights on the card, the token embedding in system RAM. Needs Basalt 0.6.0 or later.
Each file is self-contained: weights, the tokenizer and chat template, Google's assistant drafter and, where the table of models says so, the vision tower. Each is built from Google's BF16 instruction checkpoint.
Files
| file | size | what it is |
|---|---|---|
Gemma-4-26B-A4B-it-NVFP4-F8.basalt |
18.4 GB | Gemma 4 26B A4B: NVFP4 experts, FP8 attention and MLP |
Gemma-4-31B-it-NVFP4-F8.basalt |
26.1 GB | Gemma 4 31B: NVFP4 MLP, FP8 attention |
Gemma-4-12B-it-F8.basalt |
14.4 GB | Gemma 4 12B: FP8 |
SHA-256:
47b5c5a4fcabee663544a4a6b1f7551bfe780b4925b02b6f1cd0ff5ae8e2db9d Gemma-4-26B-A4B-it-NVFP4-F8.basalt
acafc6548e0ce2ca604c5940c961d114fa126100c2a74376312ced42b0040e2c Gemma-4-31B-it-NVFP4-F8.basalt
d6d9f4bcf403670d2de631fb151ddc48d4d4dc3308c34c98248938675188d2b8 Gemma-4-12B-it-F8.basalt
Models
| 26B A4B | 31B | 12B | |
|---|---|---|---|
| source | gemma-4-26B-A4B-it | gemma-4-31B-it | gemma-4-12B-it |
| kind | mixture of experts | dense | dense |
| routed experts per layer | 128, top 8 | none | none |
| vision | yes | yes | no, text only |
| tokens per picture, up to | 280 | 280 | none |
| context, up to | 262,144 | 262,144 | 262,144 |
default --max-context |
8,192 | 8,192 | 8,192 |
- Vision: images work with
--vision dynamic, encoded inside the engine from the file's vision tower. The 12B's own image and audio inputs are not in its file. - Context: set with
--max-context.--kv fp8halves the full-attention layers' cache; the sliding-window layers keep a fixed ring. - Drafter: Google's assistant model drafts by default. Drafted tokens are verified, so the output is the model's own.
--spec 0turns it off. - Thinking and tools: thinking is on by default and off with reasoning effort
none; tool calls work through the server.
What is in each file
Every part is rounded once from Google's BF16 weights; nothing is calibrated on data.
| part | in | format |
|---|---|---|
| Routed experts | 26B A4B | NVFP4: E2M1 codes, a UE4M3 scale per 16 values, an FP32 scale per matrix |
| MLP projections | 31B | NVFP4: E2M1 codes, a UE4M3 scale per 16 values picked for least squared error, an FP32 scale per matrix |
| MLP projections | 26B A4B (shared MLP), 12B | FP8 E4M3, an FP32 scale per matrix |
| Attention projections | every model | FP8 E4M3, an FP32 scale per matrix |
| Output head (the tied embedding) | every model | FP8 E4M3 rows, an FP32 scale per row |
| Token embedding | every model | BF16, kept in system RAM |
| Router | 26B A4B | F32 |
| Norms, layer scalars | every model | F32 |
| Assistant drafter | every model | FP8 E4M3 projections and head |
| Vision tower and projector | 26B A4B, 31B | BF16 and F32, as stored |
Speed
Tokens per second on an RTX 5090 (400 W) alone, fp8 KV, drafter on. Prefill is a 16K prompt.
| model | context | prefill 16K | decode, conversation | decode, structured | decode, prose |
|---|---|---|---|---|---|
| 26B A4B | 262,144 | 21,882 | 438 | 705 | 380 |
| 31B | 229,376 | 5,526 | 165 | 263 | 125 |
| 12B | 262,144 | 10,922 | 259 | 485 | 223 |
Quality
Measured with the quality suite (full set, assistant rows) against vLLM's BF16 model on chat conversations the BF16 model wrote. The BF16 references are in basalt-quality-v2. Error bars are conversation-level bootstrap. Lower KLD and higher top-1 agreement are closer to BF16. Each model is scored against its own BF16 reference.
| model | build | conversations | KLD mean | same top-1 |
|---|---|---|---|---|
| 26B A4B | Gemma-4-26B-A4B-it-NVFP4-F8.basalt |
410 | 0.0293 +/- 0.0015 | 96.25 +/- 0.12% |
| 26B A4B | Unsloth UD-Q4_K_M GGUF (for comparison; not shipped) | 417 | 0.0146 | 97.40% |
| 31B | Gemma-4-31B-it-NVFP4-F8.basalt |
410 | 0.0319 +/- 0.0014 | 96.34 +/- 0.11% |
| 12B | Gemma-4-12B-it-F8.basalt |
410 | 0.0126 +/- 0.0006 | 97.34 +/- 0.08% |
Every rounding the engine does is listed in the precision docs.
Run
Build the engine as described in the Basalt README, then download the file you want:
hf download jesdga/Gemma-4-Basalt Gemma-4-26B-A4B-it-NVFP4-F8.basalt --local-dir models
hf download jesdga/Gemma-4-Basalt Gemma-4-31B-it-NVFP4-F8.basalt --local-dir models
hf download jesdga/Gemma-4-Basalt Gemma-4-12B-it-F8.basalt --local-dir models
and serve it:
bin/basalt serve models/Gemma-4-26B-A4B-it-NVFP4-F8.basalt --vision dynamic
bin/basalt serve models/Gemma-4-31B-it-NVFP4-F8.basalt --vision dynamic --max-context 65536
bin/basalt serve models/Gemma-4-12B-it-F8.basalt --max-context 262144
Add --max-context N for a longer context. More in
Gemma 4 on Basalt and
models and the router. The same files can be
built locally with tools/convert/convert.py; see
docs/model-file.md.
Sources
- Models: google/gemma-4-26B-A4B-it, google/gemma-4-31B-it and google/gemma-4-12B-it, Google.
- Assistant drafters: google/gemma-4-26B-A4B-it-assistant, google/gemma-4-31B-it-assistant and google/gemma-4-12B-it-assistant, Google.
- These files: built from the BF16 checkpoints by
tools/convert/convert.py --checkpoint(the 31B with--mlp-nvfp4); tokenizer and chat template from them. - Basalt is a fork of Strata (MIT).
License
The Gemma 4 models and their assistant drafters are released by Google under Apache-2.0 (Gemma 4 license). These files are a modified (quantized and repacked) form of the original weights, distributed under the same license. This is not an official Google release. The Basalt engine is MIT.
- Downloads last month
- 3,545
