# smolagents

> Hugging Face's minimal agent library — agents that write Python code as their reasoning.

- Type: agent or tool
- Field: ML & AI
- Repository: https://github.com/huggingface/smolagents
- GitHub stars: 30503
- Licence: Apache-2.0
- Language: Python
- Last push: 2026-11-23
- Page: https://imutechz.in/agents/smolagents

## Features
- Code-as-action paradigm (vs JSON tool calls)
- ~1k lines core — readable in an afternoon
- Transformers, LiteLLM, OpenAI backends
- Hub-native: share agents as HF repos
- Web browser tool and doc builders built in

## Best for
- Learning agent internals
- Quick HF-model agents
- Research prototypes

## Pros
- Tiny, clean, perfect for learning
- Code actions are efficient
- Hugging Face ecosystem glue

## Cons
- Barebones orchestration features
- Code execution needs sandboxing care

## Install
```
pip install smolagents
```

## Usage
```
python script.py
```

Tags: Python, agent, framework
