BerriAI/litellm · error · OobaboogaError
API Base not set. Set one via…
Error message
API Base not set. Set one via completion(..,api_base='your-api-url')
What it means
Error "API Base not set. Set one via completion(..,api_base='your-api-url')" thrown in BerriAI/litellm.
Solutions
- Pass api_base to the completion call: completion(..., api_base='http://localhost:5000').
When it happens
Trigger: Thrown at litellm/llms/oobabooga/chat/oobabooga.py:43 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/965ccb615258b12b.
Report an issue: GitHub.
Appendix: source
Thrown at litellm/llms/oobabooga/chat/oobabooga.py:43
litellm_params: dict,
custom_prompt_dict={},
logger_fn=None,
default_max_tokens_to_sample=None,
):
headers: Final = oobabooga_config.validate_environment(
api_key=api_key,
headers={},
model=model,
messages=messages,
optional_params=optional_params,
litellm_params=litellm_params,
)
if model.startswith(("http://", "https://")):
completion_url = model
elif api_base:
completion_url = api_base
else:
raise OobaboogaError(
status_code=404,
message="API Base not set. Set one via completion(..,api_base='your-api-url')",
)
model = model
completion_url = completion_url + "/v1/chat/completions"
data: Final = oobabooga_config.transform_request(
model=model,
messages=messages,
optional_params=optional_params,
litellm_params=litellm_params,
headers=headers,
)
## LOGGING
logging_obj.pre_call(
input=messages,
api_key=api_key,View on GitHub (pinned to 77b7c6c40c)