smolagents
A Python agent library with code-based actions, interchangeable models and MCP tool integrations.
About this listing
smolagents is a Hugging Face Python library for assembling agents from a model and a set of tools. Its CodeAgent represents actions as code, while its integrations let developers select local models or external inference providers. Tools can also be brought in from MCP servers, LangChain or Hugging Face Spaces.
The project documents sandbox execution options including Docker and hosted execution services. Choose tools and execution permissions deliberately before running an agent, especially where generated code can affect files or networks. Use the library to build a task-specific agent rather than assuming it is a preconfigured hosted service. Free refers to the Apache-2.0-licensed library code; selected model services, sandbox providers and infrastructure may cost money.