BerriAI/litellm · error · OobaboogaError
completion_response["error"]
Error message
completion_response["error"]
What it means
After POSTing to the oobabooga embeddings endpoint, the handler parses the JSON and checks for an 'error' key. If present, it raises OobaboogaError with that error's text and the status code from the response (default 500). This is a pass-through of an upstream error body.
Source
Thrown at litellm/llms/oobabooga/chat/oobabooga.py:133
# Logging before API call
if logging_obj:
logging_obj.pre_call(input=input, api_key=api_key, additional_args={"complete_input_dict": data})
# Send POST request
headers: Final = oobabooga_config.validate_environment(
api_key=api_key,
headers={},
model=model,
messages=[],
optional_params=optional_params,
litellm_params={},
)
response: Final = litellm.module_level_client.post(embeddings_url, headers=headers, json=data)
completion_response: Final = response.json()
# Check for errors in response
if "error" in completion_response:
raise OobaboogaError(
message=completion_response["error"],
status_code=completion_response.get("status_code", 500),
)
# Process response data
model_response.data = [
{
"embedding": completion_response["data"][0]["embedding"],
"index": 0,
"object": "embedding",
}
]
num_tokens: Final = len(completion_response["data"][0]["embedding"])
# Adding metadata to response
setattr(
model_response,
"usage",View on GitHub (pinned to 6c2dcb801b)
Solutions
- Read the error message — it comes verbatim from text-generation-webui and usually names the cause.
- Load an embedding-capable model in the webui before calling embeddings (e.g. via --model or the UI).
- Confirm the response shape with curl against /v1/embeddings; if the extension is old, update text-generation-webui.
Defensive patterns
Strategy: try-catch
Try / catch
try:
resp = litellm.embedding(model="oobabooga/m", input=texts, api_base=base)
except Exception as e:
code = getattr(e, "status_code", 500)
if code >= 500:
retry_with_backoff()
else:
raise # error text came from the webui; fix server-side Prevention
- Load an embedding-capable model before serving embeddings
- Check /v1/embeddings with curl after webui updates
- Surface the webui's error text to logs verbatim
When it happens
Trigger: text-generation-webui returns {"error": "..."} from /v1/embeddings — e.g. embeddings not supported for the loaded model, no model loaded, or an internal server error. Note the code then reads data[0].embedding, so even successful unusual shapes can fail nearby.
Common situations: Using a generative model without an embedding equivalent loaded, the server's OpenAI extension version differing from what LiteLLM expects, or the webui returning an error page body parsed as JSON.
Related errors
- raw_response.text
- completion_response["error"]
- Failed to generate embedding: {e}
- Valkey semantic-cache index '{self.index_name}' already exis
- data_json.get("error")
AI-assisted analysis of BerriAI/litellm@6c2dcb801b (2026-08-15).
Data as JSON: /api/errors/9b92f0b0d57f6bf0.
Report an issue: GitHub.