smolagents

smolagents is a skill for Claude Code, Codex from svngoku/coding-agents-skills. It costs 105 tokens per session (3,809 once invoked), scanned A, original, MIT.

A guide to building AI agents with SmolAgents, a small Python library for programs that use models, tools, and sometimes generated code to complete tasks.

In plain words
What is it for?
Creating code-running or tool-calling agents, groups of agents, retrieval-based systems, text-to-SQL workflows, browsing agents, and integrations with MCP tools.
Why use it?
It provides patterns for connecting models to tools and organizing multi-step work without designing the whole agent framework yourself.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Creating code-running or tool-calling agents, groups of agents, retrieval-based systems, text-to-SQL workflows, browsing agents, and integrations with MCP tools.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/svngoku/coding-agents-skills/smolagents
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add svngoku/coding-agents-skills --skill smolagents
Clone the repo
git clone --depth 1 https://github.com/svngoku/coding-agents-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for smolagents

README.md
[![agentmods](https://agentmods.dev/badge/skills/svngoku/coding-agents-skills/smolagents/github.svg)](https://agentmods.dev/skills/svngoku/coding-agents-skills/smolagents)
Your own site
<a href="https://agentmods.dev/skills/svngoku/coding-agents-skills/smolagents"><img src="https://agentmods.dev/badge/skills/svngoku/coding-agents-skills/smolagents/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for smolagents

Your own site · 80×15
<a href="https://agentmods.dev/skills/svngoku/coding-agents-skills/smolagents"><img src="https://agentmods.dev/badge/skills/svngoku/coding-agents-skills/smolagents.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 105 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,809 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00105 $0.03809
Opus 5 $0.00053 $0.01904
Sonnet 5 $0.00021 $0.00762
Haiku 4.5 $0.00011 $0.00381

Measured 9d ago against content hash fc15e698069f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

smolagents scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (graders/check.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/smolagents/SKILL.md · 591 lines

How it starts

The opening of the file, as written. The whole thing — 591 lines — stays where its author put it; the contents beside it link to each section on GitHub.

SmolAgents - Hugging Face AI Agent Framework

SmolAgents is a minimalist Python library (~1000 lines) for building AI agents that write and execute code. It emphasizes simplicity, security, and model-agnostic design.

Installation

pip install smolagents                    # Core library
pip install 'smolagents[toolkit]'         # With default tools (web search, etc.)
pip install 'smolagents[litellm]'         # LiteLLM for OpenAI/Anthropic
pip install 'smolagents[transformers]'    # Local model support
pip install 'smolagents[mcp]'             # MCP server integration
pip install 'smolagents[telemetry]'       # OpenTelemetry support

Core Concepts

Agent Types

CodeAgent - Primary agent that writes Python code to execute actions:

from smolagents import CodeAgent, InferenceClientModel

model = InferenceClientModel()  # Default: Qwen/Qwen2.5-Coder-32B-Instruct
agent = CodeAgent(tools=[], model=model)
result = agent.run("Calculate the first 20 Fibonacci numbers")

ToolCallingAgent - Uses JSON-based tool calls (no code execution):

from smolagents import ToolCallingAgent, InferenceClientModel

agent = ToolCallingAgent(tools=[], model=InferenceClientModel())
agent.run("Get the title of https://huggingface.co/blog")

Model Configuration

Hugging Face Inference API (recommended for quick start):

from smolagents import InferenceClientModel

# Default model
model = InferenceClientModel()

# Specific model with provider
model = InferenceClientModel(
    model_id="meta-llama/Llama-3.3-70B-Instruct",
    provider="together",  # or "sambanova", "fireworks", etc.
    token="YOUR_HF_TOKEN"
)

LiteLLM (100+ providers):

from smolagents import LiteLLMModel

# Anthropic
model = LiteLLMModel(
    model_id="anthropic/claude-3-5-sonnet-latest",
    api_key="YOUR_ANTHROPIC_API_KEY"
)

# OpenAI
model = LiteLLMModel(model_id="gpt-4o", api_key="YOUR_OPENAI_API_KEY")

Local Transformers:

from smolagents import TransformersModel

model = TransformersModel(
    model_id="Qwen/Qwen2.5-Coder-32B-Instruct",
    max_new_tokens=4096,
    device_map="auto"
)

Read the full file on GitHub · 591 lines

Files

What ships with it

8 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 591 lines · 105 tokens per session scan A fc15e698069f

Subscribe to this mod's changes

smolagents is a skill published in the GitHub repository svngoku/coding-agents-skills (10 stars, last pushed 26d ago), licensed MIT. It adds 105 tokens to every session and 3,809 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.