Image-Text-to-Text
Transformers
Safetensors
monarch_gemma4
gemma4
monarch-matrices
model-compression
conversational
custom_code
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)# 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
| { | |
| "base_model": "google/gemma-4-E2B-it", | |
| "compressed_layers": [ | |
| 34, | |
| 33, | |
| 32, | |
| 31, | |
| 30, | |
| 29, | |
| 28, | |
| 27, | |
| 26, | |
| 25, | |
| 24, | |
| 23, | |
| 22, | |
| 21, | |
| 20, | |
| 19, | |
| 18, | |
| 17, | |
| 16, | |
| 15, | |
| 14, | |
| 13, | |
| 12, | |
| 11, | |
| 10, | |
| 9, | |
| 8, | |
| 7, | |
| 6, | |
| 5, | |
| 4, | |
| 3, | |
| 2, | |
| 1, | |
| 0 | |
| ], | |
| "monarch_blocks_weights": 128, | |
| "monarch_factor_count": 2, | |
| "parameter_count": 3682268704, | |
| "checkpoint": "monarch_checkpoints_b8_all35mlp_400p1_800p2_seq512_projinit_p2lr3e4/step_034_model_language_model_layers_0_mlp/unfrozen_weights.pt", | |
| "run_label": "b8-all35mlp-400p1-800p2-seq512-projinit-p2lr3e4", | |
| "final_eval512_distill_loss": 1.886012077331543, | |
| "validation_examples": 64, | |
| "training_git_commit": "72061879bd9028340aeeb529accf47fbc5d5c023", | |
| "model_weights_revision": "f897353fca328b1cc5fd2e12d645773ca637f5f0", | |
| "artifact_repo": "hexoy/gemma4-monarch-artifacts", | |
| "artifact_revision": "beeee38d493c6bf5696057b12c0844e134b76dfc", | |
| "phase_time_sum_hours": 5.812849506802029, | |
| "event_span_sum_hours": 5.889000632696682 | |
| } | |