{"record":{"id":"24d7232bb1320624","repo":"BerriAI/litellm","slug":"cp4d-host-is-required-in-litellm-params-for-wxo","errorCode":null,"errorMessage":"'cp4d_host' is required in litellm_params for WXO agents","messagePattern":"'cp4d_host' is required in litellm_params for WXO agents","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/a2a_protocol/providers/watsonx_orchestrate/handler.py","lineNumber":197,"sourceCode":"                continue\n            try:\n                event = json.loads(data_str)\n            except json.JSONDecodeError:\n                continue\n            chunk_text = WatsonxOrchestrateTransformation.extract_text_from_wxo_result(event)\n            if chunk_text:\n                accumulated_text += chunk_text\n        return accumulated_text\n\n    @staticmethod\n    def _extract_litellm_params(litellm_params: dict[str, Any]) -> WXORequestParams:\n        cp4d_host: Final = litellm_params.get(\"cp4d_host\") or \"\"\n        instance_id: Final = litellm_params.get(\"instance_id\") or \"\"\n        wxo_agent_id: Final = litellm_params.get(\"wxo_agent_id\") or \"\"\n        api_key: Final = litellm_params.get(\"api_key\") or \"\"\n\n        if not cp4d_host:\n            raise ValueError(\"'cp4d_host' is required in litellm_params for WXO agents\")\n        if not instance_id:\n            raise ValueError(\"'instance_id' is required in litellm_params for WXO agents\")\n        if not wxo_agent_id:\n            raise ValueError(\"'wxo_agent_id' is required in litellm_params for WXO agents\")\n        if not api_key:\n            raise ValueError(\"'api_key' is required in litellm_params for WXO agents\")\n\n        return WXORequestParams(\n            cp4d_host=cp4d_host,\n            instance_id=instance_id,\n            wxo_agent_id=wxo_agent_id,\n            api_key=api_key,\n            username=litellm_params.get(\"username\") or None,\n            auth_mode=litellm_params.get(\"auth_mode\") or \"cp4d\",\n            thread_id=litellm_params.get(\"thread_id\") or None,\n        )\n\n    @staticmethod","sourceCodeStart":179,"sourceCodeEnd":215,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/a2a_protocol/providers/watsonx_orchestrate/handler.py#L179-L215","documentation":"Configuration validation error from the WXO handler's _extract_litellm_params: the 'cp4d_host' key is absent or empty in litellm_params. LiteLLM requires cp4d_host to construct the Cloud Pak for Data base URL for all watsonx Orchestrate agent calls, so it fails fast with a ValueError before any HTTP request is made.","triggerScenarios":"Declaring a WXO model in the LiteLLM proxy config (or calling acompletion with a wxo model) where litellm_params lacks 'cp4d_host', or its value is an empty string/None. Note the check uses `or ''`, so falsy values (empty string, None) all trigger it.","commonSituations":"Copy-pasting a WXO deployment block from docs and forgetting cp4d_host; using YAML anchors/inheritance where the host variable resolves empty; mixing up 'host' vs 'cp4d_host' key names in config.","solutions":["Add 'cp4d_host' to the model's litellm_params in config.yaml, e.g. cp4d_host: https://cpd-host:443 (no trailing path).","If using env vars in config, confirm the var (e.g. os.environ/CP4D_HOST) is set and non-empty in the proxy's environment.","Double-check spelling: the key must be exactly 'cp4d_host', not 'host' or 'api_base'."],"exampleFix":"# before\nmodel_info:\n  - model_name: my-wxo-agent\n    litellm_params:\n      model: watsonx_orchestrate/agent\n      instance_id: my-instance\n\n# after\nmodel_info:\n  - model_name: my-wxo-agent\n    litellm_params:\n      model: watsonx_orchestrate/agent\n      cp4d_host: https://cpd.example.com:443\n      instance_id: my-instance","handlingStrategy":"validation","validationCode":"REQUIRED_WXO_PARAMS = (\"cp4d_host\", \"instance_id\", \"wxo_agent_id\", \"api_key\")\n\ndef validate_wxo_config(litellm_params: dict) -> None:\n    missing = [k for k in REQUIRED_WXO_PARAMS if not litellm_params.get(k)]\n    if missing:\n        raise ConfigError(f\"WXO config missing: {missing}\")","typeGuard":"def has_valid_wxo_config(p: dict) -> bool:\n    return all(isinstance(p.get(k), str) and p[k].strip() for k in (\"cp4d_host\", \"instance_id\", \"wxo_agent_id\", \"api_key\"))","tryCatchPattern":null,"preventionTips":["Define WXO model blocks once in config.yaml and validate them at proxy startup with a config linter.","Use env var indirection (os.environ/VAR) so empty values fail visibly at startup, not at request time.","Keep a checklist of the four required WXO params next to onboarding docs."],"tags":["watsonx-orchestrate","configuration","validation","cp4d"],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}