MCPcopy Index your code
hub / github.com/abetlen/llama-cpp-python / fail_request

Method fail_request

examples/server/server.py:14998–15009  ·  view source on GitHub ↗
(self, request: CompletionRequest, exc: BaseException)

Source from the content-addressed store, hash-verified

14996 pass
14997
14998 def fail_request(self, request: CompletionRequest, exc: BaseException) -> None:
14999 self.remove_pending_request(request)
15000 if request.id in self.active_request_ids or request.admitted:
15001 self.release_request(request)
15002 else:
15003 self.requests.pop(request.id, None)
15004 if isinstance(exc, CompletionRequestCancelledError):
15005 self.metrics.requests_cancelled_total += 1
15006 else:
15007 self.metrics.requests_failed_total += 1
15008 if request.on_error is not None:
15009 request.on_error(exc)
15010
15011 @staticmethod
15012 def _format_prometheus_value(value: Union[int, float]) -> str:

Callers 3

stepMethod · 0.95
admit_waitingMethod · 0.95
finalize_cancelledMethod · 0.95

Calls 3

release_requestMethod · 0.95
on_errorMethod · 0.80

Tested by

no test coverage detected