// agents · huggingface/smolagents

smolagents

smolagentsは、huggingfaceが公開しているオープンソースのAIエージェントプロジェクトです(GitHub: huggingface/smolagents)。GitHubスターは29,927、フォークは3,106で、Apache-2.0ライセンスの下で公開されています。GitHubでの最終更新は2026年10月6日です。

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.9k スター⑂ 3.1k フォークApache-2.0更新 2026年10月
▦ ビジュアル — このプロジェクトのREADMEには埋め込み可能なスクリーンショットがないため、
ここではプレースホルダーを表示しています。下のガイド自体は完全な内容です。
// プロジェクトの基本情報

プロジェクト基本情報

リポジトリ
huggingface/smolagents
GitHubスター
29,927
フォーク
3,106
ライセンス
Apache-2.0
GitHubでの最終更新
2026年10月6日
掲載タイプ
完全なインストールガイド
公式サイト
Documentation
// 仕組み

仕組み

  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.

// 機能

選ばれる理由

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
// 自分で実行

自分で実行してみる

  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
// 活用例

作れるもの

Advertisement
// よくある質問

よくある質問

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.

// さらに探索

似ているツール

AIエージェント

tons-of-skills-marketplace

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

★ 2.8k スターMIT
ガイドを見る →
AIエージェント

hermes-agent

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

★ 252.0k スターMIT
ガイドを見る →
AIエージェント

openclaude

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

★ 33.7k スターMIT
ガイドを見る →
AIエージェント

E2B

Secure sandboxes where AI agents run real code.

★ 14.2k スターApache-2.0
ガイドを見る →
AIエージェント

OmAgent

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

★ 2.7k スターApache-2.0
ガイドを見る →
AIエージェント

CoreCoder

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

★ 1.8k スターMIT
ガイドを見る →
// 代替候補

代替候補: AIエージェント

LibreAIカタログに掲載されたAIエージェントプロジェクトの中で最もスターの多いもの — smolagentsが合わなかった場合に検討したい、現実的な候補リストです。

// さらに見る agents

さらに見る: AIエージェント

カタログの中でsmolagentsとスター数が近いAIエージェントプロジェクト — 前後の棚もそのまま見て回れます。

smolagentsを入手する

無料でオープン — ソースコードを入手して、リポジトリにスターを付け、作り始めましょう。