Hugging Face smolagents CodeAgent
A configurable agent that expresses tool-using actions as code, with local or hosted model integrations and sandbox execution options.
About this listing
CodeAgent is the code-action agent supplied by Hugging Face smolagents. Developers configure it with a model and tools; the agent writes its actions as code rather than only producing structured tool-call messages. It is useful for building assistants that combine reasoning with programmatic tool use.
The library supports tools drawn from MCP servers and multiple model routes, including local Transformers or Ollama models and hosted providers. Execution options include Docker and supported external sandbox services. Running generated code requires a deliberately configured isolation environment and appropriate tool permissions.
Free refers to the Apache-2.0 agent code only. Model inference, external tools, sandbox services and infrastructure can carry separate charges. This listing describes the configurable agent component, not a hosted turnkey service.