Fine-tuning LLMs for Tool Use (w/ Example Code)

From the creator

🀝 Your team not maximizing Claude? I run 1:1 and team AI workshops for companies doing $10M+ per year: https://aibuilder.academy/yt/fAFJYbtTsC0 Here, I discuss how to fine-tune gemma-3-1b-it to use tools. I review how this works conceptually, then walk through a concrete example with Python code. πŸ“° Read More: https://medium.com/@shawhin/fine-tuning-llms-for-tool-use-5f1db03d7c55?sk=2b2018e1eca3509eb88b1fbd59135319 πŸ’» GitHub Repo: https://github.com/ShawhinT/llm-tool-use-ft πŸ’Ώ Dataset: https://huggingface.co/datasets/shawhin/tool-use-finetuning πŸ€— Fine-tuned Model: https://huggingface.co/shawhin/gemma-3-1b-tool-use References [1] https://youtu.be/eC6Hd1hFvos [2] arXiv:2407.21783 [cs.AI] [3] https://www.llama.com/docs/model-cards-and-prompt-formats/llama3_1/#-tool-calling-(8b/70b/405b)- [4] arXiv:2503.19786 [cs.CL] [5] https://ai.google.dev/gemma/docs/core/huggingface_vision_finetune_qlora [6] https://gautam75.medium.com/fine-tuning-llama-3-1-8b-for-function-calling-using-lora-159b9ee66060 [7] arXiv:2304.08354 [cs.CL] [8] arXiv:2302.04761 [cs.CL] Intro - 0:00 What is Fine-tuning? - 0:16 Training Data - 1:27 Example: Fine-tuning Gemma 3 to Use Tools - 5:34 Step 1: Define Tools - 6:48 Step 2: Generate Queries - 8:49 Step 3: Generate Traces - 10:05 Step 3.5: Refine Traces - 15:57 Step 4: Fine-tune Model - 17:12 Step 5: Evaluate Model - 23:10

Stop watching Β· start building
Matched to OpenAI

Makers residency 4th edition

Your idea can be anything. At our last workshops, people built plant-based nutrition businesses, a way to measure planetary resilience, crochet headwear and a way to connect lonely people living in the same building. An asset manager went on to raise an additional Β£25M on their fund within nine months. The fourth workshop is a full day at KOKO with Nick Sarafa, learning to build with Claude Code. Bring the thing you keep meaning to start. We’ll bring the pizza.

β—† Fri 13 Nov 2026 β—† KOKO, London
Makers residency 4th edition
Live event
Makers residency 4th edition
Fri 13 Nov 2026
Find a job · 1 live role

Jobs in AI.
Apply now.

Apply once › get screened › meet the company

See all roles

More like this

Running one yourself?

List your AI event,
wherever it is.

A meetup, a workshop, a hackathon, a conference. Any city, or online. Tell us about it and it lands in front of people already learning this stuff.