Instructions to use Simon-Liu/gemma-4-E4B-it-open-doc with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Simon-Liu/gemma-4-E4B-it-open-doc with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("google/gemma-4-E4B-it") model = PeftModel.from_pretrained(base_model, "Simon-Liu/gemma-4-E4B-it-open-doc") - Notebooks
- Google Colab
- Kaggle
gemma-4-E4B-it-open-doc
A LoRA adapter for MCP tool calling, trained by colab-finetune-mcp through its teacher-driven pipeline: reverse-generate the data, filter it for quality, then run SFT.
- Base model:
google/gemma-4-E4B-it - Method: LoRA (r=16, epochs=3.0, learning_rate=0.0002)
- Tools (from the MCP server):
list_documents,read_document,create_document,list_templates,create_from_template,write_document,rename_document,duplicate_document,delete_document,read_text,write_text,add_comment,list_themes,read_theme,list_assets,upload_asset,find_asset_usages,delete_asset,list_folders,create_folder,file_document,check_layout,render_page,export_document,diff_document,import_markdown
Evaluation (held-out test set)
| Metric | Base (before) | Fine-tuned (after) |
|---|---|---|
| Tool-call rate | 97.0% | 100.0% |
| Function-name accuracy | 60.0% | 99.3% |
| Exact-match rate | 56.3% | 91.1% |
| No-tool accuracy | 100.0% | 100.0% |
Usage
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base = "google/gemma-4-E4B-it"
model = AutoModelForCausalLM.from_pretrained(base, device_map="auto")
model = PeftModel.from_pretrained(model, "Simon-Liu/gemma-4-E4B-it-open-doc")
tokenizer = AutoTokenizer.from_pretrained("Simon-Liu/gemma-4-E4B-it-open-doc")
The model is trained to emit a single
<tool_call>{"name": "<tool>", "arguments": {...}}</tool_call> when the user's request needs a tool,
and to answer in plain text when it does not.
- Downloads last month
- 26