agent

package
v0.1.2-alpha Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2026 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildHeartbeat

func BuildHeartbeat(nodeID string, sequence int64, state nodestate.State, runtimeStatus RuntimeStatus, gpu protocol.GPUStatus, uptimeSeconds int64, now time.Time) protocol.NodeHeartbeatPayload

func ReadStatus

func ReadStatus(dataDir string) (*control.Status, error)

func Run

func Run(ctx context.Context, opts Options) error

func StatusPath

func StatusPath(dataDir string) string

Types

type Agent

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

func New

func New(opts Options) (*Agent, error)

func (*Agent) Run

func (a *Agent) Run(ctx context.Context) error

type CatalogRuntimeStatusProvider

type CatalogRuntimeStatusProvider struct {
	CatalogDir string
}

func (CatalogRuntimeStatusProvider) Prepare

type ExistingRuntimeProvider

type ExistingRuntimeProvider struct {
	CatalogDir string
	BaseURL    string
}

func (ExistingRuntimeProvider) Prepare

func (p ExistingRuntimeProvider) Prepare(ctx context.Context, modelID string) (RuntimeStatus, error)

type LocalRuntimeProvider

type LocalRuntimeProvider struct {
	CatalogDir       string
	DataDir          string
	RuntimeRoot      string
	ModelCacheDir    string
	ModelQuotaBytes  int64
	RuntimePublicKey ed25519.PublicKey
	RuntimeEnv       []string
	HTTPClient       *http.Client
	StartupTimeout   time.Duration
	ShutdownTimeout  time.Duration
	HealthInterval   time.Duration
	// contains filtered or unexported fields
}

func (*LocalRuntimeProvider) Close

func (p *LocalRuntimeProvider) Close(ctx context.Context) error

func (*LocalRuntimeProvider) Prepare

func (p *LocalRuntimeProvider) Prepare(ctx context.Context, modelID string) (RuntimeStatus, error)

type Options

type Options struct {
	DataDir           string
	CatalogDir        string
	CoordinatorURL    string
	ModelID           string
	AccessToken       string
	NodeID            string
	AgentVersion      string
	HeartbeatInterval time.Duration
	HTTPClient        *http.Client
	Validator         *protocol.Validator
	Telemetry         telemetry.Provider
	Runtime           RuntimeStatusProvider
	Backoff           session.Backoff
	Now               func() time.Time
	Output            io.Writer
	PrivateKey        ed25519.PrivateKey
	ScheduleFrom      string
	ScheduleUntil     string
	ScheduleLocation  *time.Location
	MaxTempC          int
	HardTempC         int
	ThermalHysteresis int
	PauseIdleTimeout  time.Duration
	ThermalPoll       time.Duration
}

type RuntimeStatus

type RuntimeStatus struct {
	ModelID     string
	RuntimeHash string
	ModelHash   string
	BaseURL     string
}

type RuntimeStatusProvider

type RuntimeStatusProvider interface {
	Prepare(ctx context.Context, modelID string) (RuntimeStatus, error)
}

Jump to

Keyboard shortcuts

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