A8gent
AI Agent PlatformsDeveloper framework

Hugging Face smolagents Pricing and Review (2026)

A tiny agent library where agents write their actions as code.

Reviewed by A8gent
Contents
  1. Verdict
  2. What is Hugging Face smolagents?
  3. Best for, and not for
  4. Strengths and limits
  5. Pricing
  6. What people actually build with smolagents
  7. What smolagents actually costs at small-business volume
  8. The gotcha: the sandbox is a third bill nobody budgets for
  9. What breaks in production, and how you find out
  10. What it connects to that you already run
  11. smolagents alternatives: what to pick instead, and when
  12. Migration and lock-in: can you get your work out?
  13. FAQ
VerdictIs Hugging Face smolagents worth it?

smolagents is a genuinely elegant idea in a codebase small enough to read in an afternoon, and its maintenance has visibly slowed. Checking GitHub on 6 August 2026: roughly 28,700 stars, but the last tagged release was v1.26.0 on 29 May 2026, over two months earlier, and only 15 commits landed in the preceding three months, most of them CI upkeep and dependency bumps rather than features. The backlog is 283 open issues and 462 open pull requests. It is not abandoned and the repository was pushed on 21 July 2026, but it is not being actively developed either. Treat it as a stable, small, largely finished library rather than a project on a roadmap.

What is Hugging Face smolagents?

smolagents is a minimalist open-source Python library from Hugging Face for building agents, with core logic that fits in roughly a thousand lines of code. Its signature idea is the CodeAgent, where instead of emitting JSON tool calls the model writes Python snippets that are executed to perform actions, which Hugging Face's benchmarks show can cut the number of steps and LLM calls on complex tasks. It supports sandboxed execution through Docker, E2B, Modal, and similar backends, and connects to Hugging Face Hub models as well as commercial APIs.

Best for

Developers and learners who want a small, readable agent library, and tasks where code-as-action beats JSON tool calling.

Not for

Any business without a developer, and any team that cannot properly sandbox code execution. Running model-written Python against systems that hold your customer data without an isolated executor is not a shortcut, it is an incident waiting for a date.

Strengths

  • Genuinely small. The agent logic fits in roughly a thousand lines, so you can read the whole loop and actually know what your agent does
  • CodeAgent writes its actions as Python, which composes naturally through function nesting, loops and conditionals in a way JSON tool calling cannot
  • ToolCallingAgent is there when you want conventional JSON tool calling instead, so the code-execution model is a choice rather than a requirement
  • Sandboxed execution is supported out of the box through Modal, Blaxel, E2B and Docker rather than left as an exercise
  • Model-agnostic and unusually broad at the cheap end: Hugging Face Inference Providers, OpenAI, Anthropic, anything through LiteLLM, or local models via Transformers and Ollama
  • Tool-agnostic in a useful way, consuming tools from any MCP server, from LangChain, or from a Hugging Face Space
  • Modality-agnostic, handling vision, video and audio inputs, and it ships CLI utilities so you can run an agent without writing boilerplate

Limitations

  • Development has clearly slowed: 15 commits in the three months to 6 August 2026, mostly CI and dependency maintenance, with the last feature-bearing release v1.26.0 on 29 May 2026
  • The backlog was large: 283 open issues and 462 open pull requests on 6 August 2026. By 17 November 2026 open pull requests were down to 81, but there was still no release after v1.26.0, so fixes that merge are not reaching a tagged version
  • Executing model-written code is a real security exposure and sandboxing is mandatory rather than advisable, which adds a vendor or a container to every deployment
  • Code-generating agents fail in more varied ways than tool-calling ones, so testing is harder and a plausible wrong answer is easier to miss
  • Minimal by design, so agent memory, retries, monitoring and integrations are entirely yours to build
  • Python only, with no JavaScript or .NET version
  • A smaller production track record than the major frameworks, with most published use in research, teaching and prototyping

Hugging Face smolagents pricing

