Image-Text-to-Text
Transformers
Safetensors
monarch_gemma4
gemma4
monarch-matrices
model-compression
conversational
custom_code
Run this model with HF Jobs
Run hexoy/gemma-4-e2b-distilled 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 and TRL to fine-tune https://huggingface.co/hexoy/gemma-4-e2b-distilled. 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/hexoy/gemma-4-e2b-distilled 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.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/hexoy/gemma-4-e2b-distilled. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/hexoy/gemma-4-e2b-distilled. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use hexoy/gemma-4-e2b-distilled with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use hexoy/gemma-4-e2b-distilled with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="hexoy/gemma-4-e2b-distilled", trust_remote_code=True) messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForImageTextToText model = AutoModelForImageTextToText.from_pretrained("hexoy/gemma-4-e2b-distilled", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use hexoy/gemma-4-e2b-distilled with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "hexoy/gemma-4-e2b-distilled" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "hexoy/gemma-4-e2b-distilled", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/hexoy/gemma-4-e2b-distilled
- SGLang
How to use hexoy/gemma-4-e2b-distilled with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "hexoy/gemma-4-e2b-distilled" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "hexoy/gemma-4-e2b-distilled", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "hexoy/gemma-4-e2b-distilled" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "hexoy/gemma-4-e2b-distilled", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use hexoy/gemma-4-e2b-distilled with Docker Model Runner:
docker model run hf.co/hexoy/gemma-4-e2b-distilled
Remove rejected PLE experiment references
Browse files26 unmodified lines272829303132331 unmodified line3536373839404142431 unmodified line454647484950515253545556575859606162636418 unmodified lines8384858687888926 unmodified lines| Four-layer Monarch BF16 | Released | 9.122 GiB | 9.122 GiB | 4.05% || 35-layer Monarch BF16 | Released | 6.859 GiB | 6.859 GiB | 27.86% || 35-layer Monarch + 420 INT8 linears | Released | 6.135 GiB | 6.136 GiB | 35.48% || INT8 linears + group-32 INT8 PLE | Rejected | 4.221 GiB | 4.222 GiB | 55.61% |BF16 sizes use two bytes per parameter. Quantized sizes were measured fromphysical tensor storage. These values exclude activations, logits, CUDA1 unmodified line## 2. TinyHellaSwagMeasured rows used the same RTX PRO 6000, fixed batch size `32`, seed `1234`,100 official examples, 10-shot prompts, and no chat template. Group-32 PLEfailed the preceding fidelity gate, so it was not benchmarked.| Model | Status | GP-IRT accuracy | Raw accuracy | Runtime | Peak VRAM || --- | --- | ---: | ---: | ---: | ---: |1 unmodified line| Four-layer Monarch BF16 | Released | 37.04% | 27% | 22.96 s | 57.50 GiB || 35-layer Monarch BF16 | Released | 32.35% | 22% | 23.33 s | 55.23 GiB || 35-layer Monarch + INT8 linears | Released | 30.57% | 21% | 23.14 s | 54.51 GiB || INT8 linears + group-32 INT8 PLE | Rejected | Not run | Not run | Not run | Not run |TinyHellaSwag has only 100 examples, so small score changes are noisy. A goodbenchmark score does not override failed logit or generation checks.## What Did Not Work- **Group-32 PLE:** storage, tensor inventory, and exact save/reload checkspassed, but token KL was `0.1035` and greedy-token agreement was `55.6%`.Text generation was empty and image-text generation repeated `3`, so thecandidate was rejected before TinyHellaSwag and was not published.- **Historical auto-batch comparisons:** runtime and peak VRAM were misleadingbecause selected batch sizes ranged from 32 to 57. They were replaced by thefixed-batch table above.## Usage18 unmodified lines- Model weights: `f897353fca328b1cc5fd2e12d645773ca637f5f0`- Current source: [`gemma-distillation`](https://github.com/ratmir-miftachov/gemma-distillation)- Full private results and hashes:[`gemma4-monarch-artifacts`](https://huggingface.co/datasets/hexoy/gemma4-monarch-artifacts/tree/37797bdd2e63a42346749d8b722c2335bd599002/experiments/int8-ple-group32/20260720T104203Z)Derived from [google/gemma-4-E2B-it](https://huggingface.co/google/gemma-4-E2B-it).See `NOTICE` for the modification summary.26 unmodified lines2728293031321 unmodified line34353637383940411 unmodified line43444546474849505152535418 unmodified lines7374757677787926 unmodified lines| Four-layer Monarch BF16 | Released | 9.122 GiB | 9.122 GiB | 4.05% || 35-layer Monarch BF16 | Released | 6.859 GiB | 6.859 GiB | 27.86% || 35-layer Monarch + 420 INT8 linears | Released | 6.135 GiB | 6.136 GiB | 35.48% |BF16 sizes use two bytes per parameter. Quantized sizes were measured fromphysical tensor storage. These values exclude activations, logits, CUDA1 unmodified line## 2. TinyHellaSwagAll rows used the same RTX PRO 6000, fixed batch size `32`, seed `1234`,100 official examples, 10-shot prompts, and no chat template.| Model | Status | GP-IRT accuracy | Raw accuracy | Runtime | Peak VRAM || --- | --- | ---: | ---: | ---: | ---: |1 unmodified line| Four-layer Monarch BF16 | Released | 37.04% | 27% | 22.96 s | 57.50 GiB || 35-layer Monarch BF16 | Released | 32.35% | 22% | 23.33 s | 55.23 GiB || 35-layer Monarch + INT8 linears | Released | 30.57% | 21% | 23.14 s | 54.51 GiB |TinyHellaSwag has only 100 examples, so small score changes are noisy. A goodbenchmark score does not override failed logit or generation checks.Historical auto-batch runtime and peak-VRAM measurements are omitted becauseselected batch sizes differed. The table above uses fixed batch size `32`.## Usage18 unmodified lines- Model weights: `f897353fca328b1cc5fd2e12d645773ca637f5f0`- Current source: [`gemma-distillation`](https://github.com/ratmir-miftachov/gemma-distillation)- Full private results and hashes:[`gemma4-monarch-artifacts`](https://huggingface.co/datasets/hexoy/gemma4-monarch-artifacts/tree/main/benchmarks/int8/20260717T110806Z)Derived from [google/gemma-4-E2B-it](https://huggingface.co/google/gemma-4-E2B-it).See `NOTICE` for the modification summary.
README.md+5-15