Vibeleaderboard
← All Intel
Intel / post

Hugging Face's smolagents course: why code agents beat tool-calling loops

Source
x.com
Date
Andrew Ng@AndrewYNg

New short course: Building Code Agents with Hugging Face smolagents! Learn how to build code agents in this course, created in collaboration with @huggingface, and taught by @Thom_Wolf, its co-founder and CSO, and @AymericRoucher, Hugging Face’s Project Lead on Agents. Tool-calling agents use LLMs to generate multiple function calls sequentially to complete a complex sequence of tasks. They generate one function call, execute it, observe, reason, and decide what to do next. Code agents take a different approach. They consolidate all these calls into a single block of code, letting the LLM lay out an entire action plan at once, which can be executed efficiently to provide more reliable results. You’ll learn how to code agents using smolagents, a lightweight agentic framework from Hugging Face. Along the way, you’ll learn how to run LLM-generated code safely and develop an evaluation system to optimize your code agent for production. In detail, you’ll learn: - How agentic systems have evolved, gaining greater levels of agency over time—and why code agents are a next step. - How code agents write their actions in code. - When code agents outperform function-calling agents. - How…

Read the full post on X

Context

A code can express several operations in a program, including reusing one tool's result in another operation. The smolagents documentation explains this as giving the model code snippets as its action format within an execution-and-observation loop.

The course announcement teaches that approach alongside constrained execution, , tracing, and . The useful capability is composing actions with programming constructs; whether that improves a particular task still depends on the generated program and its execution. The announcement supplies a curriculum, rather than evidence that code agents outperform every function-calling design.

Terms in this piece · Glossary
  • AI agent — An AI system that doesn't just answer once but works toward a goal in a loop — taking actions, reading the results, and deciding what to do next.
  • sandbox — An isolated environment where AI-generated code or agent actions run without being able to touch anything real.
  • eval — A repeatable test for AI quality — a set of tasks plus scoring — used the way software teams use test suites, because model output is too variable to judge by eyeballing.
More from Andrew Ng
Recommended reads
Comments

Checking sign-in…

Loading comments…