OpenViSTAI · Agents · Blockchain · Crypto
Menu
Agent Frameworks

Smolagents

Smolagents is an open-source Python library for building and running AI agents, including CodeAgent, which represents actions as Python code and can use tools. It supports multiple model and tool integrations, command-line workflows and sharing agents through the Hugging Face Hub.

Independent OpenViST project profile, based on linked sources.

Smolagents — OpenViST project profile in Agent Frameworks.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use Smolagents when building a custom Python agent and you want to choose its model and tools while using code as the CodeAgent’s action format.

Who it is for

  • Python developers building custom AI agents
  • Teams prototyping tool-using agent workflows
  • Developers selecting model providers and tools for domain-specific agents

Documented uses

  • Define an agent that uses Python code for actions and tool calls.
  • Connect an agent to a chosen model provider and relevant tools.
  • Run agent tasks from Python or the command line.
  • Share or load agents through the Hugging Face Hub.
Before you choose

Requirements & limits

The project repository is public and identifies the software as Apache-2.0 licensed.

  • CodeAgent executes generated Python actions; the project lists Blaxel, E2B, Modal and Docker as sandboxed execution options.
  • Model integrations include hosted providers and local Transformers models, so the choice affects configuration and access requirements.
  • Tools can come from MCP servers, LangChain, Hub tools or Spaces.
  • The README documents Python and command-line use, including a separate webagent command for browsing tasks.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Install the toolkit and define a web-search agent

Set up the documented Python example that pairs a CodeAgent with web search and a Hugging Face inference model.

Before you start

  • Python package installation using pip
  • A model configuration supported by InferenceClientModel

Steps

  1. Install the package with the documented toolkit extras: pip install "smolagents[toolkit]".

  2. Import CodeAgent, WebSearchTool and InferenceClientModel from smolagents.

  3. Create an InferenceClientModel, then pass it and a WebSearchTool instance to CodeAgent.

  4. Call the agent’s run method with a task prompt.

Expected outcome

A configured CodeAgent can receive a prompt and use the web-search tool as part of its task.

Guide limitations

  • The example depends on a configured inference model; provider credentials or settings may be needed for the chosen provider.
  • The README example documents the setup and call pattern, not a verified result for a particular prompt.
Source-based practical guide

Configure an agent through the interactive CLI

Use the documented smolagent interactive setup to choose an agent type, tools, model settings and a task prompt.

Before you start

  • The smolagents package installed in a Python environment
  • Model type, model ID and any required API settings for the selected provider

Steps

  1. Run smolagent without a prompt to open interactive mode.

  2. Choose CodeAgent or ToolCallingAgent.

  3. Select tools and configure the model type, ID and API settings.

  4. Enter any advanced options, such as additional imports, and provide a task prompt.

Expected outcome

The CLI guides configuration of an agent and task prompt.

Guide limitations

  • The documentation describes configuration stages but does not specify a universal provider setup or execution environment.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
30 September 2026
Original website title
huggingface/smolagents · Official homepage title · retained in its source language