β All models Β· Llama 3.2 3B
use case Β· practical Β· agentic
The building block under every "agent": given a plain-English request and a menu of tools, the model must pick one tool and fill in its arguments as strict JSON β the step your code then dispatches to a real function. It leans on instruction-following and schema-adherence, exactly where the 3B pulls ahead of the 1B. WebLLM's JSON mode guarantees the output parses; the whole decision runs on your GPU with no server.
Available tools (the model must choose exactly one):
get_weather(city, unit?) β current conditionsset_reminder(text, datetime) β schedule a remindersend_email(to, subject, body) β draft an emailconvert_currency(amount, from, to) β FX conversionsearch_web(query) β look something upThe function call streams here.
We describe the tool schemas in the system prompt and pass
response_format: { type: "json_object" } to WebLLM, which constrains decoding so the
tokens can only form valid JSON β no "sometimes it wraps the call in prose" failure. The model
returns { "tool": "β¦", "arguments": { β¦ } }; the page parses it, checks the tool name
against the known list, and shows the dispatch your code would perform. A wrong or unknown tool is
flagged rather than hidden β this is a router you could actually wire to real functions.
β Basics Β· Llama 3.2 3B Β· Next: Wild β