Skip to content

vllm.entrypoints.serve.exception_handling.handlers.validation

Functions:

_format_error(err)

Render one validation error, bounded in size.

_is_internal_loc_segment(segment)

True if segment is a Pydantic-internal wrapper/union-branch marker rather than a user-meaningful field name or list index.

_summarize_error_input(value)

A size-bounded stand-in for a validation error's input value.

Containers are described rather than rendered: repr() of a large list materializes the whole string first, which is the cost this is meant to avoid.

clean_loc_for_param(loc)

Join a Pydantic error loc tuple into a clean dotted param path, dropping internal wrapper/union-branch markers that don't correspond to a real field name an API consumer would recognize.

E.g. ('body', 'function-wrap[log_extra_fields()]', 'prompt') -> "body.prompt", not "body.function-wrap[log_extra_fields()].prompt".