{"record":{"id":"cd43f400c0f7d51a","repo":"mlflow/mlflow","slug":"model-inference-is-missing-inputs-the-model-signa","errorCode":null,"errorMessage":"Model inference is missing inputs. The model signature declares {} inputs  but the provided value only has {} inputs. Note: the inputs were not named in the signature so we can only verify their count.","messagePattern":"Model inference is missing inputs\\. The model signature declares (.+?) inputs  but the provided value only has (.+?) inputs\\. Note: the inputs were not named in the signature so we can only verify their count\\.","errorType":"exception","errorClass":"MlflowException","httpStatus":null,"severity":"error","filePath":"mlflow/models/utils.py","lineNumber":1272,"sourceCode":"                message = \"Input schema validation failed. Mismatched or missing input(s).\"\n                if extra_cols:\n                    message += \" Note that there were extra inputs provided.\"\n            else:\n                message = f\"Model is missing inputs {missing_cols}.\"\n                if extra_cols:\n                    message += f\" Note that there were extra inputs: {extra_cols}.\"\n            raise MlflowException(message)\n\n        if extra_cols:\n            _logger.warning(\n                \"Found extra inputs in the model input that are not defined in the model \"\n                f\"signature: `{extra_cols}`. These inputs will be ignored.\"\n            )\n    elif not input_schema.is_tensor_spec():\n        # The model signature does not specify column names => we can only verify column count.\n        num_actual_columns = len(pf_input.columns)\n        if num_actual_columns < len(input_schema.inputs):\n            raise MlflowException(\n                \"Model inference is missing inputs. The model signature declares \"\n                \"{} inputs  but the provided value only has \"\n                \"{} inputs. Note: the inputs were not named in the signature so we can \"\n                \"only verify their count.\".format(len(input_schema.inputs), num_actual_columns)\n            )\n    if input_schema.is_tensor_spec():\n        return _enforce_tensor_schema(pf_input, input_schema)\n    elif HAS_PYSPARK and isinstance(original_pf_input, SparkDataFrame):\n        return _enforce_pyspark_dataframe_schema(\n            original_pf_input, pf_input, input_schema, flavor=flavor\n        )\n    else:\n        # pf_input must be a pandas Dataframe at this point\n        return (\n            _enforce_named_col_schema(pf_input, input_schema)\n            if input_schema.has_input_names()\n            else _enforce_unnamed_col_schema(pf_input, input_schema)\n        )","sourceCodeStart":1254,"sourceCodeEnd":1290,"githubUrl":"https://github.com/mlflow/mlflow/blob/6a27f2decc0b76eb1b54af31849784addb357dbc/mlflow/models/utils.py#L1254-L1290","documentation":"When a column-based signature does not name its inputs, MLflow can only check the column count. This error fires when the input DataFrame has fewer columns than the signature declares, meaning inputs are missing (though which ones cannot be identified).","triggerScenarios":"Predict/validate_schema with a DataFrame having fewer columns than len(input_schema.inputs) for a signature with unnamed inputs (e.g. from infer_signature on a numpy array or nameless schema).","commonSituations":"Serving data with fewer features than training; feature-selection step dropping columns; passing a wide-format subset of the training feature matrix.","solutions":["Add the missing feature columns so the DataFrame has exactly len(model.input_schema.inputs) columns in the same order as the signature.","Check the count: len(df.columns) vs len(model.input_schema.inputs) before predict.","Re-log the model with a named column signature so errors pinpoint missing columns by name."],"exampleFix":"// before\nmodel.predict(df)  # df has 3 columns, signature declares 5\n\n// after\nassert len(df.columns) == len(model.input_schema.inputs), \\\n    f\"expected {len(model.input_schema.inputs)} columns\"\nmodel.predict(df)","handlingStrategy":"validation","validationCode":"expected = len(model.input_schema.inputs)\nif len(df.columns) < expected:\n    raise ValueError(f\"Signature expects {expected} columns, got {len(df.columns)}\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check column count against input_schema before predict","Prefer named column signatures so missing columns are identified by name","Add an integration test with the full training feature matrix"],"tags":["mlflow","column-signature","missing-columns","count-mismatch"],"backgroundTag":"missing-required-columns","analyzedSha":"6a27f2decc0b76eb1b54af31849784addb357dbc","analyzedAt":"2026-08-29T20:54:51.419Z","schemaVersion":2},"datasetVersion":"2026-08-29T22:17:34.462Z"}