SimpleTool-Gemma4-E4B
function-calling adapter
1 min readupdated
This adapter package extends the base google/gemma-4-E4B-it model with advanced structured tool-use capabilities. The model splits generation into logical branches—content, function, and arguments—improving parameter handling accuracy. The solution is designed for developers who need reliable language model integration with external APIs and functions.
Key features
- Multi-branch architecture: independent branching for content, function, and arguments.
- Specialized weights: includes standard LoRA weights, trained tokens, and configuration files.
- Bilingual support: tested on Chinese and English in a benchmark evaluation.
- Custom logic: contains a custom structure recovery script and tokenizer templates.
What you can do
- Set up a function-calling pipeline for Gemma 4-based chatbots.
- Integrate the adapter into local inference scripts for processing structured requests.
- Run tests on your own argument generation and API-calling tasks.
Example
Running inference via the script from the repository:
python infer.py --base /path/to/original-base --artifact /path/to/repo --messages messages.json --args 2Read more
DetailsCompatibility: Python 3.12, Torch 2.11.0, Transformers 5.17.0
Metrics: Function matches — 96.875%, required calls — 70.625%
Base model: google/gemma-4-E4B-it










Comments