smolagents is free under Apache 2.0 with no fee, seats or execution meter, so the billing units that matter are elsewhere: model tokens, and the sandbox. The sandbox is the one people forget. Because CodeAgent executes model-written Python, running it safely means a sandboxed executor, and the supported options include Modal, Blaxel, E2B and Docker. Docker on your own machine is free apart from the machine. Modal, Blaxel and E2B are hosted services with their own per-second or per-session billing, which means a smolagents deployment can have three separate meters running: your model provider, your sandbox provider and your host. That is more billing surfaces than any other framework in this batch.

Hugging Face smolagents pricing tiers
PlanPriceWhat you get
smolagents library$0Apache 2.0. No fee, seats or execution meter. Python only
Model tokensProvider ratesModel-agnostic: Hugging Face Inference Providers, OpenAI, Anthropic and many more via LiteLLM, or local models through Transformers and Ollama
Sandbox: Docker self-hosted~$0 plus your serverFree software. You run and secure the container yourself, which is the cheapest option and the most work
Sandbox: hosted (Modal, Blaxel, E2B)Third-party ratesEach bills separately on its own meter. A second vendor relationship and a second invoice on top of your model provider
Self-hosted open-weight inferenceGPU costsRemoves token fees and replaces them with hardware or GPU hosting. Rarely cheaper below very high volume
Hosting~$5-$20/moA small server to run the agent process, if you are not already running one

Pricing reflects public plans as of August 6, 2026 and can change. Check Hugging Face smolagents for the latest.

What people actually build with smolagents

The code-execution model is genuinely better than JSON tool calling for a specific class of task: anything where the work is manipulating data rather than invoking a named operation. That is the honest boundary of where smolagents wins, and it is narrower than its star count suggests.

smolagents project health, from the GitHub API on 6 August 2026
SignalValueReading
Stars~28,700Popular, and popularity lags reality
Last push21 July 2026Two weeks before we checked
Last tagged releasev1.26.0, 29 May 2026Over two months without a release
Commits in prior 3 months15Mostly CI fixes and Dependabot bumps
Open issues283Not being closed at the rate they arrive
Open pull requests462 (81 on 17 Nov 2026)Backlog cut since August, still no new release
Language supportPython onlyNo JavaScript or .NET version
LicenceApache 2.0Forkable, which is the real mitigation

Where code-as-action genuinely wins

Ad-hoc data analysis over a spreadsheet or export, which is the use case the code-execution model was made for. Someone drops a CSV of last quarter's orders and asks which customers dropped off. The agent writes pandas code to load it, filter it, group it and compare periods, all inside a sandboxed executor, and returns both the answer and the code it ran. A tool-calling agent would need a dozen carefully designed tools to do the same thing badly. This is where CodeAgent earns its keep.

Text-to-SQL against a read-only replica, which the documentation uses as a worked example. A question arrives, the agent writes SQL, runs it against a replica with read-only credentials, inspects the result and refines the query if it looks wrong. The read-only replica is doing as much safety work here as the sandbox, and both are non-negotiable.

A web research agent that gathers and structures information. The library ships a webagent CLI utility and a DuckDuckGo search tool, so a working research agent is a few lines. Run it on a schedule against named sources and deliver a structured summary. Because it can nest calls and loop in a single generated action, it covers ground in fewer model calls than a JSON equivalent.

Teaching, and where it is a poor fit

A teaching and evaluation harness. smolagents backs Hugging Face's agents course, and a genuinely common use is internal: a small readable loop a team can instrument to understand how agents behave before committing to a heavier framework. Given the maintenance picture, this may be its most defensible role in 2026, and it pairs well with our AI agent learning path.

Where it is a poor fit, and this is the important paragraph: anything unattended that touches money, customer records or outbound communication. Not because the library is bad, but because two things stack badly. Model-written code has a wide blast radius, and the project shipped fifteen commits in three months with 462 pull requests waiting. If a security-relevant bug appears in your sandbox integration, you may be the one fixing it. For a business process that has to run every day whether or not you have time to read source code, choose something with a maintainer answering issues this month, or hand the whole thing to a done-for-you build.

Bottom line: smolagents is the right tool when the agent's job is manipulating data and the wrong tool when the agent's job has to run unattended against systems that matter.

What smolagents actually costs at small-business volume

