
smolagentsBiblioteca Python minimalistica di Hugging Face per la creazione di agenti AI basati sul codice in poche righe
Panoramica
Funzionalità chiave
- Agente Code che scrive e esegue il codice Python per risolvere le task
- Supporto per Hugging Face, OpenAI, Anthropic e modelli locali
- Esecuzione di codice in ambiente sandbox con E2B e Docker come backend
- Integrazione con ecosistemi tool comuni, tra cui Hub, LangChain e funzioni Python personalizzate
- Agente ToolCalling predefinito per l'uso tradizionale dei tool con chiamate JSON
- Progettazione leggera e minima dipendenza con design minimale
- Quote
- :
Prezzi
- Modello
- Free
- Categoria
- Architettura per Agenti AI
- Valutazione
- 5.0 / 5 (4)
Casi d’uso
Costruisci agenti di AI in modo da partire dal codice
I sviluppatori possono creare agenti che risolvono task eseguendo e facendo eseguire codice Python, riducendo il numero di passaggi del modello LLM rispetto alle approcci di chiamata ai tool in formato JSON.
Esegui gli agenti con qualsiasi provider LLM
Sperimentalizza gli agenti con modelli Hugging Face Hub, server di inferenza locali o API come OpenAI e Anthropic senza dover cambiare la piattaforma.
Esegue codice generato in modo sicuro
Usa back-end sandbox E2B o Docker per eseguire agent-generated Python in ambienti isolati, mitigando i rischi di sicurezza durante l'esecuzione di task automatizzati.
Integra ecosistemi di tool esistenti
Combina funzioni Python custom con Hub Spaces e LangChain Tools per estendere le capacità degli agenti mentre mantieni un codice minimale e leggibile.
Pro & contro
Pro
- Piccola e leggibile base di codice che è facile da estendere
- Azione del codice riduce i passaggi e aumenta l'espressività del corrispondente
- Funziona con molti provider di modelli di linguaggio ed eventualmente con modelli locali
- Esecuzione del codice tramite E2B o Docker per un'esecuzione più sicura
- Libera e completamente open source
- Quote
- :
- ']
- cons
- :
- Richiede conoscenza di Python per essere utilizzato efficacemente,Molti meno integrati con altri framework di agenti per il grande pubblico,Esecuzione del codice introduce considerazioni di sicurezza da gestire,Poco adatto per l'orchestrazione di agenti complessi al di fuori della cassa,Quote,:,'],u
Contro
- È richiesta la conoscenza di Python per un utilizzo efficace
- Meno integrazioni integrate rispetto a framework di agenti più grandi
- L'esecuzione del codice introduce considerazioni di sicurezza da gestire
- Meno adatto per l'orchestrazione complessa di multi-agenti fuori dagli schemi
Recensioni
Media su 4 valutazioni.
Accedi per lasciare una recensione.
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.
Domande e risposte
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
Fai una domanda
Alternative a Architettura per Agenti AI
Mini LLM Flow
Architettura per Agenti AI
Kernel di flusso LLM minimalista per la creazione di workflow agenti che si programmano da soli
upsonicAI
Architettura per Agenti AI
Frammento aperto di agente per la creazione di operatori digitali focalizzati su compiti specifici e agenti AI verticali.
AI-Powered RAG Workflow for n8n
Architettura per Agenti AI
Ponetevi delle domande e ottenete risposte radicate nei vostri file Google Drive usando n8n.
ControlFlow
Architettura per Agenti AI
Frammento di codice Python per la creazione di workflow AI agentivi con un design incentrato sulle attività.
roboneo art
Architettura per Agenti AI
Generatore di arte AI che converte i suggerimenti di testo in immagini di alta qualità in secondi.
Agent Genesis
Architettura per Agenti AI
Snippet di codice open-source da copiare e incollare per creare agenti AI in modo rapido.
Eclat Institute
Architettura per Agenti AI
Tematica di IP e JC focalizzata per costruire una profonda padronanza della materia
Remove Watermark
Architettura per Agenti AI
Strumento AI gratuito per la rimozione istantanea di watermark e loghi dalle foto
Trending now
Reducto AI
Piattaforme per lo Sviluppo di Agenti AI
API di intelligenza dei documenti che elabora, suddivide, riconosce testi da immagine e estrae dati strutturati da PDFs complessi, diapositive e fogli elettronici
AdCrier
Marketing & Publicità
Risposte sponsorizzate, pagate per clic
Biology AI
Intelligenza Artificiale per l"Educazione
Aiuto di Alta Qualità per i Compiti con Spiegazioni Dettagliate
Pin AI
Automazione di workflow
Recruiter AI Agent che automatizza la sorgenza, lo screening e la outreach per velocizzare il processo di assunzione.












