
smolagentsLibrairie Python minimaliste de Hugging Face pour la création d'agents AI basés sur le code en quelques lignes
Aperçu
Fonctionnalités clés
- CodeAgent qui écrit et exécute du Python pour résoudre des tâches
- Support pour Hugging Face, OpenAI, Anthropic et modèles locaux
- Exécution de code sandboxé avec E2B et Docker en tant que backend
- Intégration avec les outils de l'écosystème, y compris l'Hub, LangChain et fonctions Python personnalisées
- Agent ToolCalling pour l'utilisation traditionnelle de l'appel de commande JSON
- Conception légère et de faible dépendance
- Code écrit dans le but d'executer l'application dans une autre environnement.
Tarifs
- Modèle
- Free
- Note
- 5.0 / 5 (4)
Cas d’usage
Construire des agents AI basés sur le code rapidement
Les développeurs peuvent créer des agents qui résolvent des tâches en écrivant et en exécutant du code Python, réduisant le nombre de pas de LLM comparativement aux approches d'appel de commande JSON.
Exécuter des agents avec tout fournisseur LLM
Prototyper des agents à l'aide de modèles de l'Hub de Hugging Face, de serveurs d'inference locaux ou d'API comme OpenAI et Anthropic sans changer le framework.
Exécuter le code généré dans un environnement sécurisé
Utiliser E2B ou Docker en tant que backend sandbox pour exécuter du code Python généré par les agents dans des environnements isolés, atténuant les risques de sécurité pendant l'exécution automatisée des tâches.
Intégrer les écosystèmes d'outils existants
Mélanger des fonctions Python personnalisées avec des espaces d'Hub et les outils de LangChain pour étendre les capacités des agents tout en maintenant un code simple et lisible.
Pour & contre
Pour
- Codebase très petit et lisible qui est facile à étendre
- Actions basées sur du code réduisent les étapes et boostent l'expressivité des agents
- Fonctionne avec de nombreux fournisseurs LLM et modèles locaux
- Exécution sandboxé via E2B ou Docker pour un code plus sûr
- Libre et entièrement open source
Contre
- Exige une connaissance de Python pour être utilisé efficacement
- Moins d'intégrations prises en charge que les plus grands frameworks d'agents
- Exécution du code présente des considérations de sécurité à gérer
- Moins adapté pour la coordination de plusieurs agents complexes à l'origine
Avis
Moyenne sur 4 avis.
Connecte-toi pour laisser un avis.
Use it every day
Honestly didn't expect to like it this much. Tool integration with Hub, LangChain, and custom Python functions is exactly what I needed, and code-based actions reduce steps and boost agent expressiveness. I do wish requires Python knowledge to use effectively, but I reach for it almost every day now and it just clicks.
Does the job
Pretty happy overall. Tool integration with Hub, LangChain, and custom Python functions just works and very small, readable codebase that is easy to extend. Code execution introduces security considerations to manage can be annoying, but no dealbreakers — I'd recommend it to a friend without hesitating.
Does the job
Pretty happy overall. Sandboxed code execution with E2B and Docker backends just works and sandboxed execution via E2B or Docker for safer code running. but no dealbreakers — I'd recommend it to a friend without hesitating.
Skeptical, then convinced
I went in skeptical — most tools in this space overpromise. It actually delivers on codeAgent that writes and executes Python to solve tasks, and code-based actions reduce steps and boost agent expressiveness caught me off guard. still, I'd recommend giving it a real trial.
Questions & réponses
How strong are open models for agentic workflows?
We've created CodeAgent instances with some leading models, and compared them on this benchmark that gathers questions from a few different benchmarks to propose a varied blend of challenges. Find the benchmarking code here for more detail on the agentic setup used, and see a comparison of using LLMs code agents compared to vanilla (spoilers: code agents works better). This comparison shows that open-source models can now take on the best closed models!
Asked by Diego Fernández · Feb 16, 2026
How smol is this library?
We strived to keep abstractions to a strict minimum: the main code in agents.py has <1,000 lines of code. Still, we implement several types of agents: CodeAgent writes its actions as Python code snippets, and the more classic ToolCallingAgent leverages built-in tool calling methods. We also have multi-agent hierarchies, import from tool collections, remote code execution, vision models... By the way, why use a framework at all? Well, because a big part of this stuff is non-trivial. For instance, the code agent has to keep a consistent format for code throughout its system prompt, its parser, the execution. So our framework handles this complexity for you. But of course we still encourage you to hack into the source code and use only the bits that you need, to the exclusion of everything else!
Asked by Ludovic Girard · Nov 27, 2025
How do Code agents work?
Our CodeAgent works mostly like classical ReAct agents - the exception being that the LLM engine writes its actions as Python code snippets. Actions are now Python code snippets. Hence, tool calls will be performed as Python function calls. For instance, here is how the agent can perform web search over several websites in one single action: Writing actions as code snippets is demonstrated to work better than the current industry practice of letting the LLM output a dictionary of the tools it wants to call: uses 30% fewer steps (thus 30% fewer LLM calls) and reaches higher performance on difficult benchmarks. Head to our high-level intro to agents to learn more on that. Since code execution can be a serious security concern (arbitrary code execution!), you should run agent code in a sandbox. We support several options: E2B, Blaxel, Modal — managed cloud sandboxes, simplest to set up Docker — self-hosted container isolation The built-in LocalPythonExecutor is not a security sandbox. It applies some restrictions but can be bypassed and must not be used as a security boundary. Alongside CodeAgent, we also provide the standard ToolCallingAgent which writes actions as JSON/text blobs. You can pick whichever style best suits your use case.
Asked by Greta Nowak · Oct 31, 2025
Poser une question
Alternatives à Frameworks d'agents de l'intelligence artificielle
Mini LLM Flow
Frameworks d'agents de l'intelligence artificielle
Cadre LLM minimaliste de 100 lignes pour construire des flux de travail d'agents auto-programmants
upsonicAI
Frameworks d'agents de l'intelligence artificielle
Faisant Office Des agents de l'IA et de l'intelligence artificielle pour les tâches spécifiques
AI-Powered RAG Workflow for n8n
Frameworks d'agents de l'intelligence artificielle
Posez des questions et obtenez des réponses basées sur vos fichiers Google Drive en utilisant n8n.
ControlFlow
Frameworks d'agents de l'intelligence artificielle
Framework Python pour la construction de flux de travail agétiques IA avec une conception centrée sur les tâches.
roboneo art
Frameworks d'agents de l'intelligence artificielle
Générateur d'art à l'aide de l'IA qui transforme les prompts textuels en images de haute qualité en quelques secondes.
Agent Genesis
Frameworks d'agents de l'intelligence artificielle
Des extraits de code open source à copier-coller pour créer rapidement des agents IA.
Eclat Institute
Frameworks d'agents de l'intelligence artificielle
Focalisée sur la maîtrise des sujets IP et JC pour construire une connaissance à long terme
Remove Watermark
Frameworks d'agents de l'intelligence artificielle
Outil gratuit de l'IA pour la suppression instantanée des marques d'eau et des logos des photos
Trending now
AdCrier
Marketing & Publicité
Reponses sponsorises, payées par clic.
Reducto AI
Plateformes de Développement d'Agents d'Intelligence Artificielle
API d'intelligence de document qui parse, divise, reconnait les chars et extrait les données structurées de complexes PDF, diapositives et tableurs.
Biology AI
Formation IA
Aide aux devoirs précise avec explications complètes
Pin AI
Automatisation du flux de travail
Récupérateur AI autonome qui automatise le sourcing, l'analyse et l'approche pour accélérer l'embauche.












