helper

package
v0.9.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// EnvTokenizerEndpoint is the env var for the UDS tokenizer socket path or TCP address.
	// Use a path (e.g. /tmp/tokenizer/tokenizer-uds.socket) for UDS mode,
	// or host:port (e.g. localhost:50051) for TCP mode.
	EnvTokenizerEndpoint = "TOKENIZER_ENDPOINT" //nolint:gosec // env var name, not a credential
)

Variables

This section is empty.

Functions

func ApplyTokenizerEndpoint added in v0.8.0

func ApplyTokenizerEndpoint(config *kvcache.Config)

ApplyTokenizerEndpoint reads TOKENIZER_ENDPOINT and overrides the UDS config on the given indexer config. No-op when TokenizersPoolConfig is nil.

func ConfigureInternalTokenizer deprecated added in v0.8.0

func ConfigureInternalTokenizer(config *kvcache.Config, modelName string) error

ConfigureInternalTokenizer wires up the in-process tokenization pool for examples that still drive the prompt-string indexer APIs.

Deprecated: tokenize externally and call Indexer.ScoreTokens.

func SetupEventsPool

func SetupEventsPool(ctx context.Context, kvBlockIndex kvblock.Index) (*kvevents.Pool, error)

func SetupKVCacheIndexer

func SetupKVCacheIndexer(ctx context.Context) (*kvcache.Indexer, error)

func SimulateProduceEvent

func SimulateProduceEvent(ctx context.Context, publisher *Publisher) error

func SimulateRemoveEvent

func SimulateRemoveEvent(ctx context.Context, publisher *Publisher) error

Types

type Publisher

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

Publisher sends KV cache events to a ZMQ endpoint.

func NewPublisher

func NewPublisher(ctx context.Context, endpoint string) (*Publisher, error)

NewPublisher creates a new ZMQ publisher. endpoint is the ZMQ address to connect to (e.g., "tcp://localhost:5557").

func SetupPublisher

func SetupPublisher(ctx context.Context) (*Publisher, error)

func (*Publisher) Close

func (p *Publisher) Close() error

Close closes the publisher and cleans up resources.

func (*Publisher) PublishEvent

func (p *Publisher) PublishEvent(ctx context.Context, topic string, batch interface{}) error

PublishEvent publishes a KV cache event batch to the ZMQ topic. topic should include the pod identifier (e.g., "kv.pod1").

Jump to

Keyboard shortcuts

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