Instructions to use ertghiu256/gemma-4-e2b-deepglm-distill-chat with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ertghiu256/gemma-4-e2b-deepglm-distill-chat with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="ertghiu256/gemma-4-e2b-deepglm-distill-chat") 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 AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("ertghiu256/gemma-4-e2b-deepglm-distill-chat") model = AutoModelForMultimodalLM.from_pretrained("ertghiu256/gemma-4-e2b-deepglm-distill-chat", device_map="auto") 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?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ertghiu256/gemma-4-e2b-deepglm-distill-chat with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ertghiu256/gemma-4-e2b-deepglm-distill-chat" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ertghiu256/gemma-4-e2b-deepglm-distill-chat", "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/ertghiu256/gemma-4-e2b-deepglm-distill-chat
- SGLang
How to use ertghiu256/gemma-4-e2b-deepglm-distill-chat 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 "ertghiu256/gemma-4-e2b-deepglm-distill-chat" \ --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": "ertghiu256/gemma-4-e2b-deepglm-distill-chat", "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 "ertghiu256/gemma-4-e2b-deepglm-distill-chat" \ --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": "ertghiu256/gemma-4-e2b-deepglm-distill-chat", "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" } } ] } ] }' - Unsloth Desktop
- Docker Model Runner
How to use ertghiu256/gemma-4-e2b-deepglm-distill-chat with Docker Model Runner:
docker model run hf.co/ertghiu256/gemma-4-e2b-deepglm-distill-chat
Gemma-4-E2B-DeepGLM-Chat
Gemma-4-E2B-DeepGLM-Chat is a specialized, lightweight reasoning model fine-tuned on top of Google Gemma 4 E2B (unsloth/gemma-4-E2B-it). Designed to punch far above its parameter weight class (~2.3B active parameters), this model merges edge-optimized efficiency with advanced chain-of-thought (CoT) tracking, mathematical verification, and code execution capabilities.
🌟 Key Features
- Efficient Architecture: Built on the Google Gemma 4 E2B edge architecture, optimized for low latency and minimal memory overhead.
- Multimodal Edge Foundations: Inherits text, vision, and audio processing capabilities natively from the base Gemma 4 E2B lineup.
- Deep CoT Reasoning: Enhanced logical tracking enabled via structured internal reasoning channels (
<|channel>thought). - Targeted Fine-Tuning Datasets:
isaiahbjork/cot-logic-reasoning(Formal logic, fallacies, multi-step deduction)Banaxi-Tech/Deepseek-V4-Reasoning-Code-2500(Deterministic code execution & algorithm tracing)best-distill/glm-5.3-flash-distillation-chat(Mathematical distillation & structured formatting)armand0e/Fable-5-Chat(Conversational multi-turn engagement & technical instruction)
🚀 Quickstart
Using transformers
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
model_id = "ertghiu256/gemma-4-e2b-deepglm-distill-chat"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="auto"
)
prompt = "Why is the sky blue?"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=512, temperature=0.2)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
💡 Output Format
To get the absolute best reasoning quality from this model, allow the model to utilize its built-in reasoning tags:
<|channel>thought
[Internal reasoning trace / scratchpad]
<channel|>
[Final response]
- Tip: Running it with a moderate temperature (
0.5-0.9).
📄 Citation & Acknowledgments
- Base Model: Google Gemma 4 E2B (
google/gemma-4-e2b) - Fine-Tuning Datasets:
Banaxi-Tech/Deepseek-V4-Reasoning-Code-2500best-distill/glm-5.3-flash-distillation-chatarmand0e/Fable-5-Chatisaiahbjork/cot-logic-reasoning
Citation
@misc{gemmateam2026gemma4,
title={Gemma 4 Technical Report},
author={Gemma Team},
year={2026},
eprint={2607.02770},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2607.02770},
}
Uploaded finetuned
- Developed by: ertghiu256
- License: apache-2.0
- Finetuned from model : unsloth/gemma-4-E2B-it
This gemma4 model was trained 2x faster with Unsloth and Huggingface's TRL library.
- Downloads last month
- 40
