Skip to content

vllm.entrypoints.generate.label_reads

Reads that return the logprobs of chosen label tokens at chosen positions.

Classes:

Functions:

LabelRead dataclass

Attributes:

  • logprobs (list[float]) –

    Full-vocabulary logprob of each label token, in logprob_token_ids

logprobs instance-attribute

Full-vocabulary logprob of each label token, in logprob_token_ids order, or slot after slot with slots.

next_token_label_reads(engine_client, engine_inputs, sampling_params, request_id, *, lora_request=None, trace_headers=None, priority=0, slots=None) async

Runs one read per input at once, as request {request_id}-{i}. Each read's params set max_tokens=1 and the label tokens as logprob_token_ids. With slots, read i takes the logprobs of each (position, label ids) in slots[i] instead. Raises GenerationError naming the item when a read has no output or lacks a label's logprob.