Run this model with HF Jobs
Run mlx-community/gemma-4-e4b-5bit on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/mlx-community/gemma-4-e4b-5bit. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/mlx-community/gemma-4-e4b-5bit on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use mlx-community/gemma-4-e4b-5bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use mlx-community/gemma-4-e4b-5bit with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] hf download mlx-community/gemma-4-e4b-5bit --local-dir gemma-4-e4b-5bit
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Atomic Chat
Upload folder using huggingface_hub
Browse filesFiles changed (10)
- .gitattributes+1
- README.mdAdded+25
- config.jsonAdded+204
- generation_config.jsonAdded+10
- model-00001-of-00002.safetensorsAdded+3
- model-00002-of-00002.safetensorsAdded+3
- model.safetensors.index.jsonAdded
- processor_config.jsonAdded+32
- tokenizer.jsonAdded+3
- tokenizer_config.jsonAdded+54
32 unmodified lines33343532 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text32 unmodified lines3334353632 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -texttokenizer.json filter=lfs diff=lfs merge=lfs -text
12345678910111213141516171819202122232425---library_name: mlxlicense: apache-2.0license_link: https://ai.google.dev/gemma/docs/gemma_4_licensepipeline_tag: any-to-anytags:- mlxbase_model: google/gemma-4-e4b---
# mlx-community/gemma-4-e4b-5bit
This model was converted to MLX format from [`google/gemma-4-e4b`](https://huggingface.co/google/gemma-4-e4b)using mlx-vlm version **0.4.3**.Refer to the [original model card](https://huggingface.co/google/gemma-4-e4b) for more details on the model.
## Use with mlx
```bashpip install -U mlx-vlm```
```bashpython -m mlx_vlm.generate --model mlx-community/gemma-4-e4b-5bit --max-tokens 100 --temperature 0.0 --prompt "Describe this image." --image <path_to_image>```123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204{ "architectures": [ "Gemma4ForConditionalGeneration" ], "audio_config": { "_name_or_path": "", "architectures": null, "attention_chunk_size": 12, "attention_context_left": 13, "attention_context_right": 0, "attention_invalid_logits_value": -1000000000.0, "attention_logit_cap": 50.0, "chunk_size_feed_forward": 0, "conv_kernel_size": 5, "dtype": "bfloat16", "gradient_clipping": 10000000000.0, "hidden_act": "silu", "hidden_size": 1024, "id2label": { "0": "LABEL_0", "1": "LABEL_1" }, "initializer_range": 0.02, "is_encoder_decoder": false, "label2id": { "LABEL_0": 0, "LABEL_1": 1 }, "model_type": "gemma4_audio", "num_attention_heads": 8, "num_hidden_layers": 12, "output_attentions": false, "output_hidden_states": false, "output_proj_dims": 1536, "problem_type": null, "residual_weight": 0.5, "return_dict": true, "rms_norm_eps": 1e-06, "subsampling_conv_channels": [ 128, 32 ], "use_clipped_linears": true }, "audio_token_id": 258881, "boa_token_id": 256000, "boi_token_id": 255999, "dtype": "bfloat16", "eoa_token_id": 258883, "eoa_token_index": 258883, "eoi_token_id": 258882, "eos_token_id": 1, "image_token_id": 258880, "initializer_range": 0.02, "model_type": "gemma4", "quantization": { "group_size": 64, "bits": 5, "mode": "affine" }, "quantization_config": { "group_size": 64, "bits": 5, "mode": "affine" }, "text_config": { "attention_bias": false, "attention_dropout": 0.0, "attention_k_eq_v": false, "bos_token_id": 2, "dtype": "bfloat16", "enable_moe_block": false, "eos_token_id": 1, "expert_intermediate_size": null, "final_logit_softcapping": 30.0, "global_head_dim": 512, "head_dim": 256, "hidden_activation": "gelu_pytorch_tanh", "hidden_size": 2560, "hidden_size_per_layer_input": 256, "initializer_range": 0.02, "intermediate_size": 10240, "layer_types": [ "sliding_attention", "sliding_attention", "sliding_attention", "sliding_attention", "sliding_attention", "full_attention", "sliding_attention", "sliding_attention", "sliding_attention", "sliding_attention", "sliding_attention", "full_attention", "sliding_attention", "sliding_attention", "sliding_attention", "sliding_attention", "sliding_attention", "full_attention", "sliding_attention", "sliding_attention", "sliding_attention", "sliding_attention", "sliding_attention", "full_attention", "sliding_attention", "sliding_attention", "sliding_attention", "sliding_attention", "sliding_attention", "full_attention", "sliding_attention", "sliding_attention", "sliding_attention", "sliding_attention", "sliding_attention", "full_attention", "sliding_attention", "sliding_attention", "sliding_attention", "sliding_attention", "sliding_attention", "full_attention" ], "max_position_embeddings": 131072, "model_type": "gemma4_text", "num_attention_heads": 8, "num_experts": null, "num_global_key_value_heads": null, "num_hidden_layers": 42, "num_key_value_heads": 2, "num_kv_shared_layers": 18, "pad_token_id": 0, "rms_norm_eps": 1e-06, "rope_parameters": { "full_attention": { "partial_rotary_factor": 0.25, "rope_theta": 1000000.0, "rope_type": "proportional" }, "sliding_attention": { "rope_theta": 10000.0, "rope_type": "default" } }, "sliding_window": 512, "tie_word_embeddings": true, "top_k_experts": null, "use_bidirectional_attention": null, "use_cache": true, "use_double_wide_mlp": false, "vocab_size": 262144, "vocab_size_per_layer_input": 262144 }, "tie_word_embeddings": true, "transformers_version": "5.5.0.dev0", "video_token_id": 258884, "vision_config": { "_name_or_path": "", "architectures": null, "attention_bias": false, "attention_dropout": 0.0, "chunk_size_feed_forward": 0, "default_output_length": 280, "dtype": "bfloat16", "global_head_dim": 64, "head_dim": 64, "hidden_activation": "gelu_pytorch_tanh", "hidden_size": 768, "id2label": { "0": "LABEL_0", "1": "LABEL_1" }, "initializer_range": 0.02, "intermediate_size": 3072, "is_encoder_decoder": false, "label2id": { "LABEL_0": 0, "LABEL_1": 1 }, "max_position_embeddings": 131072, "model_type": "gemma4_vision", "num_attention_heads": 12, "num_hidden_layers": 16, "num_key_value_heads": 12, "output_attentions": false, "output_hidden_states": false, "patch_size": 16, "pooling_kernel_size": 3, "position_embedding_size": 10240, "problem_type": null, "return_dict": true, "rms_norm_eps": 1e-06, "rope_parameters": { "rope_theta": 100.0, "rope_type": "default" }, "standardize": false, "use_clipped_linears": true }, "vision_soft_tokens_per_image": 280}12345678910{ "bos_token_id": 2, "do_sample": true, "eos_token_id": 1, "pad_token_id": 0, "temperature": 1.0, "top_k": 64, "top_p": 0.95, "transformers_version": "5.5.0.dev0"}123version https://git-lfs.github.com/spec/v1oid sha256:2f4890ec2a0e1ed3cf1a27a54573cf0e5b748050011948aa926ff6d0f82602d3size 5365846852123version https://git-lfs.github.com/spec/v1oid sha256:562604e1fbae8f03e222819df945da4dd5c1d11dd45329ff8d8eb17687343fd8size 7884972201234567891011121314151617181920212223242526272829303132{ "audio_seq_length": 750, "image_processor": { "do_convert_rgb": true, "do_normalize": false, "do_rescale": true, "do_resize": true, "image_mean": [ 0.0, 0.0, 0.0 ], "image_processor_type": "Gemma4ImageProcessor", "image_seq_length": 280, "image_std": [ 1.0, 1.0, 1.0 ], "max_soft_tokens": 280, "patch_size": 16, "pooling_kernel_size": 3, "resample": 3, "rescale_factor": 0.00392156862745098, "size": { "height": 224, "width": 224 } }, "image_seq_length": 280, "processor_class": "Gemma4Processor"}123version https://git-lfs.github.com/spec/v1oid sha256:12bac982b793c44b03d52a250a9f0d0b666813da566b910c24a6da0695fd11e6size 32170070123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354{ "audio_token": "<|audio|>", "backend": "tokenizers", "boa_token": "<|audio>", "boi_token": "<|image>", "bos_token": "<bos>", "eoa_token": "<audio|>", "eoc_token": "<channel|>", "eoi_token": "<image|>", "eos_token": "<eos>", "eot_token": "<turn|>", "escape_token": "<|\"|>", "etc_token": "<tool_call|>", "etd_token": "<tool|>", "etr_token": "<tool_response|>", "extra_special_tokens": [ "<|video|>" ], "image_token": "<|image|>", "is_local": true, "mask_token": "<mask>", "model_max_length": 1000000000000000019884624838656, "model_specific_special_tokens": { "audio_token": "<|audio|>", "boa_token": "<|audio>", "boi_token": "<|image>", "eoa_token": "<audio|>", "eoc_token": "<channel|>", "eoi_token": "<image|>", "eot_token": "<turn|>", "escape_token": "<|\"|>", "etc_token": "<tool_call|>", "etd_token": "<tool|>", "etr_token": "<tool_response|>", "image_token": "<|image|>", "soc_token": "<|channel>", "sot_token": "<|turn>", "stc_token": "<|tool_call>", "std_token": "<|tool>", "str_token": "<|tool_response>", "think_token": "<|think|>" }, "pad_token": "<pad>", "padding_side": "left", "processor_class": "Gemma4Processor", "soc_token": "<|channel>", "sot_token": "<|turn>", "stc_token": "<|tool_call>", "std_token": "<|tool>", "str_token": "<|tool_response>", "think_token": "<|think|>", "tokenizer_class": "GemmaTokenizer", "unk_token": "<unk>"}.gitattributes+1
README.mdAdded+25
config.jsonAdded+204
generation_config.jsonAdded+10
model-00001-of-00002.safetensorsAdded+3
model-00002-of-00002.safetensorsAdded+3
model.safetensors.index.jsonAdded
processor_config.jsonAdded+32
tokenizer.jsonAdded+3
tokenizer_config.jsonAdded+54