LibreAI / Agents IA / smolagents
// agents · huggingface/smolagents

smolagents

smolagents est un projet de agents IA open source, créé par huggingface (huggingface/smolagents sur GitHub). Il compte 29 927 étoiles sur GitHub et 3 106 forks, il est publié sous la licence Apache-2.0 et a été mis à jour pour la dernière fois sur GitHub le 6 octobre 2026.

smolagents — Hugging Face's barebones agent library where agents think in code: a CodeAgent that writes its actions as Python, model-agnostic, Apache-2.0

★ 29,9 k étoiles⑂ 3,1 k forksApache-2.0mis à jour oct. 2026
▦ visuel — le README de ce projet ne contient aucune capture intégrable,
voici donc un emplacement réservé. Le guide ci-dessous est complet malgré tout.
// détails du projet

Détails du projet

Étoiles GitHub
29 927
Forks
3 106
Licence
Apache-2.0
Dernière mise à jour sur GitHub
6 octobre 2026
Catégorie
Agents IA
Type de fiche
Guide d'installation complet
Site officiel
Documentation
// fonctionnement

Comment ça marche

  1. Install the package

    Per the README: pip install "smolagents[toolkit]" for the package with the default tool set.

  2. Pick a model

    Create a model object — InferenceClientModel for Hub inference providers, or a local transformers/Ollama model, or another provider model.

  3. Define and run an agent

    Give a CodeAgent your tools (e.g. WebSearchTool) and the model, then call agent.run() with a task in plain language.

// fonctionnalités

Pourquoi on l'adore

Agents that act in code

CodeAgent writes executable Python actions instead of JSON blobs — plans, loops and tool chaining come naturally and traces stay readable.

Model-agnostic

HF Inference Providers, local transformers/Ollama models and major hosted providers all plug into the same agent code.

Barebones by design

A small, hackable codebase you can actually read end to end — the anti-framework agent library.

Hub-native tools

Tools are Python functions you can share on and pull from the Hugging Face Hub, alongside the bundled toolkit.

Advertisement
// lancez-le

Lancez-le vous-même

  1. Install

    The README quick install with the default toolkit.

    pip install "smolagents[toolkit]"
  2. First agent

    The README example: a CodeAgent with web search on a Hub model.

    from smolagents import CodeAgent, WebSearchTool, InferenceClientModel
    
    model = InferenceClientModel()
    agent = CodeAgent(tools=[WebSearchTool()], model=model)
    agent.run("How many seconds would it take for a leopard at full speed to run through Pont des Arts?")
  3. Go local

    Swap InferenceClientModel for a local transformers or Ollama model class from the docs — the agent code does not change.

    https://huggingface.co/docs/smolagents
// cas d'usage

Ce que vous pouvez créer

Advertisement
// faq

Questions fréquentes

Who makes smolagents?

The Hugging Face team (huggingface/smolagents on GitHub).

Is smolagents free?

Yes — Apache-2.0 licensed. Model usage follows whatever provider or local model you plug in.

Why code actions instead of tool calls?

Code is more expressive than one-tool-per-step JSON: the agent can loop, branch, store intermediate results and compose tools in a single action, and the trace reads like a program you can debug. Execution is sandboxed per the library docs — still review what you let it run.

How does it compare to a well-known alternative?

Against LangChain/LangGraph, smolagents is intentionally minimal — far less surface area, no graph DSL, quicker to learn and hack. Against AutoGen or CrewAI, it is a library for building your agent, not a multi-agent role-play system.

How do I get started?

pip install "smolagents[toolkit]", then run the README CodeAgent example with InferenceClientModel and WebSearchTool.

// continuez l'exploration

Outils similaires

Agents IA

tons-of-skills-marketplace

Model-agnostic marketplace of agent skills with a harness-free canonical layer.

★ 2,8 k étoilesMIT
Voir le guide →
Agents IA

hermes-agent

The agent that grows with you — a Python framework for adaptive AI agents.

★ 252,0 k étoilesMIT
Voir le guide →
Agents IA

openclaude

A Claude Code-style coding agent that runs anywhere and works with almost any model provider

★ 33,7 k étoilesMIT
Voir le guide →
Agents IA

E2B

Secure sandboxes where AI agents run real code.

★ 14,2 k étoilesApache-2.0
Voir le guide →
Agents IA

OmAgent

Python library for building multimodal language agents — VLM, video and mobile, fast to prototype and ship

★ 2,7 k étoilesApache-2.0
Voir le guide →
Agents IA

CoreCoder

Self-hosted ai agents: minimal ai coding agent (~1,000 lines of python) inspir.

★ 1,8 k étoilesMIT
Voir le guide →
// alternatives

Alternatives en Agents IA

Les autres projets de la catégorie Agents IA avec le plus d'étoiles du catalogue LibreAI — la sélection réaliste d'alternatives si smolagents ne vous convient pas.

// plus en agents

Plus en Agents IA

Projets de la catégorie Agents IA proches dans le catalogue, les plus proches en étoiles de smolagents — continuez à explorer de part et d'autre.

Obtenir smolagents

Gratuit et ouvert : récupérez le code source, mettez une étoile au dépôt et commencez à créer.