jams

package
v0.0.0-...-3d112d2 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModelServer_HealthCheck_FullMethodName = "/jams_v1.ModelServer/HealthCheck"
	ModelServer_Predict_FullMethodName     = "/jams_v1.ModelServer/Predict"
	ModelServer_GetModels_FullMethodName   = "/jams_v1.ModelServer/GetModels"
	ModelServer_AddModel_FullMethodName    = "/jams_v1.ModelServer/AddModel"
	ModelServer_UpdateModel_FullMethodName = "/jams_v1.ModelServer/UpdateModel"
	ModelServer_DeleteModel_FullMethodName = "/jams_v1.ModelServer/DeleteModel"
)

Variables

View Source
var ModelServer_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "jams_v1.ModelServer",
	HandlerType: (*ModelServerServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "HealthCheck",
			Handler:    _ModelServer_HealthCheck_Handler,
		},
		{
			MethodName: "Predict",
			Handler:    _ModelServer_Predict_Handler,
		},
		{
			MethodName: "GetModels",
			Handler:    _ModelServer_GetModels_Handler,
		},
		{
			MethodName: "AddModel",
			Handler:    _ModelServer_AddModel_Handler,
		},
		{
			MethodName: "UpdateModel",
			Handler:    _ModelServer_UpdateModel_Handler,
		},
		{
			MethodName: "DeleteModel",
			Handler:    _ModelServer_DeleteModel_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "jams.proto",
}

ModelServer_ServiceDesc is the grpc.ServiceDesc for ModelServer service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterModelServerServer

func RegisterModelServerServer(s grpc.ServiceRegistrar, srv ModelServerServer)

Types

type AddModelRequest

type AddModelRequest struct {

	// model_name is the name of the model artefact to add.
	// The models are stored in .tar.gz format but we do not pass the format in request as it handled by the server
	// Example - framework-my_model
	// The model should be present in the model store of your choice
	ModelName string `protobuf:"bytes,1,opt,name=model_name,json=modelName,proto3" json:"model_name,omitempty"`
	// contains filtered or unexported fields
}

AddModelRequest represents a request to add a new model in-memory by fetching from the model store.

func (*AddModelRequest) Descriptor deprecated

func (*AddModelRequest) Descriptor() ([]byte, []int)

Deprecated: Use AddModelRequest.ProtoReflect.Descriptor instead.

func (*AddModelRequest) GetModelName

func (x *AddModelRequest) GetModelName() string

func (*AddModelRequest) ProtoMessage

func (*AddModelRequest) ProtoMessage()

func (*AddModelRequest) ProtoReflect

func (x *AddModelRequest) ProtoReflect() protoreflect.Message

func (*AddModelRequest) Reset

func (x *AddModelRequest) Reset()

func (*AddModelRequest) String

func (x *AddModelRequest) String() string

type DeleteModelRequest

type DeleteModelRequest struct {

	// model_name is the name of the model to be deleted.
	ModelName string `protobuf:"bytes,1,opt,name=model_name,json=modelName,proto3" json:"model_name,omitempty"`
	// contains filtered or unexported fields
}

DeleteModelRequest represents a request to delete a model.

func (*DeleteModelRequest) Descriptor deprecated

func (*DeleteModelRequest) Descriptor() ([]byte, []int)

Deprecated: Use DeleteModelRequest.ProtoReflect.Descriptor instead.

func (*DeleteModelRequest) GetModelName

func (x *DeleteModelRequest) GetModelName() string

func (*DeleteModelRequest) ProtoMessage

func (*DeleteModelRequest) ProtoMessage()

func (*DeleteModelRequest) ProtoReflect

func (x *DeleteModelRequest) ProtoReflect() protoreflect.Message

func (*DeleteModelRequest) Reset

func (x *DeleteModelRequest) Reset()

func (*DeleteModelRequest) String

func (x *DeleteModelRequest) String() string

type GetModelsResponse

type GetModelsResponse struct {

	// total is the total number of models loaded into model server.
	Total int32 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"`
	// models represent the list of models which are currently loaded in the server.
	Models []*GetModelsResponse_Model `protobuf:"bytes,2,rep,name=models,proto3" json:"models,omitempty"`
	// contains filtered or unexported fields
}

GetModelsResponse represents the response for getting models from the server.

func (*GetModelsResponse) Descriptor deprecated

func (*GetModelsResponse) Descriptor() ([]byte, []int)

