Running Models YourselfLesson 51 of 82

Module 6 · Getting good output

Tool calling that survives contact with a small model

In this lesson

  • 9 min read
  • 7 reading sections
  • Knowledge check
  • Lesson 5 of 9 in this chapter

This chapter’s goalDiagnose a disappointing local output to its actual cause (sampler, template, prompt, context length, quantisation or the weights) in a defined order, and build a small evaluation harness that tells you whether any change you make is an improvement or noise.

This chapter’s media

The film explains chapter ideas. The audiobook narrates the complete teaching text.

FormatEnglishहिंदी
Chapter filmNot availableNot available
Full audiobookNot availableNot available
Per-call reliability compounds, and no prompt fixes an exponent050100110Tool calls in the chainWhole chain succeeds, per cent—— Ninety-two per cent per call– – Ninety-seven per cent per callA good 8B emits a syntactically valid call with the right function name most of the time, and most ofthe time is exactly the problem. Constrained decoding removes the syntax failures and not thejudgement ones, so the design that works is one or two calls per turn with validation in code betweenthem, and a step budget.
A good 8B emits a syntactically valid call with the right function name most of the time, and most of the time is exactly the problem. Constrained decoding removes the syntax failures and not the judgement ones, so the design that works is one or two calls per turn with validation in code between them, and a step budget.

Figure

A little at a time

Explore an idea, try it, then check what stays.

Step 1 of 8Free · no account needed
Lesson steps

What a tool call actually is

There is no special mechanism. The model is shown a description of some functions, and it emits text in a particular format that the server parses into a structured call. Your code executes the function and puts the result back into the conversation as another message. The model then continues.

Everything that goes wrong follows from that being ordinary text generation with a parser downstream.

Your place and first choices stay on this browser. Classroom credit is recorded separately.

Every lesson here is open. Your progress is recorded once you pass the Open Model Ecosystem exam.

Stuck on something?Ask Tri, your AI tutor

How to cite: Addaly (2026) ‘Tool calling that survives contact with a small model’, in Running Models Yourself. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/running-models-yourself/tool-calling-locally (Accessed: 29 November 2026).