diff --git a/cmd/cmd.go b/cmd/cmd.go index b409e1955..bd529fc1d 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -51,13 +51,13 @@ import ( "github.com/ollama/ollama/parser" "github.com/ollama/ollama/progress" "github.com/ollama/ollama/readline" - "github.com/ollama/ollama/runner" "github.com/ollama/ollama/server" "github.com/ollama/ollama/types/model" "github.com/ollama/ollama/types/syncmap" "github.com/ollama/ollama/version" xcreate "github.com/ollama/ollama/x/create" xcreateclient "github.com/ollama/ollama/x/create/client" + "github.com/ollama/ollama/x/mlxrunner" ) func init() { @@ -2557,12 +2557,12 @@ func NewCLI() *cobra.Command { Use: "runner", Hidden: true, RunE: func(cmd *cobra.Command, args []string) error { - return runner.Execute(os.Args[1:]) + return mlxrunner.Execute(os.Args[2:]) }, FParseErrWhitelist: cobra.FParseErrWhitelist{UnknownFlags: true}, } runnerCmd.SetHelpFunc(func(cmd *cobra.Command, args []string) { - _ = runner.Execute(args[1:]) + _ = mlxrunner.Execute([]string{"--help"}) }) var gpuDiscoverLibDirs []string diff --git a/cmd/runner/main.go b/cmd/runner/main.go deleted file mode 100644 index fbfafc7ff..000000000 --- a/cmd/runner/main.go +++ /dev/null @@ -1,15 +0,0 @@ -package main - -import ( - "fmt" - "os" - - "github.com/ollama/ollama/runner" -) - -func main() { - if err := runner.Execute(os.Args[1:]); err != nil { - fmt.Fprintf(os.Stderr, "error: %s\n", err) - os.Exit(1) - } -} diff --git a/runner/README.md b/runner/README.md deleted file mode 100644 index 3ef37296f..000000000 --- a/runner/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# `runner` - -> Note: this is a work in progress - -A minimal runner for loading a model and running inference via a http web server. - -```shell -./runner -model -``` - -### Completion - -```shell -curl -X POST -H "Content-Type: application/json" -d '{"prompt": "hi"}' http://localhost:8080/completion -``` - -### Embeddings - -```shell -curl -X POST -H "Content-Type: application/json" -d '{"prompt": "turn me into an embedding"}' http://localhost:8080/embedding -``` diff --git a/runner/runner.go b/runner/runner.go deleted file mode 100644 index fec9e1633..000000000 --- a/runner/runner.go +++ /dev/null @@ -1,21 +0,0 @@ -package runner - -import ( - "fmt" - - "github.com/ollama/ollama/x/mlxrunner" -) - -func Execute(args []string) error { - if args[0] == "runner" { - args = args[1:] - } - - if len(args) > 0 { - switch args[0] { - case "--mlx-engine": - return mlxrunner.Execute(args[1:]) - } - } - return fmt.Errorf("unknown runner engine, expected --mlx-engine") -} diff --git a/x/mlxrunner/client.go b/x/mlxrunner/client.go index 4a6292ac1..081c2708b 100644 --- a/x/mlxrunner/client.go +++ b/x/mlxrunner/client.go @@ -340,8 +340,8 @@ func (c *Client) Load(ctx context.Context, systemInfo ml.SystemInfo, gpus []ml.D exe = eval } - // Spawn subprocess: ollama runner --mlx-engine --model --port - cmd := exec.Command(exe, "runner", "--mlx-engine", "--model", c.modelName, "--port", strconv.Itoa(port)) + // Spawn subprocess: ollama runner --model --port + cmd := exec.Command(exe, "runner", "--model", c.modelName, "--port", strconv.Itoa(port)) cmd.Env = os.Environ() // Set library path environment variable for MLX libraries