MCPcopy
hub / github.com/mudler/LocalAI / GetSystemState

Function GetSystemState

pkg/system/state.go:79–94  ·  view source on GitHub ↗
(opts ...SystemStateOptions)

Source from the content-addressed store, hash-verified

77}
78
79func GetSystemState(opts ...SystemStateOptions) (*SystemState, error) {
80 state := &SystemState{}
81 for _, opt := range opts {
82 opt(state)
83 }
84
85 // Detection is best-effort here, we don't want to fail if it fails
86 state.GPUVendor, _ = xsysinfo.DetectGPUVendor()
87 xlog.Debug("GPU vendor", "gpuVendor", state.GPUVendor)
88 state.VRAM, _ = xsysinfo.TotalAvailableVRAM()
89 xlog.Debug("Total available VRAM", "vram", state.VRAM)
90
91 state.getSystemCapabilities()
92
93 return state, nil
94}

Callers 15

app_test.goFile · 0.92
vram_test.goFile · 0.92
edit_model_test.goFile · 0.92
settings_test.goFile · 0.92
pii_test.goFile · 0.92

Calls 3

getSystemCapabilitiesMethod · 0.95
DetectGPUVendorFunction · 0.92
TotalAvailableVRAMFunction · 0.92

Tested by 2

minimalSystemStateFunction · 0.74
newMITMTestAppFunction · 0.74