Move all 40 ML command files from core/cli/cmd/ml to go-ml/cmd/. Commands self-register via init() + cli.RegisterCommands(). - Fixed stale go-ai/ml import in cmd_ab.go (now uses go-ml + go-mlx) - Disabled cmd_train.go (needs go-mlx training API export) - Removed all local replace directives, deps resolve from forge - go build ./... passes cleanly Co-Authored-By: Virgil <virgil@lethean.io>
22 lines
440 B
Go
22 lines
440 B
Go
//go:build darwin && arm64
|
|
|
|
package cmd
|
|
|
|
import (
|
|
"fmt"
|
|
"log/slog"
|
|
|
|
"forge.lthn.ai/core/go-ml"
|
|
)
|
|
|
|
func createServeBackend() (ml.Backend, error) {
|
|
if serveModelPath != "" {
|
|
slog.Info("ml serve: loading native MLX backend", "path", serveModelPath)
|
|
b, err := ml.NewMLXBackend(serveModelPath)
|
|
if err != nil {
|
|
return nil, fmt.Errorf("mlx backend: %w", err)
|
|
}
|
|
return b, nil
|
|
}
|
|
return ml.NewHTTPBackend(apiURL, modelName), nil
|
|
}
|