
smolagentsBiblioteca de Python minimalista de Hugging Face para crear agente de IA code-first en pocas líneas
Resumen
Funciones clave
- Code Agent que escribe y ejecuta Python para resolver tareas
- Soporte para modelos de Hugging Face, OpenAI, Anthropic y modelos locales
- Ejecución de código sandboxed con backends E2B y Docker
- Integración con ecosistemas de herramientas comunes incluyendo Hub y LangChain herramientas
- Integración de ToolCallingAgent para uso de herramientas JSON tradicional
- Diseño ligero y de poca dependencia
Precio
- Modelo
- Free
- Valoración
- 5.0 / 5 (4)
Casos de uso
Edite agentes de IA code-first rápidamente
Los desarrolladores pueden crear agentes que resuelven tareas escribiendo y ejecutando código Python, reduciendo el número de pasos de LLM comparado con enfoques JSON para llamadas herramientas
Ejecute agentes con cualquier proveedor de LLM
Prototeje agentes utilizando modelos del Hub de modelo de Hugging Faces, servidores de inferencia locales o APIs como OpenAI y Anthropic sin cambiar el marco
Ejecute código generador con seguridad
Use backends de sandbox E2B o Docker para ejecutar código Python de agentes en entornos aislados, mitigando riesgos de seguridad durante la ejecución automática de tareas
Integre ecosistemas de herramientas existentes
Combina funciones Python personalizadas con Hub Spaces y herramientas de LangChain para ampliar las capacidades de agentes y mantener un códigobase mínimo y legible
Pros y contras
Ventajas
- Códigobase de pequeño tamaño y legible que es fácil de ampliar
- Acciones basadas en código reducen pasos y mejoran la expresividad de agentes
- Funciona con muchos proveedores de LLM y modelos locales
- Ejecución sandboxed a través de E2B o Docker para ejecuciones de código más seguras
- Libre y completamente de código abierto
Contras
- Requiere conocimiento de Python para utilizarse con efectividad
- Menos integraciones integradas que marcos de agentes más grandes
- Ejecución de código introduce consideraciones de seguridad para gestionar
- Menos adecuado para la orquestación de agentes multiplataforma de complejo fuera de la caja
Reseñas
Promedio de 4 valoraciones.
Inicia sesión para dejar una reseña.
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.
Preguntas y respuestas
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
Hacer una pregunta
Alternativas a Marcos de Agentes de Inteligencia Artificial
Mini LLM Flow
Marcos de Agentes de Inteligencia Artificial
Marco reducido de 100 líneas para LLM para construir flujos de trabajos de agentes auto-programables
upsonicAI
Marcos de Agentes de Inteligencia Artificial
Estructura de marco abierto de agente para construir trabajadores digitales con foco en tareas y agentes de IA vertically integrados.
AI-Powered RAG Workflow for n8n
Marcos de Agentes de Inteligencia Artificial
Haz preguntas y obtén respuestas basadas en tus archivos de Google Drive usando n8n.
ControlFlow
Marcos de Agentes de Inteligencia Artificial
Framework Python para construir flujos de trabajo de IA agente con un diseño centrado en tareas.
roboneo art
Marcos de Agentes de Inteligencia Artificial
Generador de arte AI que convierte prompts de texto en imágenes de alta calidad en segundos.
Agent Genesis
Marcos de Agentes de Inteligencia Artificial
Fragmentos de código open-source de copiar y pegar para crear agentes de IA rápidamente.
Eclat Institute
Marcos de Agentes de Inteligencia Artificial
Tutoría para IP y JC enfocada en la construcción de dominio duradero de las materias
Remove Watermark
Marcos de Agentes de Inteligencia Artificial
Herramienta gratuita de IA para eliminar instantáneamente marcas de agua y logos de fotos
Trending now
Reducto AI
Plataformas de Desarrollo de Agentes de Inteligencia Artificial
API de inteligencia de documentos que analiza, divide, reconoce textos impresos y extrae datos estructurados desde PDF complejos, presentaciones y hojas de cálculo.
AdCrier
Marketing y Publicidad
Respuestas patrocinadas, pagadas por clic.
Biology AI
IA educativa
Ayuda precisa con las tareas de biología y explicaciones detalladas
Pin AI
Automatización de flujo de trabajo
Contratista de AI agente que automatiza la busca, la selección y el acercamiento para acelerar el reclutamiento.












