Downloads · 30 days
10
1% of all-time downloads
henrybravo/gemma-4-31b-4bit
gemma-4-31b-4bit is a image-text-to-text model from henrybravo. Use it for the image-text-to-text task on the model card, and read the license before you ship it in a product. It is set up for mlx. The card lists the license as apache-2.0.
This repository provides an MLX quantized conversion of google/gemma-4-31b with an added chat template for tool calling support, prepared for local inference on Apple Silicon.
Downloads · 30 days
10
1% of all-time downloads
All-time downloads
1.1K
Public
Parameters
31.3B
18.4 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors18.4 GB · 100%
How the weights are stored.
U3230.7B · 98%
From the Hugging Face model README
This repository provides an MLX quantized conversion of google/gemma-4-31b with an added chat template for tool calling support, prepared for local inference on Apple Silicon.
This variant is based on the mlx-community/gemma-4-31b-4bit conversion (using mlx-vlm 0.4.3), with the addition of a chat template that was missing from the original conversion.
Published by henrybravo. All model capabilities, limitations, and licensing inherit from the original Google Gemma release.
The mlx-community conversion shipped without a chat template — neither tokenizer_config.json nor any separate template file contained one. Google's original google/gemma-4-31b also has no chat template in its published configs.
This variant adds a Jinja2 chat template that:
<|turn> / <turn|> for turn boundaries)<|tool_call> / <tool_call|> and <|tool_response> / <tool_response|> tokenstokenizer_config.json and provided as a standalone chat_template.jinjagoogle/gemma-4-31bGemma4ForConditionalGeneration (gemma4)mlx-community/gemma-4-31b-4bit)safetensors (4 shards)mlx-vlm / MLX ecosystem on macOSpip install -U mlx-vlm>=0.4.3
For OpenAI-compatible local serving and routing on top of MLX models, see mlx-router.
You can run the examples below directly with mlx_vlm.generate, or serve the model through mlx-router.
python -m mlx_vlm.generate \
--model henrybravo/gemma-4-31b-4bit \
--max-tokens 100 \
--temperature 0.0 \
--prompt "Hello, what model are you?"
python -m mlx_vlm.generate \
--model henrybravo/gemma-4-31b-4bit \
--max-tokens 200 \
--temperature 0.0 \
--prompt "Describe this image in detail." \
--image https://upload.wikimedia.org/wikipedia/commons/thumb/a/a7/Camponotus_flavomarginatus_ant.jpg/320px-Camponotus_flavomarginatus_ant.jpg
mlx-vlm, not mlx-lm (which does not support the gemma4 architecture yet)tokenizer_config.json and the Gemma 3 template structurehas_tool_calling is not set on the tokenizer; tool call parsing should be handled by the serving layer (e.g. mlx-router parses <|tool_call>...<tool_call|> blocks)