The library is free and takes nothing. What makes its cost model less tidy than the other free frameworks here is that a properly deployed smolagents system usually has three meters running rather than two: the model provider, the host, and the sandbox.

smolagents monthly cost at the reference workload (1,000 runs, ~3,000 in / 400 out tokens each), checked 6 August 2026
Line itemDocker self-hostedHosted sandboxLocal model
Library licence$0 (Apache 2.0)$0$0
Model tokens~$1 budget, ~$27 frontier~$1-$27$0
Sandbox$0 in fees, real engineering timeThird-party meter, quoted by vendor$0 in fees
Host or GPU~$5-$20/mo~$5-$20/moGPU hosting or hardware
Meters to watchTwoThreeOne
Forecastable?Yes, once the container existsYes, after you price the vendorFixed, but the fixed number is larger

Why CodeAgent moves the token estimate both ways

Downward, because a single generated action can nest several operations that a tool-calling agent would spread over multiple round trips, and fewer round trips means fewer prompts carrying accumulated context. Upward, because when generated code fails the agent sees the traceback and tries again, and a stubborn task can burn several attempts before it converges.

That retry behaviour is the number to measure rather than estimate. Run a representative sample, look at the actual distribution of steps per completed task, and budget against the tail rather than the median. A task that usually takes two steps and occasionally takes fifteen has a monthly running cost driven by the fifteen.

The sandbox is a real cost even when it is free

Docker on your own infrastructure is free software, and its cost is the container you build, secure and keep patched, which is real engineering time rather than an invoice. Modal, Blaxel and E2B remove that work and add a bill on their own meter, typically priced by execution time or session. Whichever you pick, price it before you build, because a sandbox is not optional for code execution and discovering its cost after the prototype works is the wrong order.

The cost floor is genuinely low, though, and that is worth saying. A local model through Ollama, a Docker sandbox on a machine you already own, and the marginal cost of a run approaches zero. Almost nothing else in this directory can say that, and it is the reason smolagents keeps a place in the conversation despite everything above.

Bottom line: A smolagents deployment runs three meters, not two, and the third one, the sandbox, is the line most estimates leave out entirely.

The gotcha: the sandbox is a third bill nobody budgets for

smolagents has no pricing at all, so the gotcha is structural rather than commercial. Every other free framework in this directory has a two-line cost model: tokens plus hosting. smolagents has three lines, because safe code execution requires an isolated executor and that executor is either engineering work or a vendor.

This gets missed because of how people evaluate the library. You try it, it is delightful, the agent writes Python and solves your problem in four lines of setup, and the executor in that first experiment is your laptop. Everything about the experience says this is free and simple. Then someone asks whether it can run against the production database, and the answer requires either a hardened Docker environment with locked-down credentials and no network route to anything sensitive, or a hosted sandbox from Modal, Blaxel or E2B with its own account, its own meter and its own invoice.

Neither option is expensive in isolation. Both are a cost that was absent from the estimate, and the Docker route in particular is deceptive because it has no price tag while consuming real engineering time, both to build and to keep patched. A sandbox is security infrastructure, and security infrastructure that nobody maintains stops being security infrastructure.

The second-order version of the same problem is that your sandbox choice becomes load-bearing. If you build on a hosted executor and it changes its pricing, deprecates an API or has an outage, your agents stop. You have taken a dependency on a second vendor to make a free library safe. That is a reasonable trade, but it should be a decision made deliberately at design time rather than discovered at deployment.

The practical guidance: choose the sandbox before you choose the framework. If the answer is that nobody on the team wants to own a hardened container and there is no budget for a hosted executor, that is a legitimate reason to use a tool-calling framework instead, where the safety question is smaller and the bill has two lines.

Bottom line: A free library that requires a sandbox is not a free deployment: price the executor, in dollars or in engineering hours, before you commit to code-as-action.

What breaks in production, and how you find out

The maintenance picture is the production risk here, so it belongs first rather than last, ahead of anything about the code itself.

The dependency risk you are actually taking

