
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 to run code agents safely in your system using a constrained Python interpreter and sandboxing using E2B.
- To trace, debug, and assess the code agent to optimize its behaviours for complex requests.
- How to build a research multi-agent system that can find information online and organize it into an interactive report.
By the end of this course, you’ll know how to build and run code agents using smolagents, and deploy them safely with a structured evaluation system in your projects.
Please sign up here! https://www.deeplearning.ai/short-courses/building-code-agents-with-hugging-face-smolagents
Thu Apr 24 2025 01:54:13 GMT+0800 (China Standard Time)