Agentic AI · Day 05 · Chapter 03

Handoffs & Tool Calls
with Groq

No framework from Chapter 02. Just one API, one model, and the loop, built by hand so every step stays visible.

Why Groq for a first agent

Speed
Runs on Groq's own LPU chips. Responses feel instant, which matters a lot when you're live-debugging an agent loop in front of a room
OpenAI-compatible API
Same client library and request shape as any OpenAI-style SDK, nothing new to learn
Generous free tier
No credit card to get started experimenting today
Picking a model

Fast enough to feel it.
Smart enough to work.

Two reasonable defaults on Groq's free tier. Pick based on whether you want speed or headroom. Rate limits change often, so check console.groq.com/docs/rate-limits before you build on these numbers.

Fastest

llama-3.1-8b-instant

~30 RPM · ~6K TPM on the free tier. Smallest, quickest, and reliable enough at straightforward tool calls. The model to reach for first.

More headroom

llama-3.3-70b-versatile

~30 RPM · ~12K TPM on the free tier, double the token budget. Reach for this one if the 8B model starts fumbling a more involved tool call.

Tool calling, in one sentence

The model asks.
Only your code acts.

A tool call from the model is only a request, with arguments your code hasn't verified yet. Your application decides whether to actually run it.

Groq LLMasks for a tool by name, with some arguments
Your codechecks the request and validates the arguments
Real tool / APIruns with your own credentials, not the model's
Back to the modelthe result feeds back in, reasoning continues
The model never touches the tool directly. It proposes; your code disposes.
Handoffs, in one sentence

One agent forwards.
Another finishes.

A handoff is just your code noticing the question is outside this agent's lane, and passing the conversation (plus context) to a different prompt or model built for that lane.

Task arrivesuser asks something
Generalist agentcan it handle this?
Handoffif it's out of its lane
Specialist agentanswers, hands back
Today, hands-on

What we'll actually
wire up.

No code today. Just the shape of what we'll build together, live.

1
One Groq client. A single API key, one model call.
2
One tool function. Small enough to build today, useful enough to matter.
3
One handoff condition. A simple rule for "this isn't my lane."
4
One loop that stops. A clear exit condition, checked every turn.
End of Chapter 03

An agent that only
runs on your laptop isn't done.

Next: getting this thing off your machine and onto the internet, without waking up to a surprise bill or a silent failure.

← Chapter 02Chapter 04: Cloud & Deployment →