Documentation
¶
Overview ¶
Package enginecache binds cachemeta's remote invalidation directives to documented serving-engine control endpoints.
Index ¶
Constants ¶
const ( EngineSGLang Engine = "sglang" EngineVLLM Engine = "vllm" ScopeWholePrefixCache = "whole_prefix_cache" ScopeExactSpan = "exact_span" )
Variables ¶
This section is empty.
Functions ¶
func SupportsExactSpan ¶
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 ¶
func (c Client) Invalidate(ctx context.Context, dirs []cachemeta.ExternalInvalidationDirective) (Result, error)
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.