{"record":{"id":"87c7029d7ef1f51d","repo":"docling-project/docling","slug":"unknown-engine-type-options-engine-type","errorCode":null,"errorMessage":"Unknown engine type: {options.engine_type}","messagePattern":"Unknown engine type: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"docling/models/inference_engines/image_classification/factory.py","lineNumber":99,"sourceCode":"        from docling.models.inference_engines.image_classification.api_kserve_v2_engine import (\n            ApiKserveV2ImageClassificationEngine,\n        )\n\n        if not isinstance(options, ApiKserveV2ImageClassificationEngineOptions):\n            raise ValueError(\n                \"Expected ApiKserveV2ImageClassificationEngineOptions, \"\n                f\"got {type(options)}\"\n            )\n\n        return ApiKserveV2ImageClassificationEngine(\n            enable_remote_services=enable_remote_services,\n            options=options,\n            model_config=model_config,\n            artifacts_path=artifacts_path,\n            accelerator_options=accelerator_options,\n        )\n\n    raise ValueError(f\"Unknown engine type: {options.engine_type}\")\n","sourceCodeStart":81,"sourceCodeEnd":100,"githubUrl":"https://github.com/docling-project/docling/blob/61d76f1ff3f8428065465889f7b4577da7df704c/docling/models/inference_engines/image_classification/factory.py#L81-L100","documentation":"The image-classification engine factory fell through all known engine-type branches (ONNXRUNTIME, TRANSFORMERS, API_KSERVE_V2) and hit the terminal raise. The options.engine_type value is not a member the factory recognizes — typically an invalid string, a new enum member added without factory support, or None.","triggerScenarios":"Calling create_image_classification_engine-style factory functions with options.engine_type set to something outside the handled ImageClassificationEngineType members (or an engine_type injected as a raw string that equals none of them).","commonSituations":"Typo in a config-provided engine type; constructing options manually with an unvalidated string; using a newer/older docling version where the enum and factory branches are out of sync; engine_type left as an unsupported default.","solutions":["Set engine_type to a valid ImageClassificationEngineType member (e.g. ONNXRUNTIME, TRANSFORMERS, or API_KSERVE_V2) via the matching options class.","If the value comes from config, validate it against ImageClassificationEngineType before building options (e.g. ImageClassificationEngineType(value)).","If you need an engine type you believe exists, check that your installed docling version's factory supports it and upgrade/downgrade accordingly."],"exampleFix":"# before\noptions.engine_type = \"onnx\"  # not a valid enum value\n\n# after\nfrom docling.datamodel.image_classification_engine_options import OnnxRuntimeImageClassificationEngineOptions\noptions = OnnxRuntimeImageClassificationEngineOptions()  # engine_type correct by construction","handlingStrategy":"validation","validationCode":"from docling.datamodel.image_classification_engine_options import ImageClassificationEngineType\n\nengine_type = ImageClassificationEngineType(options.engine_type)  # raises ValueError on invalid values","typeGuard":"def is_known_engine_type(value) -> bool:\n    try:\n        ImageClassificationEngineType(value)\n        return True\n    except ValueError:\n        return False","tryCatchPattern":"try:\n    engine = create_engine(options=options, ...)\nexcept ValueError as e:\n    if \"Unknown engine type\" in str(e):\n        raise SystemExit(f\"unsupported engine_type {options.engine_type!r}; valid: \"\n                         f\"{[t.value for t in ImageClassificationEngineType]}\") from e\n    raise","preventionTips":["Validate engine_type against the enum at config load time, not at factory call time.","Fail fast with the list of valid values in your own error messages.","Keep config schema and installed docling version in sync when new engine types appear."],"tags":["factory","invalid-enum","configuration","engine-type"],"backgroundTag":null,"analyzedSha":"61d76f1ff3f8428065465889f7b4577da7df704c","analyzedAt":"2026-08-14T23:53:18.727Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}