Deprecated: Use GetModelsResponse.ProtoReflect.Descriptor instead.

func (*GetModelsResponse) GetModels

func (x *GetModelsResponse) GetModels() []*GetModelsResponse_Model

func (*GetModelsResponse) GetTotal

func (x *GetModelsResponse) GetTotal() int32

func (*GetModelsResponse) ProtoMessage

func (*GetModelsResponse) ProtoMessage()

func (*GetModelsResponse) ProtoReflect

func (x *GetModelsResponse) ProtoReflect() protoreflect.Message

func (*GetModelsResponse) Reset

func (x *GetModelsResponse) Reset()

func (*GetModelsResponse) String

func (x *GetModelsResponse) String() string

type GetModelsResponse_Model

type GetModelsResponse_Model struct {

	// name of the model.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// framework represents the framework used by the model. https://github.com/gagansingh894/jams-rs/blob/main/jams-core/src/model/frameworks.rs
	Framework string `protobuf:"bytes,2,opt,name=framework,proto3" json:"framework,omitempty"`
	// path is the location of the model from where it was loaded into memory.
	Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"`
	// last_updated is the timestamp(RFC 3339) when the model was last updated.
	LastUpdated string `protobuf:"bytes,4,opt,name=last_updated,json=lastUpdated,proto3" json:"last_updated,omitempty"`
	// contains filtered or unexported fields
}

Nested message representing a single model.

func (*GetModelsResponse_Model) Descriptor deprecated

func (*GetModelsResponse_Model) Descriptor() ([]byte, []int)

Deprecated: Use GetModelsResponse_Model.ProtoReflect.Descriptor instead.

func (*GetModelsResponse_Model) GetFramework

func (x *GetModelsResponse_Model) GetFramework() string

func (*GetModelsResponse_Model) GetLastUpdated

func (x *GetModelsResponse_Model) GetLastUpdated() string

func (*GetModelsResponse_Model) GetName

func (x *GetModelsResponse_Model) GetName() string

func (*GetModelsResponse_Model) GetPath

func (x *GetModelsResponse_Model) GetPath() string

func (*GetModelsResponse_Model) ProtoMessage

func (*GetModelsResponse_Model) ProtoMessage()

func (*GetModelsResponse_Model) ProtoReflect

func (x *GetModelsResponse_Model) ProtoReflect() protoreflect.Message

func (*GetModelsResponse_Model) Reset

func (x *GetModelsResponse_Model) Reset()

func (*GetModelsResponse_Model) String

func (x *GetModelsResponse_Model) String() string

type ModelServerClient

