--- title: "Why Python Instead of JSON — smolagents' Twenty Lines and the Checkpoints It Doesn't Have" date: 2026-10-10 model: qwen3.6-plus author_type: human category: reviews summary: smolagents is Hugging Face's minimal agent library, where the model acts by writing Python instead of JSON. GAIA first place, a readable core, and HF Hub integration are the strengths. No checkpoints, the experimental API label, and code-execution security are what get handed over before production. tags: smolagents,Hugging Face,code agent,CodeAgent,MCP,GAIA,user reviews,real user reviews,AI agents --- # Why Python Instead of JSON — smolagents' Twenty Lines and the Checkpoints It Doesn't Have The name of the library Hugging Face released at the end of 2024 is the attitude itself. **smol**agents. The official docs' first line: "build and run agents in a few lines of Python." The default is `CodeAgent`. Instead of the model spitting out JSON tool calls, it **writes Python and executes it.** One line from a measured review: "In 1.26.0 the `pip` package is **13,355 lines** across 12 files — a 13x difference from the initial '1,000 lines' claim." The name is small, but the core stays at a size you can "read and understand over a few hours." This post organizes **one bet — code-as-action — and the cost that bet pays.** --- ### 1. What's the strong bet **The compositionality of code.** Call two tools in a single step and combine the results, iterate over a list, branch on a condition. JSON is bad at nesting and reuse. Python is a programming language. **GAIA.** A multi-agent system hit **44.2%** on the GAIA benchmark for first place, four points ahead of Microsoft AutoGen's 40%. That's a score, not marketing. **Tokens.** On tasks that need variable reuse and intermediate computation, `CodeAgent` reduces the number of tool calls and **tends to use fewer tokens.** (The review notes that controlled comparison measurements are still scarce.) **A readable core.** The execution path is short and visible. It contrasts with heavy frameworks where "three or four candidate causes get buried in the config layers." **HF Hub.** Agents and tools are first-class objects on the Hub. Share and load community agents the way you do models. `GradioUI(agent).launch()` is one line to a web interface. --- ### 2. What gets handed over before production **No checkpoints.** Memory is a Python list inside the process. No PostgreSQL, no Redis, no checkpointer. "If the process dies mid-run, the execution is gone." That's the key difference from LangGraph. **The API carries an experimental label.** "Experimental and may change at any time." An unusual declaration for a framework with 27K stars. Upgrading versions means accepting breakage. **Code execution and security.** The docs state it plainly: **the local runner is not a security boundary.** If you're touching untrusted data you have to move to E2B, Modal, Docker, or WASM — and that's where the infrastructure overhead begins. Prompt injection has a much larger blast radius in code agents. **Model quality dependency.** Weak models write wrong Python. The docs' advice to use the strongest model when debugging is itself the usage rule. **No MCP server.** It can act as an MCP client but doesn't expose its own agent as an MCP endpoint. Hub integration is a form of portability, not membership in the MCP ecosystem. **No observability.** No LangSmith counterpart. OpenTelemetry is an opt-in extra. Production tracing means external tools. --- ### 3. Who uses it | Fits | Doesn't fit | | --- | --- | | Data and ML teams fluent in Python | Non-developer teams | | Internal data analysis in controlled environments | Agents touching untrusted data | | Quick research and prototyping | Long runs that need to resume midway | | Teams already in the HF ecosystem | Multi-agent P2P and swarms | A practitioner's one sentence: **"a minimal framework in skilled hands beats a heavy framework that no one in the committee understands."** --- ### 4. Conclusion — how to start small The user record on smolagents compresses to one sentence: **a minimal core that threw away JSON's ceremony, gained Python's expressiveness, and wears the experimental label.** Its strengths are measured in research, prototyping, and data agents in controlled environments. Its weaknesses show up on the production checklist of "checkpoints, observability, MCP server, API stability." Those items aren't a failure of the framework — they're **the honest trade of minimalism.** If you're planning to use smolagents: (1) a strong model, (2) trusted data only, (3) tasks you can restart on failure, (4) anything beyond that, go LangGraph. Within that boundary, it's one of the most transparent agent cores out there today. Related posts: [CrewAI user reviews](/reviews/2026-10-10-crewai-user-reviews/) · [Pydantic AI user reviews](/reviews/2026-10-10-pydantic-ai-type-safe-reviews/) · [smolagents agent hub entry](/agents/smolagents/) --- ### Sources - Design review: [Hugging Face's smolagents Framework (AgentsDecoded, 2025-01)](https://www.agentsdecoded.com/p/framework-review-hugging-faces-smolagents) - Source measurement: [smolagents Review: Real LOC Count (BenchClaw, 2026-08)](https://benchclaw.io/smolagents-review/) - Roundup: [Smolagents — Minimal Code-First Agent Framework (ChatForest, 2026-05)](https://chatforest.com/reviews/smolagents-huggingface-agent-framework/) · [When Minimal Beats Heavyweight (Orange ITS, 2026-05)](https://www.orange-its.ch/en/insights/smolagents-review) - Official: [smolagents docs (Hugging Face)](https://huggingface.co/docs/smolagents/main/en/index)