BerriAI/litellm · error · ValueError
Missing Predibase API Key - A call is being made to…
Error message
Missing Predibase API Key - A call is being made to predibase but no key is set either in the environment variables or via params
What it means
Credential guard in the Predibase validate_environment: api_key is None and no Predibase key could be found in environment variables, so the Authorization header cannot be built and the request is rejected before sending.
Solutions
- Set the PREDIBASE_API_KEY environment variable.
- Or pass api_key in the call params.
Example fix
os.environ["PREDIBASE_API_KEY"] = "<key>"
Defensive patterns
Strategy: validation
When it happens
Trigger: Triggered when making a Predibase request without an API key set in environment variables or passed via params.
Common situations: See trigger scenarios.
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/b5f013d4946a06b5.
Report an issue: GitHub.
Appendix: source
Thrown at litellm/llms/predibase/chat/transformation.py:347
else:
completion_url += "/generate"
return completion_url
def get_error_class(self, error_message: str, status_code: int, headers: dict | Headers) -> BaseLLMException:
return PredibaseError(status_code=status_code, message=error_message, headers=headers)
def validate_environment(
self,
headers: dict,
model: str,
messages: list[AllMessageValues],
optional_params: dict,
litellm_params: dict,
api_key: str | None = None,
api_base: str | None = None,
) -> dict:
if api_key is None:
raise ValueError(
"Missing Predibase API Key - A call is being made to predibase but no key is set either in the environment variables or via params"
)
default_headers: Final = {
"content-type": "application/json",
"Authorization": f"Bearer {api_key}",
}
if headers is not None and isinstance(headers, dict):
headers = {**default_headers, **headers}
return headers
View on GitHub (pinned to 77b7c6c40c)