vllm

package
v2.18.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2026 License: Apache-2.0 Imports: 14 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package vllm provides vLLM LLM provider integration for high-performance inference.

Package vllm provides multimodal support for vLLM provider

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider struct {
	providers.BaseProvider
	// contains filtered or unexported fields
}

Provider implements the Provider interface for vLLM

func NewProvider

func NewProvider(
	id, model, baseURL string,
	defaults providers.ProviderDefaults,
	includeRawOutput bool,
	additionalConfig map[string]any,
) *Provider

NewProvider creates a new vLLM provider

func (*Provider) BuildTooling

func (p *Provider) BuildTooling(descriptors []*providers.ToolDescriptor) (any, error)

BuildTooling converts tool descriptors to vLLM format

func (*Provider) CalculateCost

func (p *Provider) CalculateCost(tokensIn, tokensOut, cachedTokens int) types.CostInfo

CalculateCost calculates cost breakdown. Thin wrapper over costFromUsage, kept for the Provider interface's legacy signature. vLLM's wire usage has no separate cache-read count, so cachedTokens is folded out of the billed input before pricing (matching the prior behavior of excluding it from InputCostUSD); it is not reported back as a cache unit.

func (*Provider) GetMultimodalCapabilities

func (p *Provider) GetMultimodalCapabilities() providers.MultimodalCapabilities

GetMultimodalCapabilities returns the multimodal capabilities of the vLLM provider

func (*Provider) MaxContextTokens added in v2.17.0

func (p *Provider) MaxContextTokens() int

MaxContextTokens returns additional_config.context_window, or 0 (unknown), which makes the compactor use its default budget. vLLM serves arbitrary models whose usable window is set by the server's max-model-len rather than by the model name, so there is no built-in table to fall back to.

func (*Provider) Model

func (p *Provider) Model() string

Model returns the model name/identifier used by this provider.

func (*Provider) Predict

Predict sends a prediction request to vLLM

func (*Provider) PredictStream

func (p *Provider) PredictStream(
	ctx context.Context,
	req providers.PredictionRequest,
) (<-chan providers.StreamChunk, error)

PredictStream streams a prediction response from vLLM

func (*Provider) PredictStreamWithTools

func (p *Provider) PredictStreamWithTools(
	ctx context.Context,
	req providers.PredictionRequest,
	tools any,
	toolChoice string,
) (<-chan providers.StreamChunk, error)

PredictStreamWithTools performs a streaming prediction request with tool support

func (*Provider) PredictWithTools

func (p *Provider) PredictWithTools(
	ctx context.Context,
	req providers.PredictionRequest,
	tools any,
	toolChoice string,
) (providers.PredictionResponse, []types.MessageToolCall, error)

PredictWithTools performs a prediction request with tool support

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL