What do you like best about Hugging Face smolagents?
The whole core fits in about a thousand lines of Python, and that single fact shapes everything else about working with it. When an agent run does something strange, I open agents.py, read the loop, and know exactly what happened. I have done that with heavier frameworks and given up after the third layer of abstraction. With smolagents the distance between my code, the prompt, and the execution loop is short enough that debugging is reading, not archaeology.
CodeAgent is the reason I picked it over the alternatives. Instead of emitting JSON tool calls that the framework parses and dispatches, the agent writes an actual Python snippet that calls the tools directly, and the framework executes it and feeds the output back. In practice this changes what an agent can do in a single step. A task that would take four or five JSON tool calls in a conventional framework, call a tool, inspect the result, branch, call again, becomes one generated snippet with a loop and a conditional in it. On a data extraction workflow I built, the agent iterated over a list of URLs, filtered the results, and aggregated them inside one action. Fewer round trips to the model, fewer chances for the loop to derail, and the intermediate state is plain Python variables I can inspect in the logs.
Defining tools is about as light as it gets. I write a normal Python function, add type hints and a docstring, put the @tool decorator on it, and the agent can use it. No schema files, no registration ceremony, no adapter classes. My tools live next to the rest of my code and get tested like the rest of my code.
The model layer is genuinely agnostic, and I have exercised that more than I expected to:
- InferenceClientModel for serverless calls through Hugging Face and its inference providers
- LiteLLMModel when I want to point the same agent at OpenAI or Anthropic without touching agent code
- TransformersModel for running a local model during development, when I do not want API costs on every test run
- OpenAIServerModel against a vLLM endpoint we host ourselves
Swapping between these is a one-line change in the constructor. When I was comparing how a 7B local model and a frontier API model handled the same agent task, the entire experiment was two scripts that differed in one argument. For anyone doing cost or compliance work, that portability is not a footnote, it is the feature.
Sandboxed execution is handled properly rather than hand-waved. The docs are direct about the fact that the local Python executor is a convenience with restrictions, not a security boundary, and the framework ships first-class support for running the generated code in E2B, Modal, Docker, or a Pyodide plus Deno WebAssembly environment. I run Docker locally and E2B for anything that touches external input. Setting that up took an afternoon, most of which was my own Docker config, not the framework. I appreciate a project that tells me plainly where the danger is instead of implying everything is safe by default.
The multi-agent story is simple in a way that has aged well for me. Wrap an agent as a managed agent and it becomes a callable tool for an orchestrator, which means delegation happens in generated code and can be conditional or wrapped in a loop like anything else. I built a research pipeline where a manager agent dispatched a web-browsing sub-agent per topic and merged the outputs, and the whole hierarchy was maybe forty lines of my own code. No graph DSL to learn, no separate orchestration vocabulary.
MCP support arrived at the right time. ToolCollection.from_mcp lets me point the agent at an MCP server and pull its tools in without writing wrappers, which is how I connected an internal service that already exposed MCP. As more of our tooling standardizes on that protocol, this is the integration path I expect to use by default.
Two smaller things that earn their keep. The Hub integration means I can push a tool or a full agent and pull it back on another machine or share it with a colleague in one line, which has quietly replaced a couple of internal copy-paste rituals. And the error logging in the agent loop is unusually clear about which step failed and with what output, so a broken run tells me where to look instead of just that something broke.
The system prompts are not hidden from me. I can read the exact prompt the CodeAgent uses, override it, and see precisely what the model sees. After spending time with frameworks where the prompting layer is sealed, having it exposed feels like being handed the keys.
Getting a demo in front of someone non-technical costs almost nothing. The Gradio integration wraps an agent in a chat interface in a couple of lines, so when I want a stakeholder to poke at a prototype instead of reading my description of it, I ship them a link the same afternoon. It is not a production frontend and does not pretend to be one, but for the "is this even useful" conversation it is exactly the right amount of UI.
Memory in the agent loop is inspectable rather than magical. Each run keeps its steps as structured objects I can walk through after the fact, replay into a new run, or trim when the context is getting long. When I was tuning a long-horizon task that kept losing track of earlier results, being able to print the step history and see exactly what the model had been shown at each turn cut the diagnosis from guesswork to minutes. Review collected by and hosted on G2.com.
What do you dislike about Hugging Face smolagents?
The built-in toolbox is thin. Web search, a Python interpreter, image generation, speech-to-text, and a handful of others cover the demos, but almost every real project I have built required writing most of the tools myself. The @tool decorator makes that cheap, so it is friction rather than a wall, but if you are coming from a framework with hundreds of prebuilt integrations, budget time for building your own connectors. The Hub helps somewhat, since community tools are shareable and loadable in a line, but the catalog there is uneven in quality and you have to read what you pull.
Everything the CodeAgent does well depends on the model being able to write correct Python, and that dependency bites hard with weaker models. I tried running the same agent against a small local model to save costs and got stuck in loops of broken code and retries, the kind of session where the agent burns ten steps failing to import something. The framework is honest that this is the tradeoff of the code-first design, but it means the "run it on a small open model" story is more aspirational than practical for anything nontrivial. My working rule now is to develop against a capable model first and only then test how far down the model ladder the task survives.
The API still moves. It is labeled experimental, and it behaves like it. A minor version bump changed the default model behind InferenceClientModel and my recipes quietly started producing different results until I pinned things explicitly. Pinning the package version and specifying models by name rather than relying on defaults is now standard practice for me, and it should be for anyone putting this near anything that matters. I accept the churn as the price of a fast-moving project, but the silent-default class of change is the one I would most like the maintainers to stop making.
One quieter limitation: this is a Python-only world, in both directions. The agents are Python, the generated actions are Python, and the tools are Python functions. That suits my stack, but when I wanted an agent to sit inside a TypeScript service, the honest answer was to run the agent as a separate Python process behind a small HTTP layer and call it from the service, which works and is what I did, but it is an integration you build rather than one you get.
Observability is the gap I feel most in production. There is OpenTelemetry instrumentation, which covers the basics, but if you want the kind of tracing, replay, and fine-grained flow control that the heavier orchestration frameworks provide, you will be assembling it yourself. For prototypes and internal pipelines I have not missed it much. For a customer-facing multi-agent system with strict reliability requirements, I would think hard about whether this is the right layer, or at least plan for building the operational tooling around it. Review collected by and hosted on G2.com.