runtime

package
v0.254.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const RuntimeNameOllama = "ollama"

RuntimeNameOllama is the name of the Ollama runtime.

View Source
const RuntimeNameVLLM = "vllm"

RuntimeNameVLLM is the name of the VLLM runtime.

Variables

This section is empty.

Functions

func ModelDir added in v0.251.0

func ModelDir() string

ModelDir returns the directory where models are stored.

Types

type Client

type Client interface {
	GetAddress(name string) string
	DeployRuntime(ctx context.Context, modelID string) error
}

Client is the interface for managing runtimes.

func NewOllamaClient

func NewOllamaClient(
	k8sClient client.Client,
	namespace string,
	rconfig config.RuntimeConfig,
	oconfig config.OllamaConfig,
) Client

NewOllamaClient creates a new Ollama runtime client.

func NewVLLMClient added in v0.249.0

func NewVLLMClient(
	k8sClient client.Client,
	namespace string,
	rconfig config.RuntimeConfig,
	vconfig config.VLLMConfig,
	modelContextLengths map[string]int,
) Client

NewVLLMClient creates a new VLLM runtime client.

type Manager

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

Manager manages runtimes.

func NewManager

func NewManager(k8sClient client.Client, rtClient Client) *Manager

NewManager creates a new runtime manager.

func (*Manager) GetLLMAddress

func (m *Manager) GetLLMAddress(modelID string) (string, error)

GetLLMAddress returns the address of the LLM.

func (*Manager) Initialize

func (m *Manager) Initialize(ctx context.Context, apiReader client.Reader, namespace string) error

Initialize initializes ready and pending runtimes. This function is not thread-safe.

func (*Manager) ListInProgressModels

func (m *Manager) ListInProgressModels() []string

ListInProgressModels returns the list of models that are in progress.

func (*Manager) ListSyncedModelIDs

func (m *Manager) ListSyncedModelIDs(ctx context.Context) []string

ListSyncedModelIDs returns the list of models that are synced.

func (*Manager) PullModel

func (m *Manager) PullModel(ctx context.Context, modelID string) error

PullModel pulls the model from the model manager.

func (*Manager) Reconcile

func (m *Manager) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile reconciles the runtime.

func (*Manager) SetupWithManager

func (m *Manager) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the runtime manager with the given controller manager.

Jump to

Keyboard shortcuts

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