{"record":{"id":"690fc8590a673e92","repo":"huggingface/smolagents","slug":"the-model-id-parameter-will-be-required-in-versi-690fc8","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 'anthropic/claude-3-5-sonnet-20240620'.","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 'anthropic/claude-3-5-sonnet-20240620'\\.","errorType":"console","errorClass":"FutureWarning","httpStatus":null,"severity":"warning","filePath":"src/smolagents/models.py","lineNumber":1234,"sourceCode":"            Custom role conversion mapping to convert message roles in others.\n            Useful for specific models that do not support specific message roles like \"system\".\n        flatten_messages_as_text (`bool`, *optional*): Whether to flatten messages as text.\n            Defaults to `True` for models that start with \"ollama\", \"groq\", \"cerebras\".\n        **kwargs:\n            Additional keyword arguments to forward to the underlying LiteLLM completion call.\n    \"\"\"\n\n    def __init__(\n        self,\n        model_id: str | None = None,\n        api_base: str | None = None,\n        api_key: str | None = None,\n        custom_role_conversions: dict[str, str] | None = None,\n        flatten_messages_as_text: bool | None = None,\n        **kwargs,\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 'anthropic/claude-3-5-sonnet-20240620'.\",\n                FutureWarning,\n            )\n            model_id = \"anthropic/claude-3-5-sonnet-20240620\"\n        self.api_base = api_base\n        self.api_key = api_key\n        flatten_messages_as_text = (\n            flatten_messages_as_text\n            if flatten_messages_as_text is not None\n            else model_id.startswith((\"ollama\", \"groq\", \"cerebras\"))\n        )\n        super().__init__(\n            model_id=model_id,\n            custom_role_conversions=custom_role_conversions,\n            flatten_messages_as_text=flatten_messages_as_text,\n            **kwargs,","sourceCodeStart":1216,"sourceCodeEnd":1252,"githubUrl":"https://github.com/huggingface/smolagents/blob/30bb1161095dbae2271e6bc3cc4c219cc3897a57/src/smolagents/models.py#L1216-L1252","documentation":"AnthropicModel.__init__ emits the same style FutureWarning when model_id is omitted; the current fallback is 'anthropic/claude-3-5-sonnet-20240620' but the parameter becomes mandatory in smolagents 2.0.0.","triggerScenarios":"Creating AnthropicModel(api_key=...) without model_id after upgrade; legacy snippets relying on the Claude 3.5 Sonnet default.","commonSituations":"Upgrades where the implicit dated model snapshot is undesirable anyway; billing/capability drift when the pinned default model is deprecated by the provider.","solutions":["Pass model_id explicitly (e.g. 'claude-sonnet-4-20250514' or your current model)","Pin the old default explicitly if behavior must not change","Grep code for AnthropicModel( without model_id before moving to 2.x"],"exampleFix":"# before\nmodel = AnthropicModel(api_key=KEY)\n\n# after\nmodel = AnthropicModel(model_id='claude-sonnet-4-20250514', api_key=KEY)","handlingStrategy":"validation","validationCode":"model = AnthropicModel(model_id='claude-sonnet-4-20250514', api_key=API_KEY)","typeGuard":null,"tryCatchPattern":"import warnings\nwith warnings.catch_warnings():\n    warnings.simplefilter('ignore', FutureWarning)\n    model = AnthropicModel(api_key=API_KEY)  # temporary","preventionTips":["Pass model_id explicitly for every provider model","Review dated default model snapshots after upgrades"],"tags":["smolagents","anthropic","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"}