monday8am/functiongemma-trainer
0
FunctionGemma Trainer
Fine-tune Google's FunctionGemma (270M) for custom on-device function calling. Full pipeline: dataset validation, SFT training on HF Jobs, evaluation, and LiteRT-LM export for Android.
Architecture
Voice/Chat Input -> FunctionGemma 270M (tool selection) -> Tool Execution -> Response LLM -> OutputFunctionGemma is a tiny (270M param) model that selects which tool to call. A separate model generates the final response.
Links
Install as Claude Code Plugin
# Via plugin marketplace
/plugin marketplace add monday8am/skills
/plugin install functiongemma-trainer@monday8am/skills
# Or manual install
git clone https://github.com/monday8am/skills.git
cp -r skills/skills/functiongemma-trainer ~/.claude/skills/Then invoke in Claude Code:
/functiongemma-trainerQuick Start
# 1. Validate dataset
uv run validate_functiongemma_dataset.py \
--dataset USERNAME/DATASET_NAME \
--tools tools.json
# 2. Train on HF Jobs (~$0.15 on t4-small)
hf jobs run --flavor t4-small --timeout 1h \
--secrets HF_TOKEN=$HF_TOKEN \
-- uv run train_functiongemma.py \
--dataset USERNAME/DATASET_NAME \
--tools tools.json \
--output-repo USERNAME/MODEL_NAME \
--epochs 3
# 3. Evaluate
uv run evaluate_functiongemma.py \
--model USERNAME/MODEL_NAME \
--dataset USERNAME/DATASET_NAME \
--tools tools.json
# 4. Export for Android
hf jobs run --flavor t4-small --timeout 30m \
--secrets HF_TOKEN=$HF_TOKEN \
-- uv run export_litertlm.py \
--model USERNAME/MODEL_NAMETraining Results (Cycling Copilot)
Per-Tool Performance
Key Facts
- Base model:
google/functiongemma-270m-it(58% zero-shot) - Size: 288 MB (dynamic int8 quantization)
- Latency: 0.3s time-to-first-token on Samsung S25 Ultra
- Critical: Always use
--max-length=1280+(tool schemas alone are ~825 tokens)
License
MIT
