This adds a new entrypoint into the ollama CLI to run the cgo built runner. On Mac arm64, this will have GPU support, but on all other platforms it will be the lowest common denominator CPU build. After we fully transition to the new Go runners more tech-debt can be removed and we can stop building the "default" runner via make and rely on the builtin always.
23 lines
380 B
Go
23 lines
380 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
"os"
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
"github.com/ollama/ollama/cmd"
|
|
"github.com/ollama/ollama/llama/runner"
|
|
)
|
|
|
|
func main() {
|
|
if len(os.Args) >= 2 {
|
|
if os.Args[1] == "_runner" {
|
|
os.Args = append([]string{os.Args[0]}, os.Args[2:]...)
|
|
runner.RunnerMain()
|
|
return
|
|
}
|
|
}
|
|
cobra.CheckErr(cmd.NewCLI().ExecuteContext(context.Background()))
|
|
}
|