From 0ded7fdc4b33801fd0115656927b6097f800c544 Mon Sep 17 00:00:00 2001 From: Blake Mizerany Date: Wed, 6 Mar 2024 13:48:46 -0800 Subject: [PATCH] cmd: document environment variables for serve command Updates #2944 --- cmd/cmd.go | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/cmd/cmd.go b/cmd/cmd.go index 120463f9..a26f81bf 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -879,6 +879,24 @@ func NewCLI() *cobra.Command { Args: cobra.ExactArgs(0), RunE: RunServer, } + serveCmd.SetUsageTemplate(serveCmd.UsageTemplate() + ` +Environment Variables: + + OLLAMA_HOST + The host:port to bind to (default "127.0.0.1:11434") + + Examples: + "127.0.0.1:11434" + OLLAMA_ORIGINS + A comma separated list of allowed origins. If unset, the + default behavior is to allow same origin requests, only. + + Examples: + "localhost:11434" + "example.com,api.example.com" + OLLAMA_MODELS + The path to the models directory (default is "~/.ollama/models") +`) pullCmd := &cobra.Command{ Use: "pull MODEL", @@ -907,7 +925,6 @@ func NewCLI() *cobra.Command { PreRunE: checkServerHeartbeat, RunE: ListHandler, } - copyCmd := &cobra.Command{ Use: "cp SOURCE TARGET", Short: "Copy a model",