modelproxy

package
v0.23.2 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2026 License: Apache-2.0 Imports: 15 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 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(
	modelClient ModelClient,
	loadBalancer LoadBalancer,
	maxRetries int,
	retryCodes map[int]struct{},
) *Handler

func (*Handler) ServeHTTP

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

type LoadBalancer

type LoadBalancer interface {
	AwaitBestAddress(ctx context.Context, req *apiutils.Request) (string, func(), error)
}

type ModelClient

type ModelClient interface {
	LookupModel(ctx context.Context, model, adapter string, selectors []string) (*v1.Model, 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