How LLM Tool Calling Actually Works: A peek under the hood

A deep dive into how LLM tool calling actually works under the hood — from JSON schemas to grammar constraints to raw token generation. All with real logs from Gemma 4 E2B running on a Raspberry Pi 4B via llama.cpp.