system

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatBytes

func FormatBytes(bytes int64) string

FormatBytes converts bytes to human-readable format

func ParseBytes

func ParseBytes(s string) (int64, error)

ParseBytes converts human-readable format to bytes

Types

type Checker

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

Checker implements system resource checking

func NewChecker

func NewChecker(ctx context.Context) *Checker

NewChecker creates a new system checker

func (*Checker) CheckDocker

func (c *Checker) CheckDocker() (installed bool, version string, err error)

CheckDocker checks if Docker is installed and returns version

func (*Checker) CheckLocalLlama

func (c *Checker) CheckLocalLlama() bool

CheckLocalLlama checks if LocalLlama is installed

func (*Checker) CheckOllama

func (c *Checker) CheckOllama() bool

CheckOllama checks if Ollama is installed

func (*Checker) CheckPort

func (c *Checker) CheckPort(port int) bool

CheckPort checks if a port is available

func (*Checker) CheckRequirements

func (c *Checker) CheckRequirements(minRAM, minDisk int64) error

CheckRequirements validates system meets minimum requirements

func (*Checker) GetCPU

func (c *Checker) GetCPU() (int, error)

GetCPU returns the number of CPU cores

func (*Checker) GetDisk

func (c *Checker) GetDisk(path string) (total, available int64, err error)

GetDisk returns total and available disk space in bytes for the given path

func (*Checker) GetRAM

func (c *Checker) GetRAM() (total, available int64, err error)

GetRAM returns total and available RAM in bytes

func (*Checker) GetSystemInfo

func (c *Checker) GetSystemInfo() (SystemInfo, error)

GetSystemInfo returns comprehensive system information

func (*Checker) RecommendModel

func (c *Checker) RecommendModel(models []ModelSpec, availableRAM int64) *ModelSpec

RecommendModel suggests the best model based on available RAM

type ModelSpec

type ModelSpec struct {
	Name        string
	Size        int64 // Download size in bytes
	MinRAM      int64 // Minimum RAM required
	Recommended bool  // Is this the recommended model
}

ModelSpec represents an AI model specification

type SystemInfo

type SystemInfo struct {
	Platform            string
	Architecture        string
	TotalRAM            int64
	AvailableRAM        int64
	TotalDisk           int64
	AvailableDisk       int64
	CPUCount            int
	DockerInstalled     bool
	DockerVersion       string
	DockerError         error
	OllamaInstalled     bool
	LocalLlamaInstalled bool
}

SystemInfo contains comprehensive system information

Jump to

Keyboard shortcuts

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