BerriAI/litellm · error · ValueError
Missing Predibase Tenant ID - Required for making the reques
Error message
Missing Predibase Tenant ID - Required for making the request. Set dynamically (e.g. `completion(..tenant_id=<MY-ID>)`) or in env - `PREDIBASE_TENANT_ID`.
What it means
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.
Source
Thrown at litellm/main.py:3719
custom_prompt_dict: Final = ctx.custom_prompt_dict
litellm_params: Final = ctx.litellm_params
logger_fn: Final = ctx.logger_fn
logging: Final = ctx.logging
messages: Final = ctx.messages
model: Final = ctx.model
model_response: Final = ctx.model_response
optional_params: Final = ctx.optional_params
timeout: Final = ctx.timeout
tenant_id: Final = (
optional_params.pop("tenant_id", None)
or optional_params.pop("predibase_tenant_id", None)
or litellm.predibase_tenant_id
or get_secret("PREDIBASE_TENANT_ID")
)
if tenant_id is None:
raise ValueError(
"Missing Predibase Tenant ID - Required for making the request. Set dynamically (e.g. `completion(..tenant_id=<MY-ID>)`) or in env - `PREDIBASE_TENANT_ID`."
)
api_base = (
api_base
or optional_params.pop("api_base", None)
or optional_params.pop("base_url", None)
or litellm.api_base
or get_secret("PREDIBASE_API_BASE")
)
api_key = api_key or litellm.api_key or litellm.predibase_key or get_secret("PREDIBASE_API_KEY")
_model_response: Final = predibase_chat_completions.completion(
model=model,
messages=messages,
model_response=model_response,
print_verbose=print_verbose,View on GitHub (pinned to 77b7c6c40c)
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
Example fix
# before resp = litellm.completion(model='predibase/llama-3-1-8b', messages=m) # ValueError # after import os os.environ['PREDIBASE_TENANT_ID'] = '<tenant-id>' os.environ['PREDIBASE_API_KEY'] = 'pb_...' resp = litellm.completion(model='predibase/llama-3-1-8b', messages=m)
Defensive patterns
Strategy: validation
Validate before calling
import os
tenant = os.getenv('PREDIBASE_TENANT_ID') or litellm.predibase_tenant_id
if model.startswith('predibase') and not tenant:
raise SystemExit('PREDIBASE_TENANT_ID not set') Type guard
def predibase_ready(model: str) -> bool:
return not model.startswith('predibase') or bool(os.getenv('PREDIBASE_TENANT_ID')) Try / catch
try:
resp = litellm.completion(model='predibase/llama-3-1-8b', messages=m)
except ValueError as e:
if 'Predibase Tenant ID' in str(e):
raise RuntimeError('Set PREDIBASE_TENANT_ID (tenant id, not workspace name)') from e
raise Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: "environment variable is not set" and "Missing keys in environment" errors: what missing required env var messages mean and how to fix them — this error's family across 28 libraries.
Related errors
- 🚨🚨🚨 DISABLING LLM API ENDPOINTS is an Enterprise feature
- 🚨🚨🚨 DISABLING ADMIN ENDPOINTS is an Enterprise feature 🚨
- OpenRouter API key is required. Set OPENROUTER_API_KEY envir
- OpenSandbox api_base is required. Pass api_base or set {OPEN
- PARALLEL_API_KEY is not set. Set `PARALLEL_API_KEY` environm
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/5e10551a6f35173e.
Report an issue: GitHub.