smolagents
Hugging Face’s barebones library for agents that think in code.
- Star 数
- 30.6K
- Fork 数
- 3.3K
- 未关闭 Issue
- 609
- 最近提交
- 2026-11-26
数据来自 GitHub API · 更新于 2026-11-30
smolagents 是什么?
smolagents keeps agent logic in about a thousand lines. Its CodeAgent writes actions as Python snippets instead of JSON tool calls, which tends to take fewer steps. It runs with any model — Hugging Face Inference, OpenAI, Anthropic or local Transformers/Ollama — and can execute code in sandboxes.
主要功能
- Code-writing agents and classic tool-calling agents
- Model-agnostic via LiteLLM and HF Inference
- Sandboxed execution (E2B, Docker, Modal)
- Share tools and agents on the Hub
系统要求
- 平台
- Windows · macOS · Linux
- Python
- 3.10+
如何安装 smolagents
根据项目 README 整理。开源项目更新很快,请以 GitHub 页面上的最新说明为准。
pip
- 1Install with the default toolkit.
pip install "smolagents[toolkit]"
优势
- Tiny, readable codebase
- Code actions are efficient
不足
- Executing generated code needs sandboxing
smolagents 替代品对比
| 软件 | Star 数 | 许可证 | 平台 | 显存 |
|---|---|---|---|---|
| smolagents Hugging Face’s barebones library for agents that think in code. | 30.6K | Apache-2.0 | — | |
| CrewAI Python framework for orchestrating role-playing, collaborative AI agents. | 61.4K | MIT | — | |
| LangGraph Low-level orchestration for stateful, long-running agents as graphs. | 45.6K | MIT | — | |
| Pydantic AI Type-safe Python agent framework from the Pydantic team. | 21.5K | MIT | — | |
| Agno Fast framework for multi-agent systems with memory, knowledge and tools. | 43.3K | Apache-2.0 | — | |
| Open WebUI Self-hosted ChatGPT-style interface for Ollama and OpenAI-compatible APIs. | 159.8K | Open WebUI License (BSD-3-Clause based) | — |
常见问题
smolagents 免费吗?
是的——smolagents 是开源软件,采用 Apache-2.0 许可证。商用前请确认软件及模型权重的许可条款。
smolagents 支持 Windows、Mac 和 Linux 吗?
smolagents 支持:Windows, macOS, Linux。
如何安装 smolagents?
1. Install with the default toolkit.
smolagents 有哪些好的替代品?
常见替代品包括 CrewAI, LangGraph, Pydantic AI, Agno,详见本页对比表。