starttrainedmodeldeployment

package
v8.18.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2025 License: Apache-2.0 Imports: 14 Imported by: 4

Documentation

Overview

Start a trained model deployment. It allocates the model to every machine learning node.

Index

Constants

This section is empty.

Variables

View Source
var ErrBuildPath = errors.New("cannot build path, check for missing path parameters")

ErrBuildPath is returned in case of missing parameters within the build of the request.

Functions

This section is empty.

Types

type NewStartTrainedModelDeployment

type NewStartTrainedModelDeployment func(modelid string) *StartTrainedModelDeployment

NewStartTrainedModelDeployment type alias for index.

func NewStartTrainedModelDeploymentFunc

func NewStartTrainedModelDeploymentFunc(tp elastictransport.Interface) NewStartTrainedModelDeployment

NewStartTrainedModelDeploymentFunc returns a new instance of StartTrainedModelDeployment with the provided transport. Used in the index of the library this allows to retrieve every apis in once place.

type Request added in v8.18.0

type Request struct {

	// AdaptiveAllocations Adaptive allocations configuration. When enabled, the number of allocations
	// is set based on the current load.
	// If adaptive_allocations is enabled, do not set the number of allocations
	// manually.
	AdaptiveAllocations *types.AdaptiveAllocationsSettings `json:"adaptive_allocations,omitempty"`
}

Request holds the request body struct for the package starttrainedmodeldeployment

https://github.com/elastic/elasticsearch-specification/blob/f6a370d0fba975752c644fc730f7c45610e28f36/specification/ml/start_trained_model_deployment/MlStartTrainedModelDeploymentRequest.ts#L30-L111

func NewRequest added in v8.18.0

func NewRequest() *Request

NewRequest returns a Request

func (*Request) FromJSON added in v8.18.0

func (r *Request) FromJSON(data string) (*Request, error)

FromJSON allows to load an arbitrary json into the request structure

type Response added in v8.7.0

type Response struct {
	Assignment types.TrainedModelAssignment `json:"assignment"`
}

Response holds the response body struct for the package starttrainedmodeldeployment

https://github.com/elastic/elasticsearch-specification/blob/f6a370d0fba975752c644fc730f7c45610e28f36/specification/ml/start_trained_model_deployment/MlStartTrainedModelDeploymentResponse.ts#L22-L26

func NewResponse added in v8.7.0

func NewResponse() *Response

NewResponse returns a Response

type StartTrainedModelDeployment

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

func New

Start a trained model deployment. It allocates the model to every machine learning node.

https://www.elastic.co/guide/en/elasticsearch/reference/current/start-trained-model-deployment.html

func (*StartTrainedModelDeployment) AdaptiveAllocations added in v8.18.0

Adaptive allocations configuration. When enabled, the number of allocations is set based on the current load. If adaptive_allocations is enabled, do not set the number of allocations manually. API name: adaptive_allocations

func (*StartTrainedModelDeployment) CacheSize

CacheSize The inference cache size (in memory outside the JVM heap) per node for the model. The default value is the same size as the `model_size_bytes`. To disable the cache, `0b` can be provided. API name: cache_size

func (*StartTrainedModelDeployment) DeploymentId added in v8.11.1

func (r *StartTrainedModelDeployment) DeploymentId(deploymentid string) *StartTrainedModelDeployment

DeploymentId A unique identifier for the deployment of the model. API name: deployment_id

func (StartTrainedModelDeployment) Do

Do runs the request through the transport, handle the response and returns a starttrainedmodeldeployment.Response

func (*StartTrainedModelDeployment) ErrorTrace added in v8.14.0

ErrorTrace When set to `true` Elasticsearch will include the full stack trace of errors when they occur. API name: error_trace

func (*StartTrainedModelDeployment) FilterPath added in v8.14.0

func (r *StartTrainedModelDeployment) FilterPath(filterpaths ...string) *StartTrainedModelDeployment

FilterPath Comma-separated list of filters in dot notation which reduce the response returned by Elasticsearch. API name: filter_path

func (*StartTrainedModelDeployment) Header

Header set a key, value pair in the StartTrainedModelDeployment headers map.

func (*StartTrainedModelDeployment) HttpRequest

func (r *StartTrainedModelDeployment) HttpRequest(ctx context.Context) (*http.Request, error)

HttpRequest returns the http.Request object built from the given parameters.

func (*StartTrainedModelDeployment) Human added in v8.14.0

Human When set to `true` will return statistics in a format suitable for humans. For example `"exists_time": "1h"` for humans and `"eixsts_time_in_millis": 3600000` for computers. When disabled the human readable values will be omitted. This makes sense for responses being consumed only by machines. API name: human

func (*StartTrainedModelDeployment) NumberOfAllocations

func (r *StartTrainedModelDeployment) NumberOfAllocations(numberofallocations int) *StartTrainedModelDeployment

NumberOfAllocations The number of model allocations on each node where the model is deployed. All allocations on a node share the same copy of the model in memory but use a separate set of threads to evaluate the model. Increasing this value generally increases the throughput. If this setting is greater than the number of hardware threads it will automatically be changed to a value less than the number of hardware threads. If adaptive_allocations is enabled, do not set this value, because it’s automatically set. API name: number_of_allocations

func (StartTrainedModelDeployment) Perform added in v8.7.0

func (r StartTrainedModelDeployment) Perform(providedCtx context.Context) (*http.Response, error)

Perform runs the http.Request through the provided transport and returns an http.Response.

func (*StartTrainedModelDeployment) Pretty added in v8.14.0

Pretty If set to `true` the returned JSON will be "pretty-formatted". Only use this option for debugging only. API name: pretty

func (*StartTrainedModelDeployment) Priority added in v8.7.0

Priority The deployment priority. API name: priority

func (*StartTrainedModelDeployment) QueueCapacity

func (r *StartTrainedModelDeployment) QueueCapacity(queuecapacity int) *StartTrainedModelDeployment

QueueCapacity Specifies the number of inference requests that are allowed in the queue. After the number of requests exceeds this value, new requests are rejected with a 429 error. API name: queue_capacity

func (*StartTrainedModelDeployment) Raw added in v8.18.0

Raw takes a json payload as input which is then passed to the http.Request If specified Raw takes precedence on Request method.

func (*StartTrainedModelDeployment) Request added in v8.18.0

Request allows to set the request property with the appropriate payload.

func (*StartTrainedModelDeployment) ThreadsPerAllocation

func (r *StartTrainedModelDeployment) ThreadsPerAllocation(threadsperallocation int) *StartTrainedModelDeployment

ThreadsPerAllocation Sets the number of threads used by each model allocation during inference. This generally increases the inference speed. The inference process is a compute-bound process; any number greater than the number of available hardware threads on the machine does not increase the inference speed. If this setting is greater than the number of hardware threads it will automatically be changed to a value less than the number of hardware threads. API name: threads_per_allocation

func (*StartTrainedModelDeployment) Timeout

Timeout Specifies the amount of time to wait for the model to deploy. API name: timeout

func (*StartTrainedModelDeployment) WaitFor

WaitFor Specifies the allocation status to wait for before returning. API name: wait_for

Jump to

Keyboard shortcuts

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