Image-Text-to-Text
Transformers
Safetensors
gemma3
mergekit
Merge
conversational
text-generation-inference
Instructions to use Gunulhona/Gemma-3-4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Gunulhona/Gemma-3-4B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Gunulhona/Gemma-3-4B") 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 AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("Gunulhona/Gemma-3-4B") model = AutoModelForMultimodalLM.from_pretrained("Gunulhona/Gemma-3-4B") 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=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Gunulhona/Gemma-3-4B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Gunulhona/Gemma-3-4B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Gunulhona/Gemma-3-4B", "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/Gunulhona/Gemma-3-4B
- SGLang
How to use Gunulhona/Gemma-3-4B 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 "Gunulhona/Gemma-3-4B" \ --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": "Gunulhona/Gemma-3-4B", "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 "Gunulhona/Gemma-3-4B" \ --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": "Gunulhona/Gemma-3-4B", "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 Gunulhona/Gemma-3-4B with Docker Model Runner:
docker model run hf.co/Gunulhona/Gemma-3-4B
merge
This is a merge of pre-trained language models created using mergekit.
Merge Details
Merge Method
This model was merged using the Karcher Mean merge method using huihui-ai/gemma-3-4b-it-abliterated as a base.
Models Merged
The following models were included in the merge:
- neo4j/text-to-cypher-Gemma-3-4B-Instruct-2025.04.0
- google/gemma-3-4b-it-qat-q4_0-unquantized
- google/medgemma-4b-it
- google/medgemma-1.5-4b-it
- google/translategemma-4b-it
- google/gemma-3-4b-it-qat-int4-unquantized
- VIDraft/Gemma-3-R1984-4B
- ZySec-AI/gemma-3-4b-document-writer
Configuration
The following YAML configuration was used to produce this model:
models:
- model: google/gemma-3-4b-it-qat-q4_0-unquantized
- model: google/gemma-3-4b-it-qat-int4-unquantized
- model: ZySec-AI/gemma-3-4b-document-writer
- model: neo4j/text-to-cypher-Gemma-3-4B-Instruct-2025.04.0
- model: huihui-ai/gemma-3-4b-it-abliterated
- model: VIDraft/Gemma-3-R1984-4B
- model: google/medgemma-4b-it
- model: google/translategemma-4b-it
- model: google/medgemma-1.5-4b-it
merge_method: karcher
base_model: huihui-ai/gemma-3-4b-it-abliterated
dtype: bfloat16
- Downloads last month
- 3
Model tree for Gunulhona/Gemma-3-4B
Merge model
this model