Checked on 6 August 2026: last release v1.26.0 on 29 May, last push 21 July, 15 commits in three months, and those commits were a security policy update, CI fixes and Dependabot bumps rather than features. 283 open issues and 462 open pull requests. Nothing about that says abandoned, and it does say that a bug you report is unlikely to be fixed on your schedule. Before deploying anything you depend on, decide explicitly whether your team would maintain a fork, because at roughly a thousand lines that is genuinely feasible and it is the only real mitigation.

Plausible wrong answers and blast radius

Plausible wrong answers are the characteristic runtime failure of code-generating agents. The model writes code that executes cleanly, returns a well-formatted number and has quietly filtered on the wrong column. Nothing errors. Nobody notices until someone reconciles the figure by hand weeks later. Have the agent return the code it ran alongside the result, log both, and spot-check them, because the generated code is the only evidence of what actually happened.

Sandbox escape and credential leakage are the failures with real consequences. A code executor with a network route to your internal systems, or with environment variables carrying broad credentials, is a single confused generation away from doing something you cannot undo. Scope credentials to the narrowest possible permission, use read-only replicas wherever the task allows, and confirm the sandbox genuinely has no path to anything sensitive rather than assuming the container image handles it. Our risk checklist covers the questions worth asking before launch.

Cost failures and the missing furniture

Retry loops on stubborn tasks are the cost failure. The agent writes code, the code fails, it reads the traceback and tries again, and on a task it cannot actually do it will keep trying. Set a hard step limit that reflects what the task needs rather than accepting a generous default, and alert when runs consistently hit it, because that pattern means a task is failing rather than being slow.

Finally, everything the library deliberately omits is yours: no monitoring, no retry logic, no deployment story, no state management. That is the honest bargain of a minimal library and it is fine, provided somebody has actually built those things rather than assuming a framework this small included them.

Bottom line: The biggest smolagents production risk is not the code executing, it is a release cadence that stopped at v1.26.0 in May 2026, so the fix for your bug may never ship in a version.

What it connects to that you already run

Model coverage is unusually broad for such a small library. Models hosted on the Hugging Face Hub through Inference Providers, commercial APIs such as OpenAI and Anthropic, anything reachable via the LiteLLM integration, and local models run through Transformers or Ollama. That last option matters more here than in most frameworks, because it is the route to a deployment with no per-token cost at all, and because agents can also take vision, video and audio inputs rather than text only.

Tool sourcing is the genuinely clever part. smolagents is tool-agnostic in a practical sense: it can consume tools from any MCP server via ToolCollection.from_mcp, import a LangChain tool through Tool.from_langchain, and even use a Hugging Face Space as a tool through Tool.from_space. So the integration story is partly borrowed from ecosystems much larger than its own, which softens the small-community problem considerably.

MCP is the important one for business systems. Any software that exposes an MCP server becomes available to the agent without you writing a connector, and the set of business software doing that keeps growing through 2026. If your CRM or helpdesk has one, that is your integration.

Sandbox providers are the integration nobody counts as one, and they should. Modal, Blaxel, E2B and Docker are supported executors, and choosing among them is a real architectural decision with cost, latency and security consequences rather than a configuration line.

Business systems without an MCP server are, as everywhere in this category, code you write. The compensation specific to smolagents is that a CodeAgent can often just use a vendor's Python SDK directly inside its generated code rather than needing a wrapped tool for each operation, which is genuinely faster to build. It is also exactly the capability that makes the sandbox non-negotiable.

Bottom line: smolagents borrows its integration breadth from MCP, LangChain tools and Hugging Face Spaces, which is why such a small library punches above its own ecosystem.

smolagents alternatives: what to pick instead, and when

Given the maintenance picture, the honest framing is not which alternative you might prefer but which one you should probably choose. All the options below are free, so the deciding axes are maintenance cadence, security profile and whether code-as-action genuinely suits the task.

