Principle 1 — Predictable Names: - rocmModel.srv → rocmModel.server (struct field) - recordMetrics: met → metrics (local var) - backend.go/model.go: cfg → config (local vars) - gguf.go: tc/kc → tensorCount32/kvCount32 (v2 count reads) Principle 2 — Comments as Usage Examples: - Added concrete usage examples to all exported functions: VRAMInfo, ModelInfo, DiscoverModels, GetVRAMInfo, ROCmAvailable, LoadModel, Available, NewClient, Health, ChatComplete, Complete, ReadMetadata, FileTypeName Principle 5 — Test naming (_Good/_Bad/_Ugly): - All test functions renamed to AX-7 convention across: discover_test.go, vram_test.go, server_test.go, internal/gguf/gguf_test.go, internal/llamacpp/client_test.go, internal/llamacpp/health_test.go Also: fix go.sum missing entry for dappco.re/go/core transitive dep (pulled in by go-inference replace directive). All tests pass: go test ./... -short -count=1 Co-Authored-By: Virgil <virgil@lethean.io> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
18 lines
573 B
Go
18 lines
573 B
Go
//go:build !linux || !amd64
|
|
|
|
package rocm
|
|
|
|
import coreerr "forge.lthn.ai/core/go-log"
|
|
|
|
// ROCmAvailable reports whether ROCm GPU inference is available on this machine.
|
|
// Returns false on non-Linux or non-amd64 platforms.
|
|
//
|
|
// if rocm.ROCmAvailable() {
|
|
// m, err := inference.LoadModel("/data/model.gguf")
|
|
// }
|
|
func ROCmAvailable() bool { return false }
|
|
|
|
// GetVRAMInfo is not available on non-Linux/non-amd64 platforms.
|
|
func GetVRAMInfo() (VRAMInfo, error) {
|
|
return VRAMInfo{}, coreerr.E("rocm.GetVRAMInfo", "VRAM monitoring not available on this platform", nil)
|
|
}
|