huggingface/smolagents · error · ValueError
This tool does not implement a default checkpoint, you need
Error message
This tool does not implement a default checkpoint, you need to pass one.
What it means
A PipelineTool needs a model checkpoint. If `model` is not passed and the subclass does not define `default_checkpoint`, __init__ cannot determine what to load and raises ValueError immediately.
Source
Thrown at src/smolagents/tools.py:1237
def __init__(
self,
model=None,
pre_processor=None,
post_processor=None,
device=None,
device_map=None,
model_kwargs=None,
token=None,
**hub_kwargs,
):
if not _is_package_available("accelerate") or not _is_package_available("torch"):
raise ModuleNotFoundError(
"Please install 'transformers' extra to use a PipelineTool: `pip install 'smolagents[transformers]'`"
)
if model is None:
if self.default_checkpoint is None:
raise ValueError("This tool does not implement a default checkpoint, you need to pass one.")
model = self.default_checkpoint
if pre_processor is None:
pre_processor = model
self.model = model
self.pre_processor = pre_processor
self.post_processor = post_processor
self.device = device
self.device_map = device_map
self.model_kwargs = {} if model_kwargs is None else model_kwargs
if device_map is not None:
self.model_kwargs["device_map"] = device_map
self.hub_kwargs = hub_kwargs
self.hub_kwargs["token"] = token
super().__init__()
def setup(self):View on GitHub (pinned to 30bb116109)
Solutions
- Pass an explicit checkpoint: `MyTool(model='repo/model-name')`
- Define `default_checkpoint = 'org/model-name'` as a class attribute on the subclass
- If the tool is intentionally checkpoint-less, reconsider subclassing PipelineTool vs plain Tool
Example fix
# before
class MyTranslator(PipelineTool):
pass # no default_checkpoint
MyTranslator()
# after
class MyTranslator(PipelineTool):
default_checkpoint = "Helsinki-NLP/opus-mt-en-fr"
MyTranslator() Defensive patterns
Strategy: validation
Validate before calling
if getattr(MyPipelineTool, "default_checkpoint", None) is None and checkpoint is None:
checkpoint = "org/default-model" # your fallback
my_tool = MyPipelineTool(model=checkpoint) Type guard
def has_checkpoint(tool_cls, model=None) -> bool:
return model is not None or getattr(tool_cls, "default_checkpoint", None) is not None Try / catch
try:
tool = MyPipelineTool()
except ValueError as e:
if "default checkpoint" in str(e):
tool = MyPipelineTool(model="org/default-model")
else:
raise Prevention
- Always define default_checkpoint on PipelineTool subclasses
- Pass model= explicitly in tests and dynamic instantiation
- Document required checkpoints for custom tools
When it happens
Trigger: Creating a PipelineTool subclass whose class body sets `default_checkpoint = None` (or never defines it) without passing `model=...`, e.g. `MyPipeTool()` with no arguments.
Common situations: Writing custom PipelineTool subclasses and forgetting the default_checkpoint class attribute; refactoring a subclass and deleting the default; expecting the base class to auto-select a checkpoint.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- Only 'markdown' is supported for a string argument to `code_
- Unsupported executor type: {self.executor_type}
AI-assisted analysis of huggingface/smolagents@30bb116109 (2026-08-28).
Data as JSON: /api/errors/e0b5e0287598574d.
Report an issue: GitHub.