processor

package
v0.293.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddressGetter added in v0.240.0

type AddressGetter interface {
	GetLLMAddress(modelID string) (string, error)
}

AddressGetter gets an address of a model.

type FakeModelSyncer added in v0.143.0

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

FakeModelSyncer is a fake implementation of model syncer.

func NewFakeModelSyncer added in v0.143.0

func NewFakeModelSyncer() *FakeModelSyncer

NewFakeModelSyncer returns a FakeModelSyncer.

func (*FakeModelSyncer) ListInProgressModels added in v0.219.0

func (s *FakeModelSyncer) ListInProgressModels() []string

ListInProgressModels lists all models that are in progress.

func (*FakeModelSyncer) ListSyncedModelIDs added in v0.143.0

func (s *FakeModelSyncer) ListSyncedModelIDs(ctx context.Context) []string

ListSyncedModelIDs lists all models that have been synced.

func (*FakeModelSyncer) PullModel added in v0.143.0

func (s *FakeModelSyncer) PullModel(ctx context.Context, modelID string) error

PullModel downloads and registers a model from model manager.

type FixedAddressGetter added in v0.240.0

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

FixedAddressGetter is a fixed address getter.

func NewFixedAddressGetter added in v0.240.0

func NewFixedAddressGetter(addr string) *FixedAddressGetter

NewFixedAddressGetter returns a new FixedAddressGetter.

func (*FixedAddressGetter) GetLLMAddress added in v0.240.0

func (g *FixedAddressGetter) GetLLMAddress(modelID string) (string, error)

GetLLMAddress returns a fixed address.

type ModelSyncer added in v0.143.0

type ModelSyncer interface {
	ListSyncedModelIDs(ctx context.Context) []string
	PullModel(ctx context.Context, modelID string) error
	ListInProgressModels() []string
}

ModelSyncer syncs models.

type P

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

P processes tasks.

func NewP

func NewP(
	engineID string,
	client v1.InferenceWorkerServiceClient,
	addrGetter AddressGetter,
	llmKind llmkind.K,
	modelSyncer ModelSyncer,
	logger logr.Logger,
	metricsClient *metrics.Client,
) *P

NewP returns a new processor.

func (*P) IsReady added in v0.212.0

func (p *P) IsReady() (bool, string)

IsReady returns true if the processor is ready. If not, it returns a message describing why it is not ready.

func (*P) Run

func (p *P) Run(ctx context.Context) error

Run runs the processor.

TODO(kenji): Gracefully handle an error from the server.

Jump to

Keyboard shortcuts

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