{"record":{"id":"6f42867d9410d662","repo":"sgl-project/sglang","slug":"server-args-is-required-to-resolve-ideogram4-nvfp4","errorCode":null,"errorMessage":"server_args is required to resolve Ideogram4 NVFP4 paths","messagePattern":"server_args is required to resolve Ideogram4 NVFP4 paths","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/pipelines/ideogram.py","lineNumber":199,"sourceCode":"        )\n        self.add_stage_factory(\n            RoleType.DECODER,\n            lambda: Ideogram4DecodingStage(vae=self.get_module(\"vae\")),\n            \"ideogram4_decoding_stage\",\n        )\n\n\nclass Ideogram4Nvfp4Pipeline(Ideogram4Pipeline):\n    pipeline_name = \"Ideogram4Nvfp4Pipeline\"\n    _model_resolution: Ideogram4Nvfp4ModelResolution | None = None\n\n    def _get_model_resolution(\n        self,\n        server_args: ServerArgs | None = None,\n    ) -> Ideogram4Nvfp4ModelResolution:\n        if self._model_resolution is None:\n            if server_args is None:\n                raise ValueError(\n                    \"server_args is required to resolve Ideogram4 NVFP4 paths\"\n                )\n            self._model_resolution = resolve_ideogram4_nvfp4_model(\n                server_args,\n                self.model_path,\n            )\n        return self._model_resolution\n\n    def _load_config(self) -> dict[str, Any]:\n        model_resolution = self._get_model_resolution(self.server_args)\n        logger.info(\"Model path: %s\", self.model_path)\n        logger.info(\n            \"Using base model '%s' at %s for config and non-transformer components\",\n            model_resolution.base_model_name,\n            model_resolution.base_model_path,\n        )\n        config = verify_model_config_and_directory(model_resolution.base_model_path)\n        return cast(dict[str, Any], config)","sourceCodeStart":181,"sourceCodeEnd":217,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/pipelines/ideogram.py#L181-L217","documentation":"Raised by Ideogram4Pipeline._get_model_resolution when the NVFP4 model-path resolution has not been cached yet and the caller passes server_args=None. The resolution needs ServerArgs (quantization overrides, model paths) to locate the Ideogram4 NVFP4 weights, so it cannot run lazily without them.","triggerScenarios":"Calling _get_model_resolution() with no argument (or None) before any prior call that passed server_args; calling helpers that depend on it — _load_config, _resolve_component_path, load_modules — on a pipeline instance whose _model_resolution cache is empty and whose code path forwards server_args=None.","commonSituations":"Custom loaders or tests that construct the pipeline and call config-loading helpers without threading ServerArgs through; refactors that dropped the server_args parameter from an internal call chain.","solutions":["Pass the real ServerArgs through to _get_model_resolution(server_args=server_args) on the first invocation so the resolution is cached","Fix the caller chain (_load_config / _resolve_component_path / load_modules overrides) to forward server_args instead of None","In tests, call _get_model_resolution(server_args=build_server_args()) once up front to prime _model_resolution"],"exampleFix":"// before\nresolution = pipeline._get_model_resolution()  # cache empty -> ValueError\n\n// after\nresolution = pipeline._get_model_resolution(server_args=server_args)","handlingStrategy":"validation","validationCode":"if pipeline._model_resolution is None:\n    if server_args is None:\n        raise SystemExit('ServerArgs required before resolving Ideogram4 NVFP4 paths')\n    pipeline._get_model_resolution(server_args=server_args)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always thread ServerArgs through the first call to _get_model_resolution","Prime the resolution cache immediately after pipeline construction","Avoid calling private helpers (_load_config, _resolve_component_path) without server_args in scope"],"tags":["ideogram","nvfp4","missing-argument","lazy-init","sglang"],"backgroundTag":"missing-required-argument","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}