Downloads · 30 days
29
2% of all-time downloads
emanubiz/gemma4-E4B-opus-finetuned
gemma4-E4B-opus-finetuned is a text generation model from emanubiz. Use it when you need the model to write or continue text. It is set up for mlx-lm. The card lists the license as gemma.
A locally fine-tuned Gemma 4 E4B model optimized for structured reasoning, multi-step problem solving, and efficient inference on Apple Silicon and GGUF-compatible runtimes.
Downloads · 30 days
29
2% of all-time downloads
All-time downloads
1.6K
Public
Repo size
8 GB
Likes
0
Public
Click a slice to open those files.
.gguf8 GB · 100%
From the Hugging Face model README
A locally fine-tuned Gemma 4 E4B model optimized for structured reasoning, multi-step problem solving, and efficient inference on Apple Silicon and GGUF-compatible runtimes.
This model was fine-tuned using LoRA on a curated dataset of approximately 11k reasoning-focused examples, merged from two high-quality sources. The result is a compact model that preserves Gemma's conversational fluency while improving logical coherence and response structure.
| Property | Value |
|---|---|
| Base model | mlx-community/gemma-4-e4b-it-4bit |
| Fine-tuning | LoRA (rank=16, layers=8) |
| Training steps | 15k iterations |
| Training samples | ~11k conversations |
| Export format | GGUF (q8_0) |
| Target runtime | Apple Silicon M-series, llama.cpp, Ollama, mlx-lm |
Training data was built by merging and normalizing two sources:
The merged dataset is available at: https://huggingface.co/datasets/emanubiz/opus-claude-merged
This model uses a custom turn-based format.
{{ bos_token }}
{%- if tools %}
<|turn>system
You are a helpful assistant with access to tools. When you need to use a tool, respond with a tool call in this exact JSON format:
<tool_call>{"name": "FUNCTION_NAME", "arguments": {"param": "value"}}</tool_call>
Available tools:
{%- for t in tools %}
{{ t.function.name }}: {{ t.function.description }}
Parameters: {{ t.function.parameters | tojson }}
{%- endfor %}
<turn|>
{%- endif %}
{%- for m in messages %}
{%- if m.role == 'user' %}
<|turn>user
{{ m.content }}
<turn|>
{%- elif m.role == 'assistant' or m.role == 'model' %}
<|turn>model
{%- if m.tool_calls %}
{%- for tc in m.tool_calls %}
<tool_call>{"name": "{{ tc.function.name }}", "arguments": {{ tc.function.arguments | tojson }}}</tool_call>
{%- endfor %}
{%- endif %}
{%- if m.content %} {{ m.content }}{%- endif %}
<turn|>
{%- elif m.role == 'tool' %}
<|turn>tool
<tool_result>{{ m.content }}</tool_result>
<turn|>
{%- endif %}
{%- endfor %}
{%- if add_generation_prompt %}
<|turn>model
{% endif %}
<|turn>user
What is the square root of 144 plus 13?
<turn|>
<|turn>model
The square root of 144 is 12. Adding 13 gives 25.
<turn|>
llama-server \
-m gemma4-opus.gguf \
-ngl 99 \
-c 65536 \
--chat-template-file chat_template.jinja \
--port 8080 \
--host 0.0.0.0
Modelfile:
FROM ./gemma4-opus.gguf
TEMPLATE "<|turn>user {{ .Prompt }}<turn|> <|turn>model {{ .Response }}<turn|>"
PARAMETER temperature 0.7
PARAMETER top_p 0.9
PARAMETER top_k 64
PARAMETER stop "<turn|>"
Note: Ollama's Modelfile format does not support the full Jinja template. For tool calling, use llama-server with --chat-template-file.
Same license as base Gemma model: https://ai.google.dev/gemma/terms
Created by emanubiz