TPToolPazar
Ana Sayfa/Rehberler/How To Use Smolagents

How To Use Smolagents

📖 Bu rehber ToolPazar ekibi tarafından hazırlanmıştır. Tüm araçlarımız ücretsiz ve reklamsızdır.

What it is

smolagents is Hugging Face’s minimalist agent library that lets a language model write Python code as its primary way of calling tools, in roughly a thousand lines of source.

Install

CodeAgent is powerful but dangerous: by default it executes model-generated Python against your environment with a limited allowlist of imports. Treat the local interpreter as “safer than exec” not “safe” — put anything production-facing behind E2B or Docker. Smaller models (<14B) often fail the code-writing format and produce syntax errors; for those, fall back to ToolCallingAgent.

First run

Everyday workflows

Gotchas and tips

Who it’s for