Sitemap

Member-only story

Fine-tuning LLMs for Tool Use

How to get models to search the web, run code, and do your taxes

8 min readJul 19, 2025

--

Although large language models (LLMs) have redefined what’s possible with AI, they still have a fundamental limitation. They cannot interact with the outside world, leaving their knowledge frozen in time and restricting their abilities to text generation. In this article, I’ll discuss how we can overcome this limitation by fine-tuning LLMs to use tools. I’ll review how this works conceptually, then walk through a concrete example with Python code.

Press enter or click to view image in full size
Photo by Anton Savinov on Unsplash

Today, tool calling is a standard ability across models like GPT-4.1, Claude, and Llama 3. You can simply describe how your tool works (via a JSON object), and modern models can figure out when and how to use it.

While this, coupled with some good instructions, works well for many use cases, there are two cases where this may not be sufficient. First, you are using a small language model that was never trained to make tool calls. Second, your use case requires complex and domain-specific tool calling.

--

--