Skip to content

vllm.connections

Classes:

Attributes:

global_http_connection = HTTPConnection() module-attribute

The global HTTPConnection instance used by vLLM.

HTTPConnection

Helper class to send HTTP requests.

HTTPResponseSizeExceededError

Bases: VLLMValidationError

Raised when an HTTP response exceeds a caller-supplied byte ceiling.

MediaDownloadSizeExceededError

Bases: ValueError

Raised when a remote media download exceeds the configured byte limit.

MediaFetchDeadlineExceededError

Bases: ValueError

Raised when a synchronous media download exceeds its total time limit.

MediaRequestDownloadBudget

Thread-safe total of HTTP media bytes received for one request.

MediaRequestDownloadSizeExceededError

Bases: ValueError

Raised when all HTTP media downloads in one request exceed the limit.

_BodyReadSocket

Apply the deadline to I/O below HTTP buffering and content decoding.

_async_retry(fn)

Add retry logic with exponential backoff to an async method.

The decorated method must accept timeout as a keyword argument. The decorator replaces it with a per-attempt timeout that grows by _RETRY_BACKOFF_FACTOR on each retry so transient slowness on busy hosts is absorbed.

_is_retryable(exc)

Return True for transient errors that are worth retrying.

Retryable
  • Timeouts (aiohttp, requests, stdlib)
  • Connection-level failures (refused, reset, DNS)
  • Response-body transfer failures (incomplete or malformed payloads)
  • Server errors (5xx) -- includes S3 503 SlowDown

Not retryable: - Client errors (4xx) -- bad URL, auth, not-found - Programming errors (ValueError, TypeError, ...)

_sync_retry(fn)

Add retry logic with exponential backoff to a sync method.

The decorated method must accept timeout as a keyword argument. The decorator replaces it with a per-attempt timeout that grows by _RETRY_BACKOFF_FACTOR on each retry so transient slowness on busy hosts is absorbed.