type ModelServerClient interface {
	// HealthCheck is used to check the server health
	HealthCheck(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// Predict is used to make predictions based on provided input.
	Predict(ctx context.Context, in *PredictRequest, opts ...grpc.CallOption) (*PredictResponse, error)
	// GetModels is used to get the list of models which are loaded into memory.
	GetModels(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetModelsResponse, error)
	// AddModel adds a new model to the model server.
	AddModel(ctx context.Context, in *AddModelRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// UpdateModel updates an existing model in the model server.
	UpdateModel(ctx context.Context, in *UpdateModelRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// DeleteModel deletes an existing model from the server.
	DeleteModel(ctx context.Context, in *DeleteModelRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

ModelServerClient is the client API for ModelServer service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

Service definition for model server.

type ModelServerServer

type ModelServerServer interface {
	// HealthCheck is used to check the server health
	HealthCheck(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
	// Predict is used to make predictions based on provided input.
	Predict(context.Context, *PredictRequest) (*PredictResponse, error)
	// GetModels is used to get the list of models which are loaded into memory.
	GetModels(context.Context, *emptypb.Empty) (*GetModelsResponse, error)
	// AddModel adds a new model to the model server.
	AddModel(context.Context, *AddModelRequest) (*emptypb.Empty, error)
	// UpdateModel updates an existing model in the model server.
	UpdateModel(context.Context, *UpdateModelRequest) (*emptypb.Empty, error)
	// DeleteModel deletes an existing model from the server.
	DeleteModel(context.Context, *DeleteModelRequest) (*emptypb.Empty, error)
	// contains filtered or unexported methods
}

ModelServerServer is the server API for ModelServer service. All implementations must embed UnimplementedModelServerServer for forward compatibility

Service definition for model server.

type PredictRequest

type PredictRequest struct {

	// model_name is the model to use for making predictions
	ModelName string `protobuf:"bytes,1,opt,name=model_name,json=modelName,proto3" json:"model_name,omitempty"`
	// input represents the model input in JSON string where key is the feature name
	// and value is a list of int/float/string
	//
	//	{
	//	    "model_name": "example_model",
	//	    "input": "{\"key1\": \["value1]\", \"key2\": \["value2]\"}"
	//	}
	Input string `protobuf:"bytes,2,opt,name=input,proto3" json:"input,omitempty"`
	// contains filtered or unexported fields
}

PredictRequest represent request for prediction.

func (*PredictRequest) Descriptor deprecated

func (*PredictRequest) Descriptor() ([]byte, []int)

Deprecated: Use PredictRequest.ProtoReflect.Descriptor instead.

func (*PredictRequest) GetInput

func (x *PredictRequest) GetInput() string

func (*PredictRequest) GetModelName

func (x *PredictRequest) GetModelName() string

func (*PredictRequest) ProtoMessage

func (*PredictRequest) ProtoMessage()

func (*PredictRequest) ProtoReflect

func (x *PredictRequest) ProtoReflect() protoreflect.Message

func (*PredictRequest) Reset

func (x *PredictRequest) Reset()

func (*PredictRequest) String

func (x *PredictRequest) String() string

type PredictResponse

type PredictResponse struct {

	// output is json like string with key as `predictions` and value as nested lists with either single element
	// in case of regression output or multiple in case of classification
	// # Example 1 - Single Output
	//
	//	{
	//	    "output": "{\"result_key\": \"[[result_value]]\"}"
	//	}
	//
	// # Example 2 - MultiClass Output
	//
	//	{
	//	    "output": "{\"result_key\": \"[[result_value_1, result_value_3, result_value_2]]\"}"
	//	}
	Output string `protobuf:"bytes,1,opt,name=output,proto3" json:"output,omitempty"`
	// contains filtered or unexported fields
}

PredictResponse represents the prediction output from the model.

func (*PredictResponse) Descriptor deprecated

func (*PredictResponse) Descriptor() ([]byte, []int)

Deprecated: Use PredictResponse.ProtoReflect.Descriptor instead.

func (*PredictResponse) GetOutput

func (x *PredictResponse) GetOutput() string

func (*PredictResponse) ProtoMessage

func (*PredictResponse) ProtoMessage()

func (*PredictResponse) ProtoReflect

func (x *PredictResponse) ProtoReflect() protoreflect.Message

func (*PredictResponse) Reset

func (x *PredictResponse) Reset()

func (*PredictResponse) String

func (x *PredictResponse) String() string

type UnimplementedModelServerServer

type UnimplementedModelServerServer struct {
}

UnimplementedModelServerServer must be embedded to have forward compatible implementations.

func (UnimplementedModelServerServer) AddModel

func (UnimplementedModelServerServer) DeleteModel

func (UnimplementedModelServerServer) GetModels

func (UnimplementedModelServerServer) HealthCheck

func (UnimplementedModelServerServer) Predict

func (UnimplementedModelServerServer) UpdateModel

type UnsafeModelServerServer

type UnsafeModelServerServer interface {
	// contains filtered or unexported methods
}

UnsafeModelServerServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ModelServerServer will result in compilation errors.

type UpdateModelRequest

type UpdateModelRequest struct {

	// model_name is the name of the model to be updated.
	ModelName string `protobuf:"bytes,1,opt,name=model_name,json=modelName,proto3" json:"model_name,omitempty"`
	// contains filtered or unexported fields
}

UpdateModelRequest represents a request to update a model.

func (*UpdateModelRequest) Descriptor deprecated

func (*UpdateModelRequest) Descriptor() ([]byte, []int)

Deprecated: Use UpdateModelRequest.ProtoReflect.Descriptor instead.

func (*UpdateModelRequest) GetModelName

func (x *UpdateModelRequest) GetModelName() string

func (*UpdateModelRequest) ProtoMessage

func (*UpdateModelRequest) ProtoMessage()

func (*UpdateModelRequest) ProtoReflect

func (x *UpdateModelRequest) ProtoReflect() protoreflect.Message

func (*UpdateModelRequest) Reset

func (x *UpdateModelRequest) Reset()

func (*UpdateModelRequest) String

func (x *UpdateModelRequest) String() string

Jump to

Keyboard shortcuts

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