provider

package
v0.4.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Model         string
	Description   string
	MaxConcurrent int
	Token         string
	Backend       backend.Config
	HubURL        string
	LogFile       string
	RateLimit     int // requests per minute, 0 = unlimited
	TokenManager  *auth.TokenManager
}

Config holds provider configuration

type Provider

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

Provider manages the lifecycle of a published model

func New

func New(cfg Config) (*Provider, error)

New creates a new provider instance

func (*Provider) CloseConnection added in v0.4.0

func (p *Provider) CloseConnection()

CloseConnection closes the current WebSocket without stopping the provider, allowing the reconnect loop in Start to re-establish the connection.

func (*Provider) Start

func (p *Provider) Start(ctx context.Context) error

Start begins listening for inference requests. If the WebSocket connection drops, it automatically reconnects once per minute.

func (*Provider) Status

func (p *Provider) Status() ProviderStatus

Status returns the current provider status

func (*Provider) Stop

func (p *Provider) Stop()

Stop gracefully shuts down the provider

type ProviderStatus

type ProviderStatus struct {
	ProviderID   string    `json:"provider_id"`
	Model        string    `json:"model"`
	Status       string    `json:"status"`
	Uptime       int64     `json:"uptime_seconds"`
	RequestCount int64     `json:"request_count"`
	QueueDepth   int       `json:"queue_depth"`
	GPUUtil      float64   `json:"gpu_util"`
	Timestamp    time.Time `json:"timestamp"`
}

ProviderStatus represents detailed provider status

Jump to

Keyboard shortcuts

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