Vllm.Outputs.CompletionOutput (VLLM v0.3.0)

Copy Markdown View Source

The output data of one completion output of a request.

Parameters

  • index - The index of the output in the request.
  • text - The generated output text.
  • token_ids - The token IDs of the generated output text.
  • cumulative_logprob - The cumulative log probability of the generated output text.
  • logprobs - The log probabilities of the top probability words at each position if the logprobs are requested.
  • finish_reason - The reason why the sequence is finished.
  • stop_reason - The stop string or token id that caused the completion to stop, None if the completion finished for some other reason including encountering the EOS token.
  • lora_request - The LoRA request that was used to generate the output.

Summary

Types

t()

@opaque t()

Functions

finish_reason(ref)

@spec finish_reason(SnakeBridge.Ref.t()) ::
  {:ok, term()} | {:error, Snakepit.Error.t()}

finished(ref, opts \\ [])

@spec finished(
  SnakeBridge.Ref.t(),
  keyword()
) :: {:ok, boolean()} | {:error, Snakepit.Error.t()}

Python method CompletionOutput.finished.

Returns

  • boolean()

lora_request(ref)

@spec lora_request(SnakeBridge.Ref.t()) ::
  {:ok, term()} | {:error, Snakepit.Error.t()}

new(index, text, token_ids, cumulative_logprob, logprobs, args, opts \\ [])

@spec new(integer(), String.t(), term(), term(), term(), [term()], keyword()) ::
  {:ok, SnakeBridge.Ref.t()} | {:error, Snakepit.Error.t()}

Initialize self. See help(type(self)) for accurate signature.

Parameters

  • index (integer())
  • text (String.t())
  • token_ids (term())
  • cumulative_logprob (term())
  • logprobs (term())
  • routed_experts (term() default: None)
  • finish_reason (term() default: None)
  • stop_reason (term() default: None)
  • lora_request (term() default: None)

routed_experts(ref)

@spec routed_experts(SnakeBridge.Ref.t()) ::
  {:ok, term()} | {:error, Snakepit.Error.t()}

stop_reason(ref)

@spec stop_reason(SnakeBridge.Ref.t()) :: {:ok, term()} | {:error, Snakepit.Error.t()}