{"record":{"id":"5e10551a6f35173e","repo":"BerriAI/litellm","slug":"missing-predibase-tenant-id-required-for-making-5e1055","errorCode":null,"errorMessage":"Missing Predibase Tenant ID - Required for making the request. Set dynamically (e.g. `completion(..tenant_id=<MY-ID>)`) or in env - `PREDIBASE_TENANT_ID`.","messagePattern":"Missing Predibase Tenant ID - Required for making the request\\. Set dynamically \\(e\\.g\\. `completion\\(\\.\\.tenant_id=<MY-ID>\\)`\\) or in env - `PREDIBASE_TENANT_ID`\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/main.py","lineNumber":3719,"sourceCode":"    custom_prompt_dict: Final = ctx.custom_prompt_dict\n    litellm_params: Final = ctx.litellm_params\n    logger_fn: Final = ctx.logger_fn\n    logging: Final = ctx.logging\n    messages: Final = ctx.messages\n    model: Final = ctx.model\n    model_response: Final = ctx.model_response\n    optional_params: Final = ctx.optional_params\n    timeout: Final = ctx.timeout\n\n    tenant_id: Final = (\n        optional_params.pop(\"tenant_id\", None)\n        or optional_params.pop(\"predibase_tenant_id\", None)\n        or litellm.predibase_tenant_id\n        or get_secret(\"PREDIBASE_TENANT_ID\")\n    )\n\n    if tenant_id is None:\n        raise ValueError(\n            \"Missing Predibase Tenant ID - Required for making the request. Set dynamically (e.g. `completion(..tenant_id=<MY-ID>)`) or in env - `PREDIBASE_TENANT_ID`.\"\n        )\n\n    api_base = (\n        api_base\n        or optional_params.pop(\"api_base\", None)\n        or optional_params.pop(\"base_url\", None)\n        or litellm.api_base\n        or get_secret(\"PREDIBASE_API_BASE\")\n    )\n\n    api_key = api_key or litellm.api_key or litellm.predibase_key or get_secret(\"PREDIBASE_API_KEY\")\n\n    _model_response: Final = predibase_chat_completions.completion(\n        model=model,\n        messages=messages,\n        model_response=model_response,\n        print_verbose=print_verbose,","sourceCodeStart":3701,"sourceCodeEnd":3737,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/main.py#L3701-L3737","documentation":"ValueError from the Predibase handler when the tenant ID cannot be resolved: optional_params tenant_id/predibase_tenant_id, litellm.predibase_tenant_id, or the PREDIBASE_TENANT_ID environment variable are all empty. The tenant ID is baked into the Predibase request URL, so the call cannot proceed without it.","triggerScenarios":"completion(model='predibase/<model>', api_key=..., api_base=...) without tenant_id kwarg and without PREDIBASE_TENANT_ID exported; note the handler pops tenant_id out of optional_params, so the kwarg must actually reach optional params.","commonSituations":"Copy-pasting a Predibase example that only sets PREDIBASE_API_KEY; workspace/tenant renamed on Predibase and the old env var deleted; CI missing the variable.","solutions":["Export PREDIBASE_TENANT_ID=<your-tenant-id>","Or pass it per call: completion(model='predibase/...', tenant_id='<id>', ...)","Or set litellm.predibase_tenant_id = '<id>' at startup","Verify the value is the tenant ID (not the workspace name) shown in your Predibase URL/dashboard"],"exampleFix":"# before\nresp = litellm.completion(model='predibase/llama-3-1-8b', messages=m)  # ValueError\n\n# after\nimport os\nos.environ['PREDIBASE_TENANT_ID'] = '<tenant-id>'\nos.environ['PREDIBASE_API_KEY'] = 'pb_...'\nresp = litellm.completion(model='predibase/llama-3-1-8b', messages=m)","handlingStrategy":"validation","validationCode":"import os\ntenant = os.getenv('PREDIBASE_TENANT_ID') or litellm.predibase_tenant_id\nif model.startswith('predibase') and not tenant:\n    raise SystemExit('PREDIBASE_TENANT_ID not set')","typeGuard":"def predibase_ready(model: str) -> bool:\n    return not model.startswith('predibase') or bool(os.getenv('PREDIBASE_TENANT_ID'))","tryCatchPattern":"try:\n    resp = litellm.completion(model='predibase/llama-3-1-8b', messages=m)\nexcept ValueError as e:\n    if 'Predibase Tenant ID' in str(e):\n        raise RuntimeError('Set PREDIBASE_TENANT_ID (tenant id, not workspace name)') from e\n    raise","preventionTips":["Set PREDIBASE_TENANT_ID and PREDIBASE_API_KEY together at deployment bootstrap and assert both","Pass tenant_id explicitly when one deployment talks to multiple Predibase tenants","Copy the tenant id from the Predibase dashboard URL, not from memory","Include a predibase smoke test in CI to catch missing env vars before release"],"tags":["predibase","tenant-id","env-var","litellm"],"backgroundTag":"missing-env-var","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}