OlympHill
smolagents logo

smolagentsספריית Python מינימליסטית של Hugging Face לבניית סוכנים AI בקוד, במספר שורות

5.0 (4)

סקירה

smolagents היא מסגרת סוכנים בקוד פתוח מבית Hugging Face שנועדה סביב לפשטות ושטח פנים קטן. במקום לתזמר סוכנים באמצעות קריאות כלים ב-JSON ארוכות מילים, היא מאפשרת לסוכנים לבטא פעולות כשפת Python, שהיא בדרך כלל יותר ביטויית ומקטינה את מספר השלבים של LLM הנדרשים לביצוע משימה. הספרייה אינה תלויה במודל, ועובדת עם מודלים המאוחסנים ב-Hugging Face Hub, שרתים מקומיים להסקת מסקנות, וספקי API מרכזיים כמו OpenAI ו-Anthropic. היא מגיעה עם אפשרויות ביצוע בסביבה מבודדת כמו E2B ו-Docker כדי שניתן יהיה להריץ קוד שנוצר בבטחה, והיא משתלבת עם מערכות כלים נפוצות הכוללות את Hub Spaces וכלי LangChain. הוא מיועד למפתחים שרוצים נקודת התחלה שקופה וניתנת לפריצה עבור פרויקטים של סוכנים, ולא מסגרת כבדה ודעתנית, מה שהופך אותו למתאים במיוחד ליצירת אבטיפוס, מחקר ושימושים קלים בייצור.

תכונות עיקריות

  • CodeAgent שכותב ומריץ Python כדי לפתור משימות
  • תמיכה ב-Hugging Face, OpenAI, Anthropic, ומודלים מקומיים
  • ביצוע קוד סנדבוקס עם E2B ו-Docker
  • אינטגרציה עם כלי Hub, LangChain, ופונקציות Python מותאמות אישית
  • ToolCallingAgent מובנה עבור שימוש בסגנון JSON
  • עיצוב קל ותלויות מינימליות

תמחור

מודל
Free
דירוג
5.0 / 5 (4)

מקרי שימוש

בניית סוכני AI מבוססי קוד במהירות

מפתחים יכולים ליצור סוכנים שפותרים משימות על ידי כתיבה והרצה של קוד Python, תוך הקטנת מספר הצעדים LLM לעומת גישות JSON

ריצת סוכנים עם כל ספק LLM

אב-טיפוס סוכנים באמצעות מודלים של Hugging Face Hub, שרתי היקש מקומיים, או API כגון OpenAI ו-Anthropic, ללא שינוי הפריימוורק

ביצוע בטוח של קוד מיוצר

השתמשו ב-E2B או Docker כדי לרוץ קוד Python שנוצר על ידי הסוכן, בסביבות מבודדות, ולהפחית סיכוני ביטחון בעת ביצוע אוטומטי של משימות

אינטגרציה עם אקוסיסטמים קיימים

שלבו פונקציות Python מותאמות אישית עם כלי Hub Spaces ו-LangChain, ושמרו על בסיס קוד קריא ומינימליסטי

יתרונות וחסרונות

יתרונות

  • בסיס קוד קטן וקריא, שקל להרחיב
  • פעולות מבוססות קוד מקטינות את מספר הצעדים, ומשפרות את הביטוי של הסוכנים
  • עבודה עם ספקי LLM רבים, ומודלים מקומיים
  • ביצוע סנדבוקס באמצעות E2B או Docker, לריצה בטוחה יותר
  • חינמי ופתוח לחלוטין

חסרונות

  • דורש ידע ב-Python כדי להשתמש בו ביעילות
  • פחות אינטגרציות מובנות מאשר פריימוורקים גדולים יותר
  • ביצוע קוד מציג היבטי ביטחון שיש לנהל
  • פחות מתאים עבור תזמון רב-סוכנים מורכב

ביקורות

5.0

ממוצע מ-4 דירוגים.

5
4
4
0
3
0
2
0
1
0

התחבר כדי להשאיר ביקורת.

Naomi Suzuki

Naomi Suzuki

Apr 15, 2026

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.

WC

Wei Chen

Dec 18, 2025

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.

Jamal Carter

Jamal Carter

Nov 25, 2025

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.

SG

Sanjay Gupta

Jul 11, 2025

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.

שאלות ותשובות

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

שאל שאלה

חלופות למסגר מבוסס-בינה מלאכותית

Mini LLM Flow logo

Mini LLM Flow

מסגר מבוסס-בינה מלאכותית

פריימוורק LLM מינימליסטי בן 100 שורות לבניית זרימי עבודה של סוכנים מתכנתים בעצמם

4.8 (6)
3Free
upsonicAI logo

upsonicAI

מסגר מבוסס-בינה מלאכותית

פלטפורמת מעקב פתוחת הרכבה לבניית עטים דיגיטליים תפקודיים ואג'נטי AI מותאמיי רגל

4.8 (6)
2Free
AI-Powered RAG Workflow for n8n logo

AI-Powered RAG Workflow for n8n

מסגר מבוסס-בינה מלאכותית

שאלו שאלות וקבלו תשובות שנתמכות על ידי קבצים בGoogle Drive באמצעות n8n.

4.8 (6)
Free
ControlFlow logo

ControlFlow

מסגר מבוסס-בינה מלאכותית

מסגרת פיתון לבניית זרימות עבודה של AI אגנטי עם תכנון מרכזי במשימות

4.8 (6)
Free
roboneo art logo

roboneo art

מסגר מבוסס-בינה מלאכותית

מפענח אורפנטי של תמונות AI שמתמרז פירושי טקסט לתמונות גבוהות מאפק בשנייה.

4.8 (6)
Free
A

Agent Genesis

מסגר מבוסס-בינה מלאכותית

מאגר קוד פתוח, תגלגל- ו- דאבל-קאפ-ת-פאסט קוד סניפטים לבניית אג'נטים AI מהירים

4.8 (6)
Free
Eclat Institute logo

Eclat Institute

מסגר מבוסס-בינה מלאכותית

הוראת IP ו- JC ממוקדת בבניית שליטה נושאית עמידה

4.8 (5)
Free
Remove Watermark logo

Remove Watermark

מסגר מבוסס-בינה מלאכותית

תייג חינם לגיבוי ריקמת מים לחיים מידי:

4.8 (5)
Free