Instructions to use naksyu/gemma4-e4b-diagnostic-v2-fft100 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use naksyu/gemma4-e4b-diagnostic-v2-fft100 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="naksyu/gemma4-e4b-diagnostic-v2-fft100") 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("naksyu/gemma4-e4b-diagnostic-v2-fft100") model = AutoModelForMultimodalLM.from_pretrained("naksyu/gemma4-e4b-diagnostic-v2-fft100", 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=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use naksyu/gemma4-e4b-diagnostic-v2-fft100 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "naksyu/gemma4-e4b-diagnostic-v2-fft100" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "naksyu/gemma4-e4b-diagnostic-v2-fft100", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/naksyu/gemma4-e4b-diagnostic-v2-fft100
- SGLang
How to use naksyu/gemma4-e4b-diagnostic-v2-fft100 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 "naksyu/gemma4-e4b-diagnostic-v2-fft100" \ --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": "naksyu/gemma4-e4b-diagnostic-v2-fft100", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "naksyu/gemma4-e4b-diagnostic-v2-fft100" \ --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": "naksyu/gemma4-e4b-diagnostic-v2-fft100", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use naksyu/gemma4-e4b-diagnostic-v2-fft100 with Docker Model Runner:
docker model run hf.co/naksyu/gemma4-e4b-diagnostic-v2-fft100
gemma4-e4b-diagnostic-v2-fft100
Experimental Gemma4 E4B full-finetune snapshot for short training-log diagnosis, metric interpretation, checkpoint triage, and compact reasoning answers.
This is a research artifact, not a production assistant. It was made to test whether a small, focused E4B tune can become more useful at reading loss curves, spotting training failure modes, and making concrete next-step decisions from numbers and logs.
Model Summary
- Base checkpoint: local
gemma4-e4b-itexport at training time. - Architecture:
Gemma4ForConditionalGeneration. - Published format: BF16
model.safetensors. - Hugging Face safetensors metadata reports about
7.94BBF16 parameters. - Training method: full fine-tune, not LoRA.
- Primary language coverage: English plus some Korean.
- Primary use: training diagnostics and numeric/log reasoning.
- Not intended for: deployment without validation, hidden chain-of-thought training, tool execution, vision/audio tasks, or safety-critical decisions.
The repository name uses fft100 to identify the published checkpoint-style
snapshot. The local training config was set up as a 300-step run with saves every
100 steps, so this should be treated as an intermediate experimental snapshot
unless a trainer_state.json is published later.
Intended Behavior
The data was built around a neutral diagnostic system prompt:
You are a concise Gemma4 E4B training-diagnostics assistant. Use the provided numbers and logs, give short visible rationale when useful, make a concrete decision, obey requested output formats, and stop after the final answer.
The target behavior is concise visible rationale plus a concrete decision, for example:
- identify plateau, overfit, grad-norm, OOM, and label-coverage problems;
- select a better checkpoint from eval metrics;
- explain why
eval_loss: nanmay be mechanical rather than model collapse; - summarize trends without long hidden-thought style output.
Training Recipe
| Setting | Value |
|---|---|
| Method | full_finetune_diagnostic_e4b |
| Base model path | gemma4 e4b |
| Precision | BF16 |
| Gradient checkpointing | enabled |
| Input field | pre-rendered Gemma4 turn text |
| Max sequence length | 1024 |
| Learning rate | 1.5e-6 |
| Scheduler | cosine |
| Warmup ratio | 0.03 |
| Weight decay | 0.01 |
| Optimizer | adamw_torch_fused |
| Micro batch size | 1 |
| Gradient accumulation | 16 |
| Configured max steps | 300 |
| Eval interval | 50 steps |
| Save interval | 100 steps |
| Seed | 20260709 |
Data Mix
The dataset was rebuilt from raw/local source folders under data/; previous
derived data/sft mixes were explicitly denied as inputs.
| Source family | Rows |
|---|---|
OpenThoughts-114k |
17,644 |
synthetic_training_diagnostics_v2 |
5,337 |
time_series_text_prediction |
5,350 |
time_series_reasoning |
1,421 |
dense_anchor_alignment |
391 |
reasoning_trajectory_prediction |
13 |
| Total | 30,156 |
Split:
| Split | Rows |
|---|---|
| Train | 28,156 |
| Eval | 2,000 |
Data Policy
- OpenThoughts rows were capped and stripped to visible assistant solution text.
- Time-series text rows were kept broadly for numeric trend behavior.
- Time-series reasoning and trajectory rows were filtered to training-log keywords.
- Synthetic diagnostic rows were generated locally to teach short rationale plus concrete training decisions.
- System prompts were replaced with the diagnostic Gemma4 E4B prompt.
- Rows were de-duplicated by normalized message content.
- Text was rendered with the local Gemma4 turn template:
<bos><|turn>role\n...<turn|>.
Denied from this mix:
- previous
data/sftderived mixes; - persona/style/Lime/Luna sources;
- planner JSON and recommended-expert routing data;
- tool-call rows;
- image rows;
- hidden-thought tags such as
<think>,<|think|>, and related markers.
Usage
Use a Transformers build that supports Gemma4ForConditionalGeneration and the
included chat_template.jinja.
import torch
from transformers import AutoModelForImageTextToText, AutoProcessor
model_id = "naksyu/gemma4-e4b-diagnostic-v2-fft100"
processor = AutoProcessor.from_pretrained(model_id)
model = AutoModelForImageTextToText.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="auto",
)
messages = [
{
"role": "system",
"content": "You are a concise Gemma4 E4B training-diagnostics assistant. Use the provided numbers and logs, give short visible rationale when useful, make a concrete decision, obey requested output formats, and stop after the final answer.",
},
{
"role": "user",
"content": "Eval loss: 1.228053, 1.227654, 1.227541, 1.227467 over four checkpoints. Should I keep training?",
},
]
inputs = processor.apply_chat_template(
messages,
tokenize=True,
add_generation_prompt=True,
return_dict=True,
return_tensors="pt",
)
inputs = {key: value.to(model.device) for key, value in inputs.items()}
outputs = model.generate(**inputs, max_new_tokens=256, temperature=0.7, top_p=0.9)
print(processor.decode(outputs[0], skip_special_tokens=True))
Limitations
- This model has not been released with a full benchmark report.
- It may still hallucinate training causes or overstate confidence from weak metrics.
- It should not replace actual eval scripts, checkpoint probes, or dataset inspection.
- It was tuned as text-only even though the base architecture may expose multimodal tokens.
- Safety behavior was not the main target of this tune.
License and Terms
This model is a derivative experimental tune of the base Gemma4 E4B checkpoint. Use is subject to the base model terms and to the licenses or terms of the upstream data sources used in the mix. This model card does not grant separate rights to redistribute any underlying datasets.
Provenance Files
Local build metadata used for this card:
train_gemma4_e4b_diagnostic_v2_fft.yamlgemma4_e4b_diagnostic_v2_manifest.jsongemma4_e4b_diagnostic_v2_used.md
- Downloads last month
- 11