---
title: "smolagents: ฟีเจอร์ เวอร์ชัน และ Quickstart · DotsAgent"
description: "smolagents โดย Hugging Face: ไลเซนส์ เวอร์ชันล่าสุด รองรับ MCP, การรันงานแบบต่อเนื่อง การอนุมัติโดยมนุษย์ การ tracing และ evals พร้อม Quickstart ที่คัดลอกไปใช้ได้"
url: https://dotsagent.io/th/frameworks/smolagents
---

เฟรมเวิร์ก · Hugging Face

# ภาพรวม smolagents

ไลบรารี Python ขนาดเล็กของ Hugging Face มีโค้ดประมาณหนึ่งพันบรรทัด โดย CodeAgent เขียนการทำงานเป็นโค้ด Python ซึ่งรันใน sandbox อย่าง Modal, E2B หรือ Docker และแชร์ agent กับ tools บน Hub ได้

**เหมาะสำหรับ:**  การเรียนรู้และการวิจัย โดยเฉพาะ agent ที่ทำงานด้วยการเขียนโค้ด

## ข้อมูลสำคัญ

- **ผู้ดูแล**: Hugging Face
- **ภาษา**: Python
- **ไลเซนส์**: Apache-2.0
- **เวอร์ชันล่าสุด**: `1.26.0` · 29 พฤษภาคม 2569
- **Repository**: [huggingface/smolagents](https://github.com/huggingface/smolagents) · 29,617 ดาว
- **ตัวเลือกแบบโฮสต์**: ไม่มี

## Quickstart

ติดตั้งแพ็กเกจ ตั้งค่าข้อมูลรับรอง แล้วเรียกใช้ agent ตัวอย่างที่เล็กที่สุดจากเอกสารทางการ Model ID เป็นค่าที่เอกสารใช้ และอาจยังไม่ได้เปิดใช้งานในบัญชีของคุณ

`ติดตั้ง`

```
pip install 'smolagents[toolkit]'
```

ต้องใช้ HF token for Inference API

`Python`

```
from smolagents import CodeAgent, InferenceClientModel

# Initialize a model (using Hugging Face Inference API)
model = InferenceClientModel()  # Uses a default model

# Create an agent with no tools
agent = CodeAgent(tools=[], model=model)

# Run the agent with a task
result = agent.run("Calculate the sum of numbers from 1 to 10")
print(result)
```

[แหล่งข้อมูล Quickstart](https://huggingface.co/docs/smolagents/index)

## ฟีเจอร์

| ใช้ได้กับทุกโมเดล | — | HF Inference Providers, LiteLLM, Transformers ที่รันในเครื่อง และ Ollama |
| --- | --- | --- |
| MCP client | — | ใช้ tools จาก MCP server ใดก็ได้, LangChain หรือ Hub Spaces |
| MCP server | — | — |
| หลาย agent | — | agent สามารถควบคุมการทำงานของ agent อื่นได้ |
| การทำงานต่อเนื่องแบบทนทาน | — | — |
| การอนุมัติโดยมนุษย์ | — | — |
| Tracing | — | — |
| Evals | — | — |

## การเปลี่ยนแปลงล่าสุด

- ไม่มีรุ่นบน PyPI หลัง 1.26.0 ซึ่งเผยแพร่เมื่อ 29 May 2026 แต่ยังมี commit ใน repo ช่วงปลาย September 2026

## ทางเลือกในภาษาเดียวกัน

- [OpenAI Agents SDK](https://dotsagent.io/th/frameworks/openai-agents-python)

- [Claude Agent SDK](https://dotsagent.io/th/frameworks/claude-agent-sdk)

- [Google ADK](https://dotsagent.io/th/frameworks/google-adk)

- [Microsoft Agent Framework](https://dotsagent.io/th/frameworks/microsoft-agent-framework)

- [LangGraph](https://dotsagent.io/th/frameworks/langgraph)

- [CrewAI](https://dotsagent.io/th/frameworks/crewai)

## แหล่งข้อมูล

1. [huggingface.co](https://huggingface.co/docs/smolagents/index)/docs/smolagents/index
2. [pypi.org](https://pypi.org/pypi/smolagents/json)/pypi/smolagents/json
3. [api.github.com](https://api.github.com/repos/huggingface/smolagents)/repos/huggingface/smolagents

แหล่งอ้างอิงอิสระสำหรับผู้สร้าง AI agent ไม่มีส่วนเกี่ยวข้องกับผู้ให้บริการที่กล่าวถึง

© 2026 DotsAgent · ตรวจสอบข้อมูลเมื่อ 1 ตุลาคม 2569
