Documentation
¶
Overview ¶
Package modelworkers owns IDE configuration and repair of shared local execution.
Index ¶
- Variables
- func CompletionSource(db libdbexec.DBManager) func(context.Context, string) (modeldconn.CompletionPlan, error)
- func NewConfigured(ctx context.Context, db libdbexec.DBManager) (*modeldconn.Workers, error)
- func PolicySource(db libdbexec.DBManager) func(context.Context) (admission.Config, bool, error)
- func ReadAssignedOptions(ctx context.Context, store runtimetypes.Store, role string) (modeldconn.WorkerOptions, error)
- func ReadOptions(ctx context.Context, store runtimetypes.Store, role string) (modeldconn.WorkerOptions, error)
- func SaveCompletionProtection(ctx context.Context, store runtimetypes.Store, provider, model string, ...) error
- type Inspection
- type InventoryRequest
- type Policy
- type Request
- type Service
- func (s *Service) Execute(ctx context.Context, req Request) (*Snapshot, error)
- func (s *Service) ExecuteAt(ctx context.Context, target InventoryRequest, request Request) (*Snapshot, error)
- func (s *Service) Inspect(ctx context.Context, instance string) (*Inspection, error)
- func (s *Service) InspectAt(ctx context.Context, target InventoryRequest, instance string) (*Inspection, error)
- func (s *Service) Inventory(ctx context.Context, req InventoryRequest) (transport.Inventory, error)
- type Snapshot
Constants ¶
This section is empty.
Variables ¶
var Contract = servicecontract.Contract{ ID: "local-model-workers", Summary: "Manage local inference", Description: "Review local resource settings and the shared model owner. Inspect workers or stop an idle worker without interrupting another IDE's requests.", Operations: []servicecontract.Operation{ {ID: "status", Summary: "Read settings and owner status"}, {ID: "admission", Summary: "Configure shared scheduling"}, {ID: "inspect", Summary: "Inspect worker placement and capacity"}, {ID: "inventory", Summary: "Read native backends, devices and memory pools"}, {ID: "stop", Summary: "Stop an idle worker"}, {ID: "restart", Summary: "Restart the local owner after all native sessions close"}, }, }
Contract describes shared local execution configuration and repair.
Functions ¶
func CompletionSource ¶
func CompletionSource(db libdbexec.DBManager) func(context.Context, string) (modeldconn.CompletionPlan, error)
CompletionSource reinstates verified residency on its selected host before native requests after restart.
func NewConfigured ¶
NewConfigured creates a runtime client that reads worker preferences from the local database.
func PolicySource ¶
PolicySource reads the client's explicit scheduling preference without changing the owner.
func ReadAssignedOptions ¶
func ReadAssignedOptions(ctx context.Context, store runtimetypes.Store, role string) (modeldconn.WorkerOptions, error)
ReadAssignedOptions reads a role's own execution settings when reviewing an independent assignment.
func ReadOptions ¶
func ReadOptions(ctx context.Context, store runtimetypes.Store, role string) (modeldconn.WorkerOptions, error)
ReadOptions reads and validates a role's persisted worker settings without starting local inference.
func SaveCompletionProtection ¶
func SaveCompletionProtection(ctx context.Context, store runtimetypes.Store, provider, model string, executions []transport.SessionExecution) error
SaveCompletionProtection persists owner-confirmed allocation evidence in the role assignment transaction.
Types ¶
type Inspection ¶
type Inspection = transport.WorkerInspection
Inspection reports an existing worker's placement and resident allocation.
func InspectWorker ¶
func InspectWorker(ctx context.Context, worker modeldconn.WorkerStatus) (*Inspection, error)
InspectWorker reads a selected worker's native status and capacity.
type InventoryRequest ¶
type InventoryRequest struct {
Target string `json:"target"`
ConnectionID string `json:"connectionId"`
}
InventoryRequest selects this installation or one saved modeld connection.
type Policy ¶
type Policy struct {
QueueCapacity int `json:"queue_capacity"`
GlobalLimit int `json:"global_limit"`
ForegroundBurst int `json:"foreground_burst"`
MaxQueueWait string `json:"max_queue_wait"`
}
Policy describes editable admission settings without exposing duration encodings.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service owns persisted local settings and shared-owner controls.
func New ¶
New constructs worker configuration with complete persistence and execution dependencies.
func (*Service) Execute ¶
Execute applies the selected operation and returns independently readable configuration and owner state.
func (*Service) ExecuteAt ¶
func (s *Service) ExecuteAt(ctx context.Context, target InventoryRequest, request Request) (*Snapshot, error)
ExecuteAt operates the selected host's owner without consulting another host's leases or processes.
func (*Service) Inspect ¶
Inspect reads one existing worker without launching or loading another allocation.
func (*Service) InspectAt ¶
func (s *Service) InspectAt(ctx context.Context, target InventoryRequest, instance string) (*Inspection, error)
InspectAt reads an existing worker through its selected host's owner.
type Snapshot ¶
type Snapshot struct {
Resources admission.Resources `json:"resources"`
Contract servicecontract.Contract `json:"contract"`
Admission Policy `json:"admission"`
Options map[string]modeldconn.WorkerOptions `json:"options"`
OptionErrors map[string]string `json:"option_errors"`
Workers []modeldconn.WorkerStatus `json:"workers"`
OwnerState string `json:"owner_state"`
OwnerError string `json:"owner_error,omitempty"`
AdmissionError string `json:"admission_error,omitempty"`
}
Snapshot separates saved configuration from unavailable owner observations.