{"record":{"id":"9b92f0b0d57f6bf0","repo":"BerriAI/litellm","slug":"completion-response-error-9b92f0","errorCode":null,"errorMessage":"completion_response[\"error\"]","messagePattern":"completion_response\\[\"error\"\\]","errorType":"exception","errorClass":"OobaboogaError","httpStatus":null,"severity":"error","filePath":"litellm/llms/oobabooga/chat/oobabooga.py","lineNumber":133,"sourceCode":"    # Logging before API call\n    if logging_obj:\n        logging_obj.pre_call(input=input, api_key=api_key, additional_args={\"complete_input_dict\": data})\n\n    # Send POST request\n    headers: Final = oobabooga_config.validate_environment(\n        api_key=api_key,\n        headers={},\n        model=model,\n        messages=[],\n        optional_params=optional_params,\n        litellm_params={},\n    )\n    response: Final = litellm.module_level_client.post(embeddings_url, headers=headers, json=data)\n    completion_response: Final = response.json()\n\n    # Check for errors in response\n    if \"error\" in completion_response:\n        raise OobaboogaError(\n            message=completion_response[\"error\"],\n            status_code=completion_response.get(\"status_code\", 500),\n        )\n\n    # Process response data\n    model_response.data = [\n        {\n            \"embedding\": completion_response[\"data\"][0][\"embedding\"],\n            \"index\": 0,\n            \"object\": \"embedding\",\n        }\n    ]\n\n    num_tokens: Final = len(completion_response[\"data\"][0][\"embedding\"])\n    # Adding metadata to response\n    setattr(\n        model_response,\n        \"usage\",","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/llms/oobabooga/chat/oobabooga.py#L115-L151","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    resp = litellm.embedding(model=\"oobabooga/m\", input=texts, api_base=base)\nexcept Exception as e:\n    code = getattr(e, \"status_code\", 500)\n    if code >= 500:\n        retry_with_backoff()\n    else:\n        raise  # error text came from the webui; fix server-side","preventionTips":["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"],"tags":["oobabooga","embedding","upstream-error"],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}