barometech / gpt2-tool-call
PublicGPT-2 124M tool-calling: 50% BFCL, 92% fresh bench. Adapter (250K) + Full FT. CPU reproducible.
This is a research project demonstrating that GPT-2 124M—a small, open-source AI model—can be fine-tuned to perform function-calling tasks (like deciding when to call a weather API or database query). The project provides two pre-trained checkpoints: a lightweight adapter approach (250K trainable parameters, 1 MB) achieving 50% accuracy on industry benchmarks, and a full fine-tune approach (124M parameters, 475 MB) achieving 92% accuracy on a fresh 690-item test with zero training contamination. Users can download the ready-made models to immediately add function-calling to their applications, or train custom versions from scratch using provided scripts. The project is MIT-licensed, well-documented with honest disclosure of benchmark limitations, and reproducible on a standard laptop CPU.
How It Works
Someone mentions that a small, free AI model (GPT-2) can be taught to understand when to call tools like weather APIs or database queries.
You grab one of two pre-trained versions: a lightweight adapter (1 MB) or the full model (475 MB) that works right out of the box.
Load the weights, give the model your function descriptions, and start asking it questions immediately.
Feed it examples of your own tools and requests, let it learn for about an hour on your computer, and save your custom model.
You describe your functions in plain text—things like get_weather(city) or search_database(query)—and the model studies them.
You say 'What's the weather in Paris?' and the model responds by outputting a structured call like get_weather(city='Paris').
The model correctly picks the right tool and arguments for novel requests it has never seen before, running entirely on your own computer.
Star Growth
Repurpose is a Pro feature
Generate ready-to-use prompts for X threads, LinkedIn posts, blog posts, YouTube scripts, and more -- with full repo context baked in.
Unlock RepurposeSimilar repos coming soon.