How to use from the
Use from the
Transformers library
# Use a pipeline as a high-level helper
from transformers import pipeline

pipe = pipeline("image-text-to-text", model="brokencircuitranch/gemma4-hermes-tools")
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, AutoModelForImageTextToText

processor = AutoProcessor.from_pretrained("brokencircuitranch/gemma4-hermes-tools")
model = AutoModelForImageTextToText.from_pretrained("brokencircuitranch/gemma4-hermes-tools")
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]:]))
Quick Links

Fine-tuned version of google/gemma-4-26B-A4B-it for reliable tool use and function calling.

Training

  • Base model: google/gemma-4-26B-A4B-it (Mixture of Experts)
  • Fine-tuning framework: Unsloth
  • Hardware: NVIDIA A100 80GB (HuggingFace Space)
  • Method: QLoRA (4-bit) → merged to 16-bit

Training Data

Total: 6,893 examples, 2 epochs

Training Results

Step Loss
10 1.825
50 0.374
200 0.196
500 0.110
862 0.113

Final training loss: 0.224

Intended Use

Designed for agentic pipelines requiring reliable structured tool call generation. Tested with Ollama for local inference.

Files

  • model-0000x-of-00002.safetensors — merged 16-bit weights
  • gemma4-hermes-tools-Q4_K_M.gguf — quantized for local inference via Ollama/llama.cpp

License

Inherits Gemma Terms of Use

Downloads last month
523
Safetensors
Model size
27B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for brokencircuitranch/gemma4-hermes-tools

Quantized
(222)
this model