Comet Lab Atlas

Hugging Face's minimal agent library where agents act by writing and running Python code.

smolagents is a small library built on one idea: instead of emitting structured tool calls, an agent writes Python code and runs it. Expressing actions as code lets a single step do more — loops, composition, logic — than a single tool call can.

It is intentionally tiny, integrates with the Hugging Face ecosystem, and runs generated code in a sandbox.

Where it's ideally used

A fit for tasks where actions are naturally computational and a code-writing agent expresses them more cleanly than a chain of tool calls.

Where it doesn't fit

Running model-written code raises a real security surface — wrong for environments that cannot accept that, even sandboxed.