enginecache

package
v0.32.0 Latest Latest
Warning

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

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

Documentation

Overview

Package enginecache binds cachemeta's remote invalidation directives to documented serving-engine control endpoints.

Index

Constants

View Source
const (
	EngineSGLang Engine = "sglang"
	EngineVLLM   Engine = "vllm"

	ScopeWholePrefixCache = "whole_prefix_cache"
	ScopeExactSpan        = "exact_span"
)

Variables

This section is empty.

Functions

func SupportsExactSpan

func SupportsExactSpan(engine Engine) bool

SupportsExactSpan reports whether the documented public engine control plane can evict exactly the K/V or attention-index span named by cachemeta. Current SGLang and vLLM HTTP endpoints reset the whole prefix/radix cache instead.

Types

type Client

type Client struct {
	Engine        Engine
	BaseURL       string
	AdminAPIKey   string
	IdleTimeout   time.Duration
	RequiredScope string
	HTTPClient    *http.Client
	// ExactSpanEndpoint, when non-empty, is an operator-supplied control endpoint
	// that evicts exactly the named K/V span(s) plus their dependent DSA
	// attention_index entries instead of resetting the whole prefix cache. It is
	// empty by default: fak does not claim the public SGLang/vLLM HTTP surfaces
	// expose exact-span eviction (SupportsExactSpan stays false for them), so this
	// path is taken ONLY when an operator wires an independently witnessed endpoint
	// for their deployment. A full URL (scheme+host) is used verbatim; a bare path
	// resolves against the control base derived from BaseURL.
	ExactSpanEndpoint string
}

Client translates cachemeta invalidation directives into remote engine calls. The current SGLang/vLLM public HTTP surfaces expose whole-prefix-cache reset, not exact-span eviction, so one or more directives becomes one auditable full engine-cache invalidation.

func (Client) Invalidate

Invalidate applies remote invalidation directives. It is a no-op when the directive set is empty, and returns an error on unsupported engines or non-2xx control endpoint responses.

type Engine

type Engine string

Engine names a remote serving engine with a documented cache reset endpoint.

type Result

type Result struct {
	Engine             Engine
	Endpoint           string
	Scope              string
	ExactSpanSupported bool
	Directives         int
	StatusCode         int
	BodySummary        string
}

Result is the witnessed effect of an engine-cache invalidation attempt.

Jump to

Keyboard shortcuts

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