vllm

package
v0.0.0-...-243f1f3 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateEmbeddingRequest

type CreateEmbeddingRequest struct {
	Input          []string `json:"input"`
	Model          string   `json:"model"`
	Dimensions     uint     `json:"dimensions,omitempty"`
	EncodingFormat string   `json:"encoding_format"`
}

func (*CreateEmbeddingRequest) JSON

func (c *CreateEmbeddingRequest) JSON() (string, error)

type CreateEmbeddingResponse

type CreateEmbeddingResponse struct {
	Embeddings [][]float32 `json:"embeddings"`
}

type Option

type Option func(client *VLLMClient) error

func WithAPIKey

func WithAPIKey(apiKey string) Option

func WithBaseURL

func WithBaseURL(baseURL string) Option

func WithDimensions

func WithDimensions(dimensions int) Option

func WithEnvAPIKey

func WithEnvAPIKey(apiKey string) Option

func WithModel

func WithModel(model string) Option

type VLLMClient

type VLLMClient struct {
	BaseURL    string
	APIKey     string
	Model      string
	Client     *http.Client
	Dimensions uint
}

func NewVLLMClient

func NewVLLMClient(apiKey string, model string) *VLLMClient

func NewVLLMClientFromOptions

func NewVLLMClientFromOptions(opts ...Option) (*VLLMClient, error)

func (*VLLMClient) CreateEmbedding

type VLLMEmbedding

type VLLMEmbedding struct {
	Index     uint      `json:"index"`
	Object    string    `json:"object"`
	Embedding []float32 `json:"embedding"`
}

type VLLMEmbeddingFunction

type VLLMEmbeddingFunction struct {
	// contains filtered or unexported fields
}

func NewVLLMEmbeddingFunction

func NewVLLMEmbeddingFunction(apiKey string, model string) *VLLMEmbeddingFunction

func NewVLLMEmbeddingFunctionFromOptions

func NewVLLMEmbeddingFunctionFromOptions(options ...Option) (*VLLMEmbeddingFunction, error)

func (*VLLMEmbeddingFunction) EmbedDocuments

func (ef *VLLMEmbeddingFunction) EmbedDocuments(ctx context.Context, documents []string) ([]embeddings.Embedding, error)

func (*VLLMEmbeddingFunction) EmbedQuery

func (ef *VLLMEmbeddingFunction) EmbedQuery(ctx context.Context, query string) (embeddings.Embedding, error)

type VLLMEmbeddingResponse

type VLLMEmbeddingResponse struct {
	Id      string          `json:"id"`
	Object  string          `json:"object"`
	Created uint            `json:"created"`
	Model   string          `json:"model"`
	Data    []VLLMEmbedding `json:"data"`
}

Jump to

Keyboard shortcuts

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