smolagents vs the alternatives at 1,000 runs a month, checked 6 August 2026
OptionLast release checkedCost at reference workloadSuitsDoes better than smolagents
smolagentsv1.26.0, 29 May 2026~$1-$27 tokens plus sandboxData-shaped tasks, learning agentsReadability, and a near-zero cost floor with a local model
Pydantic AIv2.25.0, 6 August 2026~$1-$27 tokens, free tracingProduction business agents in PythonActive daily development and validated typed output
OpenAI Agents SDKVendor maintained~$1-$27 tokens plus hostingOpenAI-only builds wanting a small libraryGuardrails and built-in tracing without a sandbox
LangGraphVendor maintained~$1-$27 tokens plus hostingWorkflows with branches and approvalsExplicit control flow you can audit
Microsoft AutoGenVendor maintainedHigher: conversation multiplies callsExploratory multi-agent researchEstablished multi-agent conversation patterns
CrewAIVendor maintainedHigher: multi-agent multiplies callsRole-based agent teamsReady-made delegation patterns

When to pick the alternative outright

Pick Pydantic AI for essentially any production business agent in Python. The maintenance comparison is stark and it is the whole argument: three minor releases in three consecutive days versus no release in over two months. You also get validated structured output and a security profile that does not require a sandbox at all, because the agent emits tool calls rather than executable code.

Pick the OpenAI Agents SDK if you are building against OpenAI and want something similarly small but with guardrails and tracing included, and without the code-execution risk. Pick LangGraph when the task has branches and a human approval step and you need to be able to show what path a run took.

Pick Microsoft AutoGen or CrewAI only if the problem genuinely needs several agents collaborating, and go in knowing a multi-agent system multiplies model calls per outcome, so the reference workload costs meaningfully more than the single-agent figure above.

Stay with smolagents when the task is genuinely data manipulation that composes badly into discrete tools, when you want to read every line of the framework, or when you are teaching. Those are real reasons. Wanting a maintained production dependency is not currently one of them.

Bottom line: On maintenance evidence alone, Pydantic AI released three versions in the three days before we checked while smolagents had not released in two months, which is the whole case for switching.

Migration and lock-in: can you get your work out?

Commercially, this is as close to zero lock-in as software reaches. Apache 2.0 licence, no vendor with any leverage, no seats, no meter, no proprietary format, and a codebase small enough that forking it is a realistic option rather than a rhetorical one. Given the maintenance picture, that last point is not a theoretical comfort. It is the actual mitigation, and it is worth deciding now whether your team would take it.

Your tools port more easily than the agent does. A smolagents tool is a Python function with a description, which every Python agent framework accepts in some form, so moving tools to Pydantic AI or another library is largely mechanical. Your prompts, your evaluation cases and your knowledge of what the task actually requires all move with you, and that is most of the accumulated value.

What does not port is the code-execution architecture itself, and this is the honest constraint. A system designed around an agent writing and running Python does not map onto a structured tool calling framework without rethinking the tasks. Operations that were one generated code block become several tool calls that you have to design, name and document. That is a redesign, not a port. It is also usually an improvement in testability and safety, so it is not wasted work, but budget for it properly rather than expecting a lift and shift.

The sandbox is a separate dependency with its own exit cost. Docker moves anywhere. A hosted executor from Modal, Blaxel or E2B has its own API, and switching means rewriting how execution is invoked and re-validating your isolation assumptions from scratch.

The overall position is good and worth stating plainly: nobody can hold your work hostage, the library is small enough to own outright if you have to, and the valuable parts of what you build are portable. The risk is not that you cannot leave. It is that the project may effectively leave first, and the work of staying safe on an unmaintained dependency quietly becomes yours.

Bottom line: With smolagents the lock-in risk runs backwards: nothing stops you leaving, but the project may stall first and the maintenance burden becomes yours by default.

Hugging Face smolagents FAQ

Is smolagents still maintained in 2026?

Barely, and honestly this is the main thing to know before adopting it. Checking the GitHub API on 6 August 2026: the repository was last pushed on 21 July 2026, the last tagged release was v1.26.0 on 29 May 2026, and only 15 commits landed in the three months prior, dominated by CI fixes, a security policy update and Dependabot bumps. There were 283 open issues and 462 open pull requests that day. Checked again on 17 November 2026, open pull requests were down to 81, but v1.26.0 was still the latest release. It is not archived and not abandoned, but it is in caretaker mode rather than active development.

