{"record":{"id":"8a54e48894219faf","repo":"huggingface/smolagents","slug":"the-model-id-parameter-will-be-required-in-versi","errorCode":null,"errorMessage":"The 'model_id' parameter will be required in version 2.0.0. Please update your code to pass this parameter to avoid future errors. For now, it defaults to 'HuggingFaceTB/SmolLM2-1.7B-Instruct'.","messagePattern":"The 'model_id' parameter will be required in version 2\\.0\\.0\\. Please update your code to pass this parameter to avoid future errors\\. For now, it defaults to 'HuggingFaceTB/SmolLM2-1\\.7B-Instruct'\\.","errorType":"console","errorClass":"FutureWarning","httpStatus":null,"severity":"warning","filePath":"src/smolagents/models.py","lineNumber":933,"sourceCode":"        apply_chat_template_kwargs: dict[str, Any] | None = None,\n        **kwargs,\n    ):\n        try:\n            import torch\n            from transformers import (\n                AutoModelForCausalLM,\n                AutoModelForImageTextToText,\n                AutoProcessor,\n                AutoTokenizer,\n                TextIteratorStreamer,\n            )\n        except ModuleNotFoundError:\n            raise ModuleNotFoundError(\n                \"Please install 'transformers' extra to use 'TransformersModel': `pip install 'smolagents[transformers]'`\"\n            )\n\n        if not model_id:\n            warnings.warn(\n                \"The 'model_id' parameter will be required in version 2.0.0. \"\n                \"Please update your code to pass this parameter to avoid future errors. \"\n                \"For now, it defaults to 'HuggingFaceTB/SmolLM2-1.7B-Instruct'.\",\n                FutureWarning,\n            )\n            model_id = \"HuggingFaceTB/SmolLM2-1.7B-Instruct\"\n\n        max_new_tokens = max_tokens if max_tokens is not None else max_new_tokens\n\n        if device_map is None:\n            device_map = \"cuda\" if torch.cuda.is_available() else \"cpu\"\n        logger.info(f\"Using device: {device_map}\")\n        self._is_vlm = False\n        self.model_kwargs = model_kwargs or {}\n        self.apply_chat_template_kwargs = apply_chat_template_kwargs or {}\n        try:\n            self.model = AutoModelForImageTextToText.from_pretrained(\n                model_id,","sourceCodeStart":915,"sourceCodeEnd":951,"githubUrl":"https://github.com/huggingface/smolagents/blob/30bb1161095dbae2271e6bc3cc4c219cc3897a57/src/smolagents/models.py#L915-L951","documentation":"TransformersModel.__init__ warns (FutureWarning) when model_id is not passed; it currently falls back to 'HuggingFaceTB/SmolLM2-1.7B-Instruct' but model_id becomes required in version 2.0.0. The warning is the migration signal before the hard failure.","triggerScenarios":"Constructing TransformersModel() with no model_id (relying on the old default) after upgrading smolagents; copying legacy examples that omit model_id.","commonSituations":"Version upgrades where code silently used the default SmolLM2 model; teams surprised their 'unconfigured' model was actually a small default model.","solutions":["Pass an explicit model_id matching your use case","If the default was intentional, pass it explicitly to silence the warning","Audit configs/scripts for TransformersModel( constructions without model_id before upgrading to 2.x"],"exampleFix":"# before\nmodel = TransformersModel()\n\n# after\nmodel = TransformersModel(model_id='Qwen/Qwen2.5-7B-Instruct')","handlingStrategy":"validation","validationCode":"model = TransformersModel(model_id=os.environ['MODEL_ID'])","typeGuard":null,"tryCatchPattern":"import warnings\nwith warnings.catch_warnings():\n    warnings.simplefilter('ignore', FutureWarning)\n    model = TransformersModel()  # temporary, will break in 2.0","preventionTips":["Always pass model_id explicitly","Grep code for TransformersModel( without model_id before upgrading","Store model ids in config/env, not implicit defaults"],"tags":["smolagents","transformers","deprecation","model-config"],"backgroundTag":"deprecated-default-value-change","analyzedSha":"30bb1161095dbae2271e6bc3cc4c219cc3897a57","analyzedAt":"2026-08-28T18:52:54.169Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}