vllm

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const Provider = "vLLM"

Variables

View Source
var EmbedModel_qwen_3_4b = embed.Model{
	Provider:         Provider,
	Name:             "Qwen/Qwen3-Embedding-4B",
	InputMaxTokens:   32_768,
	OutputDimensions: 2560,
}
View Source
var EmbedModel_qwen_3_8b = embed.Model{
	Provider:         Provider,
	Name:             "Qwen/Qwen3-Embedding-8B",
	InputMaxTokens:   32_768,
	OutputDimensions: 4096,
}
View Source
var GenModel_gpt_oss_20b = gen.Model{
	Provider: Provider,
	Name:     "openai/gpt-oss-20b",
}

Functions

This section is empty.

Types

type DataType

type DataType string
const (
	Object  DataType = "object"
	Number  DataType = "number"
	Integer DataType = "integer"
	String  DataType = "string"
	Array   DataType = "array"
	Null    DataType = "null"
	Boolean DataType = "boolean"
)

type ImageUrl

type ImageUrl struct {
	Url string `json:"url"` /// data:image/jpeg;base64,......
	// contains filtered or unexported fields
}

func (ImageUrl) MarshalJSON

func (i ImageUrl) MarshalJSON() ([]byte, error)

type JSONSchema

type JSONSchema struct {
	Ref  string                 `json:"$ref,omitempty"`  // #/$defs/... etc, overrides everything else
	Defs map[string]*JSONSchema `json:"$defs,omitempty"` // for $ref
	// Type specifies the data type of the schema. VLLM uses []string{Type, Null} to represent nullable types.
	Type any `json:"type,omitempty"`
	// Description is the description of the schema.
	Description string `json:"description,omitempty"`
	// Enum is used to restrict a value to a fixed set of values. It must be an array with at least
	// one element, where each element is unique. You will probably only use this with strings.
	Enum    []any  `json:"enum,omitempty"`
	Pattern string `json:"pattern,omitempty"` // Regular expression that the string must match.
	Format  string `json:"format,omitempty"`  // Format of the data, e.g. "email", "date-time", etc.
	// Properties describes the properties of an object, if the schema type is Object.
	Properties *map[string]JSONSchema `json:"properties,omitempty"`
	// Required specifies which properties are required, if the schema type is Object.
	Required []string `json:"required,omitempty"`
	// Items specifies which data type an array contains, if the schema type is Array.
	Items *JSONSchema `json:"items,omitempty"`
	// AdditionalProperties is used to control the handling of properties in an object
	// that are not explicitly defined in the properties section of the schema. example:
	// additionalProperties: true
	// additionalProperties: false
	// additionalProperties: jsonschema.JSONSchema{Type: jsonschema.String}
	AdditionalProperties any `json:"additionalProperties,omitempty"`

	MinLength int     `json:"minLength,omitempty"` // Minimum length of the string.
	MaxLength int     `json:"maxLength,omitempty"` // Maximum length of the string.
	Minimum   float64 `json:"minimum,omitempty"`   // Minimum value of the integer and number types.
	Maximum   float64 `json:"maximum,omitempty"`   // Minimum value of the integer and number types.
	MinItems  int     `json:"minItems,omitempty"`  // Minimum number of items in an array.
	MaxItems  int     `json:"maxItems,omitempty"`  // Maximum number of items in an array.
}

func (JSONSchema) IsObjectRequired

func (s JSONSchema) IsObjectRequired() bool

type ReasoningEffort

type ReasoningEffort string

ReasoningEffort is a string that can be "low", "medium", or "high".

const (
	ReasoningEffortNone   ReasoningEffort = "low"
	ReasoningEffortLow    ReasoningEffort = "low"
	ReasoningEffortMedium ReasoningEffort = "medium"
	ReasoningEffortHigh   ReasoningEffort = "high"
)

type ServiceTier

type ServiceTier string
const (
	ServiceTierAuto     ServiceTier = "auto"
	ServiceTierDefault  ServiceTier = "default"
	ServiceTierFlex     ServiceTier = "flex"
	ServiceTierPriority ServiceTier = "priority"
)

type StreamOptions

type StreamOptions struct {
	IncludeUsage bool `json:"include_usage"`
}

type VLLM

type VLLM struct {
	Log *slog.Logger `json:"-"`
	// contains filtered or unexported fields
}

func New

func New(uris []string, models []string) *VLLM

func (*VLLM) Embed

func (g *VLLM) Embed(request *embed.Request) (*embed.Response, error)

func (*VLLM) EmbedDocument

func (g *VLLM) EmbedDocument(request *embed.DocumentRequest) (*embed.DocumentResponse, error)

func (*VLLM) Generator

func (g *VLLM) Generator(options ...gen.Option) *gen.Generator

func (*VLLM) Provider

func (g *VLLM) Provider() string

func (*VLLM) SetLogger

func (g *VLLM) SetLogger(logger *slog.Logger) *VLLM

Jump to

Keyboard shortcuts

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