What does smolagents cost?

The library is free under Apache 2.0. Your costs are model tokens plus hosting plus, importantly, a sandbox. On our reference workload of 1,000 agent runs a month at roughly 3,000 input and 400 output tokens, tokens land around a dollar on a budget model and around twenty-seven on a frontier model. Add $5 to $20 for a small server. Then add the sandbox: free if you run Docker yourself, or a third-party bill if you use Modal, Blaxel or E2B. That third meter is what makes smolagents costs less tidy than they look.

Is it safe to run model-generated code?

Only inside a proper sandbox, and this is the single most important decision in any smolagents deployment. Run it in an isolated environment with no network access to sensitive systems, no credentials it does not strictly need and a filesystem it cannot escape. The library supports Modal, Blaxel, E2B and Docker for exactly this. Treat the generated code precisely as you would code submitted by an untrusted stranger, because a confused model and a prompt injection attack produce indistinguishable outcomes and the model's good intentions protect nobody.

What is a CodeAgent and why does it matter?

Rather than emitting a structured JSON tool call for your code to interpret, a CodeAgent writes Python that then executes. That composes naturally: it can nest function calls, loop and branch in a single action, where a tool-calling agent would need several separate round trips. For data manipulation work that genuinely reduces steps and model calls. It also enlarges the blast radius considerably when the model is wrong, which is why the library ships sandboxed executors and why ToolCallingAgent exists as the conservative alternative.

Should we use smolagents in production?

For a narrow, well-sandboxed task owned by a developer who has read the source, it is defensible. For anything business-critical, weigh the maintenance picture first: two months since the last release, fifteen commits in a quarter and 462 unmerged pull requests mean a bug you report may not be fixed on your timeline. The mitigating factor is size. At roughly a thousand lines you could realistically maintain a fork, which is not a sentence you can write about most frameworks. Decide whether your team would actually do that.

smolagents vs Pydantic AI?

Pydantic AI for almost any production business agent, and it is not close on the maintenance evidence: it shipped three minor releases in three days the week we checked, while smolagents had not released in over two months. Pydantic AI also gives you validated structured output and a security profile that is much easier to reason about. Choose smolagents when the code-execution model genuinely fits the task, when you want to read and understand every line, or when you are learning how agents work, which it remains excellent for.

Does smolagents only work with Hugging Face models?

No, and the model flexibility is one of its real strengths. It works with models on the Hub via Inference Providers, with commercial APIs including OpenAI and Anthropic, with anything reachable through LiteLLM, and with local models through Transformers or Ollama. Agents can also handle vision, video and audio inputs. That breadth means you can drive the token cost close to zero with a local model, though at small volume a hosted budget model is still cheaper than owning a GPU.

Should we self-host an open-weight model with it?

Rarely at small-business scale, and the reason is arithmetic rather than principle. A hosted budget model handling a thousand agent runs a month costs a few dollars. A GPU capable of serving a useful open-weight model costs considerably more before you count the operational work of keeping it running and patched. Self-hosting earns its place at very high volume or under a hard data residency requirement. It does not earn its place as a cost saving on a thousand runs a month.

Can you build something small and safe on this for us?

We can, and in most cases we would advise a better-maintained framework instead and tell you why. Where code execution genuinely is the right model, the safety design is most of the engineering: sandbox isolation, credential scoping, output validation and hard step limits are what turn a clever prototype into something you can leave running. We scope it on a free automation audit, build with those controls from the start, and hand over the code and documentation you own outright plus a recurring plain-language report of what ran, what it cost and what needs attention.

Looking at alternatives? smolagents remains the best way to actually understand how an agent works, and we would still recommend reading it to anyone learning. What has changed is the maintenance picture, and it would be dishonest to write this page without leading on it: two months without a release, fifteen commits in a quarter and 462 open pull requests describe a library in caretaker mode, not one on a roadmap. That is survivable for something this small, because you could maintain a fork yourself, and it is a real risk for anything you need patched quickly. Where it beats us outright is transparency and cost floor. Where it does not compete at all is a business that needs the thing to keep working without anyone reading source code. See the Autonoly review.