Virgil split go-ai into standalone modules (go-agentic, go-ml, go-mlx, go-rag). This migrates all CLI imports to the new module paths and fixes API mismatches from the split. Key changes: - go-ai/agentic → go-agentic (cmd/ai, cmd/dev) - go-ai/ml → go-ml (31 files in cmd/ml) - go-ai/rag → go-rag (3 files in cmd/rag) - go-ai/mlx → go-mlx (1 file) - Fix go.work path (../core → ../go) - Add all split repos to go.work and go.mod - Simplify daemon to goroutine-based MCP (remove missing supervisor) - Wire go-agentic SQLiteRegistry into dispatch watch (--agent-id flag) - Add `core ai agent fleet` command for local registry status - Fix rag collections API (PointCount, Status string) - Fix ml live/expand-status to use available go-ml API Co-Authored-By: Charon <charon@lethean.io>
40 lines
1.1 KiB
Go
40 lines
1.1 KiB
Go
package ml
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"forge.lthn.ai/core/go/pkg/cli"
|
|
"forge.lthn.ai/core/go-ml"
|
|
)
|
|
|
|
var (
|
|
ggufInput string
|
|
ggufConfig string
|
|
ggufOutput string
|
|
ggufArch string
|
|
)
|
|
|
|
var ggufCmd = &cli.Command{
|
|
Use: "gguf",
|
|
Short: "Convert MLX LoRA adapter to GGUF format",
|
|
Long: "Converts an MLX safetensors LoRA adapter to GGUF v3 format for use with llama.cpp.",
|
|
RunE: runGGUF,
|
|
}
|
|
|
|
func init() {
|
|
ggufCmd.Flags().StringVar(&ggufInput, "input", "", "Input safetensors file (required)")
|
|
ggufCmd.Flags().StringVar(&ggufConfig, "config", "", "Adapter config JSON (required)")
|
|
ggufCmd.Flags().StringVar(&ggufOutput, "output", "", "Output GGUF file (required)")
|
|
ggufCmd.Flags().StringVar(&ggufArch, "arch", "gemma3", "GGUF architecture name")
|
|
ggufCmd.MarkFlagRequired("input")
|
|
ggufCmd.MarkFlagRequired("config")
|
|
ggufCmd.MarkFlagRequired("output")
|
|
}
|
|
|
|
func runGGUF(cmd *cli.Command, args []string) error {
|
|
if err := ml.ConvertMLXtoGGUFLoRA(ggufInput, ggufConfig, ggufOutput, ggufArch); err != nil {
|
|
return fmt.Errorf("convert to GGUF: %w", err)
|
|
}
|
|
fmt.Printf("GGUF LoRA adapter written to %s\n", ggufOutput)
|
|
return nil
|
|
}
|