Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Hugging Face 11 min read Announcement mediumAdept

Introducing smolagents: simple agents that write actions in code.

smolagents is a minimal Python library from Hugging Face for building LLM agents, with first-class support for code agents that write their actions as Python code instead of JSON tool calls. Agency is framed as a spectrum from simple output processing to multi-step and multi-agent loops, and the post advises using deterministic workflows unless tasks genuinely need flexibility. Code actions are argued to beat JSON for composability, object handling, generality and training-data coverage. The library supports sandboxed execution via E2B, custom tools defined with a @tool decorator and shareable on the Hub, any LLM via transformers, the HF inference API or LiteLLM, and a benchmark shows open models competitive with closed ones on agentic tasks.

Related posts

  • Open-source DeepResearch – Freeing our search agents

    Hugging Face mediumAdept

    Hugging Face reproduced OpenAI's Deep Research agent in about 24 hours using the open smolagents framework and reached 55.15% on the GAIA validation set, up from roughly 46% for the previous open state of the art (Magentic-One). OpenAI reports 67.36%. Most of the gain comes from a CodeAgent that writes its actions as Python code instead of JSON tool calls. Swapping in JSON actions on the same setup drops the score to 33%. Code actions need about 30% fewer steps and tokens and handle multimodal state more easily. The toolset is deliberately simple: a text-based web browser and a file inspector borrowed from Magentic-One. Next steps are vision-based GUI browsing and benchmarking open models such as DeepSeek R1.

  • Introducing Agents.js: Give tools to your LLMs using JavaScript

    Hugging Face mediumAdept

    Agents.js is a JavaScript library from huggingface.js that gives LLMs tool access in the browser or on Node. An HfAgent turns a plain-text command into JavaScript that chains multimodal tools such as textToImage, imageToText and textToSpeech, then evaluates that code and returns messages carrying strings or Blobs. Any async string-to-string function can stand in as the LLM, with OpenAI shown as an example, and custom tools are defined with a name, description, few-shot examples and a call function. Because the agent executes arbitrary generated code, generateCode followed by evaluateCode is recommended over run, so the code can be reviewed before it executes.

  • CodeAgents + Structure: A Better Way to Execute Actions

    Hugging Face mediumAdept

    Forcing code-writing agents to emit their reasoning and Python code as a structured JSON blob (thoughts + code) beats both markdown-parsed CodeAgents and JSON tool-calling agents by 2-7 percentage points on GAIA, MATH, SimpleQA and Frames for capable models. An analysis of 15,724 traces shows first-step parsing errors cut success from 51.3% to 42.3% and raise average steps from 3.18 to 4.63, which structured generation eliminates. Smaller models such as Mistral-7B pay a "structure tax", producing broken Python when juggling JSON escaping and code at once, so the approach is recommended for 32B+ or frontier models. In smolagents it is enabled with use_structured_outputs_internally=True.

  • Open SWE: An Open-Source Framework for Internal Coding Agents

    LangChain mediumAdept

    Open SWE is an MIT-licensed framework for internal coding agents, built on Deep Agents and LangGraph. It packages the patterns that Stripe's Minions, Ramp's Inspect and Coinbase's Cloudbot converged on: per-task isolated cloud sandboxes, a small curated toolset, context drawn from AGENTS.md plus the source Linear issue or Slack thread, subagents for delegated subtasks, and deterministic middleware around the agent loop. Two middleware examples are injecting follow-up messages mid-run and opening a PR if the agent didn't. It is invoked from Slack, Linear and GitHub, and the sandbox provider, model, tools, triggers, prompt and middleware are all pluggable.

  • CoderForge-Preview: SOTA open dataset for training efficient coding agents

    Together AI hardMaster

    CoderForge-Preview is an open dataset of 258K test-verified coding agent trajectories (155K passing) covering 51K tasks across 1,655 repositories from R2E-Gym, SWE-Smith and SWE-Rebench. The trajectories were generated with Qwen3-Coder-480B in OpenHands Docker environments, filtered by rejection sampling and permissive-license audits, and cost about $130K to produce at a ~90% prompt cache hit rate. Fine-tuning Qwen3-32B on the passing trajectories, using Ulysses sequence parallelism, multipacking and token-level loss normalization at 128K context, reaches 59.4% pass@1 on SWE-Bench Verified, and a 4B model reaches 43.0%. Ablations show a repetition penalty helps only early checkpoints, so later checkpoints should be run without one.

The quest for software engineering knowledge.

Look:
Layout: