{"record":{"id":"cbe7e6abb9f7521c","repo":"BerriAI/litellm","slug":"non-blocking-litellm-success-call-error-e","errorCode":null,"errorMessage":"[Non-Blocking] LiteLLM.Success_Call Error: {e}","messagePattern":"\\[Non-Blocking\\] LiteLLM\\.Success_Call Error: (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"litellm/litellm_core_utils/litellm_logging.py","lineNumber":1969,"sourceCode":"                litellm.max_budget\n                and self.stream is False\n                and result is not None\n                and isinstance(result, dict)\n                and \"content\" in result\n            ):\n                time_diff: Final = (end_time - start_time).total_seconds()\n                float_diff: Final = float(time_diff)\n                litellm._current_cost += litellm.completion_cost(\n                    model=self.model,\n                    prompt=\"\",\n                    completion=getattr(result, \"content\", \"\"),\n                    total_time=float_diff,\n                    standard_built_in_tools_params=self.standard_built_in_tools_params,\n                )\n\n            return start_time, end_time, result\n        except Exception as e:\n            raise Exception(f\"[Non-Blocking] LiteLLM.Success_Call Error: {e}\")\n\n    def _is_recognized_call_type_for_logging(\n        self,\n        logging_result: object,\n    ):\n        \"\"\"\n        Returns True if the call type is recognized for logging (eg. ModelResponse, ModelResponseStream, etc.)\n        \"\"\"\n        if (\n            isinstance(logging_result, ModelResponse)\n            or isinstance(logging_result, ModelResponseStream)\n            or isinstance(logging_result, EmbeddingResponse)\n            or isinstance(logging_result, ImageResponse)\n            or isinstance(logging_result, TranscriptionResponse)\n            or isinstance(logging_result, TextCompletionResponse)\n            or isinstance(logging_result, HttpxBinaryResponseContent)  # tts\n            or isinstance(logging_result, RerankResponse)\n            or isinstance(logging_result, FineTuningJob)","sourceCodeStart":1951,"sourceCodeEnd":1987,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/litellm_core_utils/litellm_logging.py#L1951-L1987","documentation":"LiteLLM's post-success logging path (_track succeeded-call metrics such as completion_cost) hit an unexpected internal exception (e.g. a cost-calculation failure from an unmapped model) and re-wraps it as '[Non-Blocking] LiteLLM.Success_Call Error'. Despite the 'Non-Blocking' label, this re-raise propagates out of the logging helper and can surface to the caller, masking the original exception text after the prefix.","triggerScenarios":"A completion/embedding succeeds, then during success logging litellm.completion_cost(...) raises — typically because the model has no cost mapping (model not in model_prices_and_context_window.json and no custom pricing) or standard_built_in_tools_params are malformed.","commonSituations":"Custom/private model names without cost entries; newly released models on an older LiteLLM; a misconfigured custom_pricing file; the exception chained after the prefix contains the real cause (often 'cost mapping not found').","solutions":["Read the text after '[Non-Blocking] LiteLLM.Success_Call Error:' — it contains the underlying exception; fix that root cause (usually add pricing)","Add cost info for your model via a custom model_prices file passed as litellm.model_cost_dict_url / lilypad model_prices, or set model_info cost fields in config.yaml","Upgrade LiteLLM so bundled model_prices_and_context_window.json covers your model","As a workaround suppress cost tracking for that call: litellm.completion(..., mock_response=...) style tests aside, drop_success_events=True or disable cost logging callbacks for the unknown model"],"exampleFix":"# before\nresp = litellm.completion(model='my-private-model', messages=msgs)\n# -> Exception: [Non-Blocking] LiteLLM.Success_Call Error: cost mapping not found for model\n\n# after: supply pricing in config.yaml\nmodel_list:\n  - model_name: \"my-private-model\"\n    litellm_params:\n      model: \"openai/gpt-4o\"\n    model_info:\n      input_cost_per_token: 0.0000025\n      output_cost_per_token: 0.00001","handlingStrategy":"try-catch","validationCode":"import litellm\n\ndef has_cost_mapping(model: str) -> bool:\n    try:\n        litellm.completion_cost(model=model, prompt='x', completion='y')\n        return True\n    except Exception:\n        return False","typeGuard":null,"tryCatchPattern":"try:\n    resp = litellm.completion(model='my-private-model', messages=msgs)\nexcept Exception as e:\n    if str(e).startswith('[Non-Blocking] LiteLLM.Success_Call Error'):\n        # request actually succeeded; the wrapper hides the real cause in str(e)\n        logging.warning('success-logging failed: %s', e)\n    else:\n        raise","preventionTips":["Register pricing (model_info input/output cost) for every custom model before enabling spend tracking","Test one real call per model in CI to surface cost-mapping gaps early","When this error appears, read the suffix after the prefix — it names the real failing operation"],"tags":["litellm","logging","cost-calculation","success-handler","pricing"],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}