Instructions to use velocitylabo/vibekid-gemma-4-E2B-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use velocitylabo/vibekid-gemma-4-E2B-lora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("unsloth/gemma-4-e2b-it-unsloth-bnb-4bit") model = PeftModel.from_pretrained(base_model, "velocitylabo/vibekid-gemma-4-E2B-lora") - Notebooks
- Google Colab
- Kaggle
VibeKid โ Gemma 4 E2B LoRA (Phase 3 archiveใcap rate 43%)
โ ๏ธ archive notice: ๆฌ repo ใฏ Phase 3 LoRA (2026-04-25 ่จ็ทด็)ใKaggle Gemma 4 Hackathon (2026) ๆๅบๆฌไฝใฏ Phase 4 (
velocitylabo/vibekid-gemma-4-E2B-lora-phase4) ใๆก็จใPhase 4 ใงใฏtrain_on_responses_only+ Gemma 4 ็ต็ซฏ token (<turn|>) ๅฝๅไฟฎๆญฃ +pad_token != eos_tokenใฎ Tier 1 ไปๅ ฅใๆฝใใKaggle bench SFT+oneshot cap rate ใ 43% โ 14% ใซๆนๅใใใๆฌ Phase 3 archive ใฏ writeup Section B narrative ใง Tier 1 ไปๅ ฅๅใฎ baseline (cap rate 43%) ใจใใฆไธฆๅ่จๅใใใๆฏ่ผๅฏพ่ฑกใงใใใ้็บๅฑฅๆญด + ็ฌฌไธ่ ๆค่จผ็จใซไฟๆใใใๆๆฐใฎ่ฉไพกๆฐๅค / Reproducibility ่ฉณ็ดฐ / How to use / License ใฏ Phase 4 model card ใซ้็ดใ
Highlights (Phase 3 baseline)
- Base model:
google/gemma-4-E2B-it - Adapter type: QLoRA r=16 ฮฑ=32 (text decoder ้ๅฎใmultimodal ๅฑคใฏๅญฆ็ฟๅฏพ่ฑกๅค)
- Train data: 657 ไปถ (2026-04-19 splitใOpenRouter Gemini 2.5 Flash ๅๆ)
- Eval data: 100 ไปถ (ใซใใดใชๅ็ญใ2026-04-19 cutoff)
- Hardware: Colab Pro A100 40GB (bf16 native)ใ3 epochs โ 27min
- Adapter size: ~50MB
- ่จ็ทดๆฅ: 2026-04-25
- Kaggle bench cap rate (SFT+oneshot): 43% โ Phase 4 ๆฏ่ผๅฏพ่ฑกใๅพๆฎตใง 14% ใซๆนๅ
Training metrics (validation loss curve)
Phase 3 / Phase 4 ใง่จ็ทด hyperparameter ใฏๅไธ (ๅทฎๅใฏ Tier 1 ไปๅ ฅใฎใฟใๆฌ archive ใฏไปๅ ฅๅ)ใ
| Step | Training Loss | Validation Loss |
|---|---|---|
| 50 | 0.732 | 3.00 |
| 100 | 0.507 | 2.98 (ๆไฝ) |
| 150 | 0.416 | 3.06 |
| 200 | 0.336 | 3.05 |
| 249 | 0.328 | 3.05 |
3 epochs (249 stepsใeffective batch=8) ใง train_loss 0.99 โ 0.33 (66% ไฝไธ)ใval_loss ใฏ step 100 ไป่ฟใงๅๆ (่ปฝๅพฎ overfit ๅ ๅใstep 100 ใ 249 ใงใปใผๆจชใฐใ)ใ1 epoch run ๆใฎ eval_loss 6.34 โ 3 epoch run 3.05 ใจ ๅๅไปฅไธใซๆนๅใ
ๆณจ: ่จ็ทด็ตไบ็ดๅพใฎ่ฟฝๅ eval ใง eval_loss=NaN ใไธๅบฆ่ฆณๆธฌ (pad token = eos token ใซ่ตทๅ ใฎๅฏ่ฝๆงใattention_mask ่ญฆๅใไผดใ)ใ่จ็ทดไธญใฎ eval ใฏๅ
จใฆ finite ใงใadapter ่ชไฝใฏๅฅๅ
จใ
Phase 4 ใงๆนๅใใ narrative ๅทฎๅ
Phase 4 ใงใฏๅไธ train.jsonl / LoRA config / epoch ๆฐใง Tier 1 ไปๅ ฅ ใ้ฉ็จ:
train_on_responses_onlyโ user turn ใฎ loss ใ maskใresponse token ใฎใฟใง gradient- Gemma 4 ็ต็ซฏ token ๅฝๅไฟฎๆญฃ โ Gemma 4 chat ็ต็ซฏใฏ
<turn|>(id=106) / ้ๅงใฏ<|turn>(id=105)ใGemma 1/2/3 ็ณป (<end_of_turn>) ใจๅฝๅใ็ฐใชใใtrain_on_responses_onlyใฎinstruction_partliteral ใ Gemma 4 ไปๆงใซๆดๅ pad_token != eos_tokenโ TRL ๆจๅฅจใEOS ๅญฆ็ฟไฟกๅทๆธ่กฐใๅ้ฟ
โ ๅ train.jsonl (657 ไปถ) / ๅ LoRA config (r=16, ฮฑ=32) / ๅ epoch ๆฐ (3) ใงๅ่จ็ทด โ ๅ bench ๅ่ตฐ (clean A/B):
| ๆงๆ | Phase 3 (ๆฌ archive) | Phase 4 (current) | ฮ |
|---|---|---|---|
| SFT + oneshot cap rate | 43% | 14% | โ29pt |
Web app ใฎๆฌ็ชๆงๆใฏ oneshot ็ต่ทฏ (V1 system prompt) ใฎใใใend-user UX ไธใฎใใฎๅทฎใฏๆฑบๅฎ็ใ่ฉณ็ดฐใฏ Phase 4 model card Section "exec_success_rate + ๅฏๆฌก metrics" + writeup Section B ๅ็ งใ
Gemma 4 SFT ๅบๆใฎๅฐ้ท (Phase 3 / Phase 4 ๅ ฑ้ใฎ็ ็ฉถ contribution)
Gemma 4 ใ fine-tune ใใ้ใซ่ธใใ ๅ้กใจๅ้ฟๆนๆณใฏ Phase 4 model card ใซ้็ดๆธ (Section "Gemma 4 SFT ๅบๆใฎๅฐ้ท" ๅ็
ง)ใ4 ้
็ฎ: merged_4bit_forced NotImplementedError / T4 GPU bf16=True ็ ด็ถป / chat_template.jinja ้ๅๆขฑ (transformers #45205) / mm_token_type_ids silent ๅดฉๅฃใ
Reproducibility / How to use / License
่ฉณ็ดฐใฏ Phase 4 model card ใซ้็ดใๆฌ Phase 3 archive ใฏ Phase 4 ใจๅใ่จ็ทด / ๆจ่ซ / license ในใญใผใ ใ็ถๆฟ (Tier 1 ไปๅ ฅใฎๆ็กใฎใฟใๅทฎๅ)ใ
License (Phase 4 ใจๅใ dual-license):
- Adapter weights (
adapter_model.safetensorsใadapter_config.json): base modelgoogle/gemma-4-E2B-itใฎๆดพ็็ฉใจใใฆ Gemma Terms of Use ใ็ถๆฟ - Tokenizer / chat_template: Gemma upstream ใฎใใฎใๅ้ ๅธใๅๆงใซ Gemma Terms ๆบๆ
- Model card ๆฌๆ / configs of our authorship: CC-BY 4.0 ใง้ ๅธ
Citation / Acknowledgements
- Base model: Google DeepMind. Gemma 4 (
google/gemma-4-E2B-it). - Tooling: Unsloth AIใtransformersใpeft
- Hackathon: Kaggle Gemma 4 Good Hackathon (2026)
Repo links
- VibeKid Web app: https://github.com/velocitylabo/vibekid
- Phase 4 LoRA (current submission): https://huggingface.co/velocitylabo/vibekid-gemma-4-E2B-lora-phase4
- ๆฌ Phase 3 archive (ใใฎใใผใธ): https://huggingface.co/velocitylabo/vibekid-gemma-4-E2B-lora
- Downloads last month
- 8