server

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2025 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type S

type S struct {
	v1.UnimplementedModelsServiceServer
	// contains filtered or unexported fields
}

S is a server.

func New

func New(store *store.S, log logr.Logger) *S

New creates a server.

func (*S) CreateModel added in v1.10.0

func (s *S) CreateModel(
	ctx context.Context,
	req *v1.CreateModelRequest,
) (*v1.Model, error)

CreateModel creates a base model.

func (*S) DeleteModel

func (s *S) DeleteModel(
	ctx context.Context,
	req *v1.DeleteModelRequest,
) (*v1.DeleteModelResponse, error)

DeleteModel deletes a model.

func (*S) GetModel

func (s *S) GetModel(
	ctx context.Context,
	req *v1.GetModelRequest,
) (*v1.Model, error)

GetModel gets a model.

func (*S) ListModels

func (s *S) ListModels(
	ctx context.Context,
	req *v1.ListModelsRequest,
) (*v1.ListModelsResponse, error)

ListModels lists models.

func (*S) Run

func (s *S) Run(ctx context.Context, port int, authConfig config.AuthConfig, usage sender.UsageSetter) error

Run starts the gRPC server.

func (*S) Stop

func (s *S) Stop()

Stop stops the gRPC server.

type WS

type WS struct {
	v1.UnimplementedModelsWorkerServiceServer
	// contains filtered or unexported fields
}

WS is a server for worker services.

func NewWorkerServiceServer

func NewWorkerServiceServer(s *store.S, log logr.Logger) *WS

NewWorkerServiceServer creates a new worker service server.

func (*WS) AcquireUnloadedBaseModel added in v1.10.0

func (s *WS) AcquireUnloadedBaseModel(
	ctx context.Context,
	req *v1.AcquireUnloadedBaseModelRequest,
) (*v1.AcquireUnloadedBaseModelResponse, error)

AcquireUnloadedBaseModel checks if there is any unloaded base model. If exists, update the loading status to LOADED and return it.

func (*WS) AcquireUnloadedModel added in v1.14.0

func (s *WS) AcquireUnloadedModel(
	ctx context.Context,
	req *v1.AcquireUnloadedModelRequest,
) (*v1.AcquireUnloadedModelResponse, error)

AcquireUnloadedModel checks if there is any unloaded model. If exists, update the loading status to LOADED and return it.

func (*WS) CreateBaseModel

func (s *WS) CreateBaseModel(
	ctx context.Context,
	req *v1.CreateBaseModelRequest,
) (*v1.BaseModel, error)

CreateBaseModel creates a base model.

func (*WS) CreateHFModelRepo added in v1.4.0

func (s *WS) CreateHFModelRepo(
	ctx context.Context,
	req *v1.CreateHFModelRepoRequest,
) (*v1.HFModelRepo, error)

CreateHFModelRepo creates a HuggingFace model repo.

func (*WS) CreateStorageConfig

func (s *WS) CreateStorageConfig(
	ctx context.Context,
	req *v1.CreateStorageConfigRequest,
) (*v1.StorageConfig, error)

CreateStorageConfig creates a storage config.

func (*WS) GetBaseModelPath

func (s *WS) GetBaseModelPath(
	ctx context.Context,
	req *v1.GetBaseModelPathRequest,
) (*v1.GetBaseModelPathResponse, error)

GetBaseModelPath gets a model path.

func (*WS) GetHFModelRepo added in v1.4.0

func (s *WS) GetHFModelRepo(
	ctx context.Context,
	req *v1.GetHFModelRepoRequest,
) (*v1.HFModelRepo, error)

GetHFModelRepo gets a HuggingFace model repo.

func (*WS) GetModel

func (s *WS) GetModel(
	ctx context.Context,
	req *v1.GetModelRequest,
) (*v1.Model, error)

GetModel gets a model.

func (*WS) GetModelAttributes

func (s *WS) GetModelAttributes(
	ctx context.Context,
	req *v1.GetModelAttributesRequest,
) (*v1.ModelAttributes, error)

GetModelAttributes gets the model attributes.

func (*WS) GetModelPath

func (s *WS) GetModelPath(
	ctx context.Context,
	req *v1.GetModelPathRequest,
) (*v1.GetModelPathResponse, error)

GetModelPath gets a model path.

func (*WS) GetStorageConfig

func (s *WS) GetStorageConfig(
	ctx context.Context,
	req *v1.GetStorageConfigRequest,
) (*v1.StorageConfig, error)

GetStorageConfig gets a storage config.

func (*WS) PublishModel

func (s *WS) PublishModel(
	ctx context.Context,
	req *v1.PublishModelRequest,
) (*v1.PublishModelResponse, error)

PublishModel publishes a model.

func (*WS) RegisterModel

func (s *WS) RegisterModel(
	ctx context.Context,
	req *v1.RegisterModelRequest,
) (*v1.RegisterModelResponse, error)

RegisterModel registers a model.

func (*WS) Run

func (ws *WS) Run(ctx context.Context, port int, authConfig config.AuthConfig) error

Run runs the worker service server.

func (*WS) Stop

func (ws *WS) Stop()

Stop stops the worker service server.

func (*WS) UpdateBaseModelLoadingStatus added in v1.10.0

func (s *WS) UpdateBaseModelLoadingStatus(
	ctx context.Context,
	req *v1.UpdateBaseModelLoadingStatusRequest,
) (*v1.UpdateBaseModelLoadingStatusResponse, error)

UpdateBaseModelLoadingStatus updates the loading status. When the loading succeeded, it also updates the base model metadata.

func (*WS) UpdateModelLoadingStatus added in v1.14.0

func (s *WS) UpdateModelLoadingStatus(
	ctx context.Context,
	req *v1.UpdateModelLoadingStatusRequest,
) (*v1.UpdateModelLoadingStatusResponse, error)

UpdateModelLoadingStatus updates the loading status. When the loading succeeded, it also updates the model metadata.

Jump to

Keyboard shortcuts

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