에이전트 라이브러리

에이전트 라이브러리 (Agent Libraries)

허브에서 에이전트를 구축할 때 사용할 수 있는 라이브러리들을 소개해요.

출처: 문서

본문

tiny-agents

Hugging Face Inference 위에서 MCP 기반 에이전트를 실행하기 위한 가벼운 툴킷이에요. JavaScript(@huggingface/tiny-agents)와 Python(huggingface_hub)에서 사용할 수 있어요.

# JavaScript
npx @huggingface/tiny-agents run "agent/id"

# Python
pip install "huggingface_hub[mcp]"
tiny-agents run "agent/id"

agent.json 구성으로 나만의 에이전트를 만들 수 있어요:

{
	"model": "Qwen/Qwen2.5-72B-Instruct",
	"provider": "together",
	"servers": [
		{
			"type": "stdio",
			"command": "npx",
			"args": ["@playwright/mcp@latest"]
		}
	]
}

로컬 LLM을 사용하려면 내 서버를 가리키는 endpointUrl을 추가하세요(예: http://localhost:1234/v1). 자세한 내용은 SDK 가이드를 참고하세요.

Gradio MCP Server

한 줄의 변경으로 모든 Gradio 앱을 MCP 서버로 만들 수 있어요:

demo.launch(mcp_server=True)

서버는 각 함수를 도구(tool)로 노출하며, 설명은 docstring에서 자동 생성돼요. 어떤 MCP 클라이언트에든 연결할 수 있어요. MCP 호환 Spaces가 허브에 수천 개 있어요. 자세한 내용은 Gradio MCP 가이드를 참고하세요.

smolagents

smolagents는 몇 줄의 코드로 에이전트를 구축하기 위한 가벼운 Python 라이브러리예요. CodeAgent(Python으로 액션 작성)와 ToolCallingAgent(JSON 툴 호출 사용)를 지원하며, Inference Providers를 통해 어떤 모델과도 동작하고, MCP 서버와도 통합돼요.

smolagent "Plan a trip to Tokyo, Kyoto and Osaka between Mar 28 and Apr 7." \
--model-type "InferenceClientModel" \
--model-id "Qwen/Qwen2.5-Coder-32B-Instruct" \
--tools "web_search"

에이전트는 Spaces로 허브에 푸시할 수 있어요. 커뮤니티 에이전트를 여기에서 둘러볼 수 있어요. 자세한 내용은 smolagents 문서를 참고하세요.

더 알아보기 (Learn more)