{"record":{"id":"06ed1a877e269b20","repo":"BerriAI/litellm","slug":"levoai-workspace-id-environment-variable-is-requir","errorCode":null,"errorMessage":"LEVOAI_WORKSPACE_ID environment variable is required for Levo integration.","messagePattern":"LEVOAI_WORKSPACE_ID environment variable is required for Levo integration\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/integrations/levo/levo.py","lineNumber":63,"sourceCode":"        Returns:\n            LevoConfig: Configuration object containing Levo OTLP settings.\n\n        Raises:\n            ValueError: If required environment variables are missing.\n        \"\"\"\n        # Required environment variables\n        api_key: Final = os.environ.get(\"LEVOAI_API_KEY\", None)\n        org_id: Final = os.environ.get(\"LEVOAI_ORG_ID\", None)\n        workspace_id: Final = os.environ.get(\"LEVOAI_WORKSPACE_ID\", None)\n        collector_url: Final = os.environ.get(\"LEVOAI_COLLECTOR_URL\", None)\n\n        # Validate required env vars\n        if not api_key:\n            raise ValueError(\"LEVOAI_API_KEY environment variable is required for Levo integration.\")\n        if not org_id:\n            raise ValueError(\"LEVOAI_ORG_ID environment variable is required for Levo integration.\")\n        if not workspace_id:\n            raise ValueError(\"LEVOAI_WORKSPACE_ID environment variable is required for Levo integration.\")\n        if not collector_url:\n            raise ValueError(\n                \"LEVOAI_COLLECTOR_URL environment variable is required for Levo integration. \"\n                \"Please contact Levo support to get your collector URL.\"\n            )\n\n        # Use collector URL exactly as provided by the user\n        endpoint: Final = collector_url\n        protocol: Final[Protocol] = \"otlp_http\"\n\n        # Build OTLP headers string\n        # Format: Authorization=Bearer {api_key},x-levo-organization-id={org_id},x-levo-workspace-id={workspace_id}\n        headers_parts: Final = [f\"Authorization=Bearer {api_key}\"]\n        headers_parts.append(f\"x-levo-organization-id={org_id}\")\n        headers_parts.append(f\"x-levo-workspace-id={workspace_id}\")\n\n        otlp_auth_headers: Final = \",\".join(headers_parts)\n","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/integrations/levo/levo.py#L45-L81","documentation":"Levo integration validation: LEVOAI_WORKSPACE_ID is missing. It becomes the x-levo-workspace-id OTLP header used to scope telemetry to a Levo workspace; absent or empty values abort exporter construction with ValueError.","triggerScenarios":"levo callback enabled while LEVOAI_WORKSPACE_ID is not exported; workspace id available in the Levo UI but never copied into the deployment env; a trailing-whitespace or empty value treated as missing.","commonSituations":"Multi-workspace Levo accounts where the developer picked the right org but forgot the workspace scope; helm values files updated for some LEVOAI_* keys but not all.","solutions":["export LEVOAI_WORKSPACE_ID=<workspace id from Levo>","Verify all LEVOAI_* vars together: 'env | grep LEVOAI'","Store the full set in one secret/ConfigMap so they deploy atomically","Remove the levo callback if telemetry is not needed"],"exampleFix":"# before\n# LEVOAI_WORKSPACE_ID unset -> ValueError\n\n# after\nexport LEVOAI_API_KEY=...\nexport LEVOAI_ORG_ID=...\nexport LEVOAI_WORKSPACE_ID=ws-1234\nexport LEVOAI_COLLECTOR_URL=https://...","handlingStrategy":"validation","validationCode":"import os\n\ndef levo_config_valid() -> bool:\n    return bool(os.getenv(\"LEVOAI_WORKSPACE_ID\"))","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate all LEVOAI_* vars together at deploy time","Prefer one ConfigMap/secret object so partial configs cannot ship"],"tags":["python","levo","environment","configuration"],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}