Skip to content

vllm.entrypoints.rl.online.api_router

Functions:

abort_requests(raw_request) async

Abort in-flight requests without pausing the scheduler.

Empty/missing request_ids aborts all in-flight requests.

finish_weight_update(raw_request, weight_version=None, baseline=None) async

Finish the weight update; with a baseline, also compare the weights.

get_world_size(raw_request, include_dp=Query(True)) async

Get the world size from the parallel config.

Parameters:

  • raw_request

    (Request) –

    The incoming FastAPI request, used to reach the engine client on the app state.

  • include_dp

    (bool, default: Query(True) ) –

    If True (default), returns the world size including data parallelism (TP * PP * DP). If False, returns the world size without data parallelism (TP * PP).

is_paused(raw_request) async

Return the current pause status.

pause_generation(raw_request, mode='abort', clear_cache=True) async

Pause generation requests to allow weight updates.

In abort and wait modes new requests are rejected with HTTP 503 until /resume; keep continues to accept and queue them.

Parameters:

  • raw_request

    (Request) –

    The incoming FastAPI request, used to reach the engine client on the app state.

  • mode

    (Annotated[PauseMode, Query()], default: 'abort' ) –

    How to handle in-flight requests: - "abort": Abort all in-flight requests immediately (default). - "wait": Wait for in-flight requests to complete. - "keep": Freeze requests in queue; they resume on /resume.

  • clear_cache

    (Annotated[bool, Query()], default: True ) –

    DEPRECATED. Whether to clear KV/prefix caches after draining. With mode="keep", clear_cache=True preempts the running requests, which are recomputed on resume, and clear_cache=False leaves them in place.

resume_generation(raw_request) async

Resume generation after a pause.

weight_checker(raw_request, action, baseline=None) async

Checksum, reset, or compare model weights against a baseline.