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>
54 lines
1.6 KiB
Go
54 lines
1.6 KiB
Go
package ml
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"forge.lthn.ai/core/go/pkg/cli"
|
|
"forge.lthn.ai/core/go-ml"
|
|
)
|
|
|
|
var ingestCmd = &cli.Command{
|
|
Use: "ingest",
|
|
Short: "Ingest benchmark scores and training logs into InfluxDB",
|
|
Long: "Reads content score, capability score, and training log files and writes measurements to InfluxDB for the lab dashboard.",
|
|
RunE: runIngest,
|
|
}
|
|
|
|
var (
|
|
ingestContent string
|
|
ingestCapability string
|
|
ingestTraining string
|
|
ingestRunID string
|
|
ingestBatchSize int
|
|
)
|
|
|
|
func init() {
|
|
ingestCmd.Flags().StringVar(&ingestContent, "content", "", "Content scores JSONL file")
|
|
ingestCmd.Flags().StringVar(&ingestCapability, "capability", "", "Capability scores JSONL file")
|
|
ingestCmd.Flags().StringVar(&ingestTraining, "training-log", "", "MLX LoRA training log file")
|
|
ingestCmd.Flags().StringVar(&ingestRunID, "run-id", "", "Run ID tag (defaults to model name)")
|
|
ingestCmd.Flags().IntVar(&ingestBatchSize, "batch-size", 100, "Lines per InfluxDB write batch")
|
|
}
|
|
|
|
func runIngest(cmd *cli.Command, args []string) error {
|
|
if modelName == "" {
|
|
return fmt.Errorf("--model is required")
|
|
}
|
|
if ingestContent == "" && ingestCapability == "" && ingestTraining == "" {
|
|
return fmt.Errorf("at least one of --content, --capability, or --training-log is required")
|
|
}
|
|
|
|
influx := ml.NewInfluxClient(influxURL, influxDB)
|
|
|
|
cfg := ml.IngestConfig{
|
|
ContentFile: ingestContent,
|
|
CapabilityFile: ingestCapability,
|
|
TrainingLog: ingestTraining,
|
|
Model: modelName,
|
|
RunID: ingestRunID,
|
|
BatchSize: ingestBatchSize,
|
|
}
|
|
|
|
return ml.Ingest(influx, cfg, os.Stdout)
|
|
}
|