routing

package
v0.9.2 Latest Latest
Warning

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

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

Documentation

Overview

Package routing contains routing constants and utilities shared between the EPP/Inference-Scheduler and the Routing Sidecar.

Index

Constants

View Source
const (
	// PrefillEndpointHeader is the header name used to indicate Prefill worker <ip:port>
	PrefillEndpointHeader = "x-prefiller-host-port"

	// EncoderEndpointsHeader is the header name used to indicate Encoder workers <ip:port> list
	EncoderEndpointsHeader = "x-encoder-hosts-ports"

	// DataParallelEndpointHeader is the header name used to indicate the worker <ip:port> for Data Parallel
	DataParallelEndpointHeader = "x-data-parallel-host-port"

	// InferencePoolAPIGroup is the default InferencePool API group
	InferencePoolAPIGroup = "inference.networking.k8s.io"

	// PreferHeader is the standard HTTP "Prefer" header (RFC 7240). EPP
	// receives header keys lowercased.
	PreferHeader = "prefer"

	// PreferIfAvailable is the preference token the coordinator sets to mark a
	// request as a speculative early-decode attempt: route to a decode worker
	// only if its KV cache already covers the prompt (at least partially); otherwise EPP surfaces
	// 412 Precondition Failed so the coordinator restarts the pipeline.
	PreferIfAvailable = "if-available"
)

Variables

This section is empty.

Functions

func IsConditionalDecode

func IsConditionalDecode(headers map[string]string) bool

IsConditionalDecode reports whether the request headers carry the "Prefer: if-available" preference (see PreferIfAvailable for semantics).

Per RFC 7240 the Prefer header value is a comma-separated list of preference tokens, each with optional ";"-delimited parameters. This function matches the bare "if-available" token case-insensitively, ignoring surrounding whitespace, parameters, and any other tokens that may appear alongside it.

func StripScheme

func StripScheme(endpoint string) string

StripScheme removes the scheme from an endpoint URL, returning host:port. This is useful for gRPC clients that expect host:port format only.

Types

This section is empty.

Jump to

Keyboard shortcuts

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