How LLMs Call Tools
How LLMs use function calling and tool use — the mechanics behind tool-calling agents, from prompt engineering to structured output.
Last updated
How LLMs Actually Call Tools
LLMs never execute code — they emit structured text that your system runs. Master this one mechanism and every agent, from a support bot to a coding assistant, stops being magic and starts being architecture.
Tool calling is an illusion of action. The model outputs a JSON object that looks like a function call. Your code parses it, runs the real function, and feeds the result back as more text. The model never touches your APIs, databases, or file system — it only ever reads and writes tokens.
Related
More in LLM & Agentic
LLM Lifecycle
PreviewComplete lifecycle of large language models from pre-training through fine-tuning, RLHF, and deployment — with architecture diagrams and production considerations.
When to Fine-Tune: The Decision Framework
PreviewShould you fine-tune at all? A structured decision framework for prompt engineering vs RAG vs fine-tuning.
LoRA, QLoRA & PEFT Methods
PreviewHow LoRA works inside transformer layers, QLoRA for memory-efficient training, and the full PEFT method comparison with code examples.
Knowledge Distillation: Large to Small
PreviewTrain a small, fast model to mimic a large teacher — economics, pipeline, and quality filters for production distillation.
Get full access to all 87+ sections with code examples, diagrams, and interactive animations.
Unlock Premium