modelproxy

package
v0.10.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AdditionalProxyRewrite = func(*httputil.ProxyRequest) {}

AdditionalProxyRewrite is an injection point for modifying proxy requests. Used in tests.

View Source
var ErrRetry = errors.New("retry")

Functions

This section is empty.

Types

type EndpointResolver added in v0.9.0

type EndpointResolver interface {
	AwaitBestAddress(ctx context.Context, model string) (string, func(), error)
}

type Handler

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

Handler serves http requests for end-clients. It is also responsible for triggering scale-from-zero.

func NewHandler

func NewHandler(
	modelScaler ModelScaler,
	resolver EndpointResolver,
	maxRetries int,
	retryCodes map[int]struct{},
) *Handler

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type ModelScaler

type ModelScaler interface {
	LookupModel(ctx context.Context, model string, selectors []string) (bool, error)
	ScaleAtLeastOneReplica(ctx context.Context, model string) error
}

Jump to

Keyboard shortcuts

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