Skip to content

Get up and running with Kimi, GLM, MiniMax, DeepSeek, gpt-oss, Qwen, Gemma and other models.

Harden the OLLAMA_HOST lookup for quotes

Daniel Hiltgen4a10e7a7faff
diff --git a/cmd/cmd.go b/cmd/cmd.go
index 66909c2cc..768f4afb7 100644
--- a/cmd/cmd.go
+++ b/cmd/cmd.go
@@ -685,7 +685,7 @@ func generate(cmd *cobra.Command, opts runOptions) error {
}
func RunServer(cmd *cobra.Command, _ []string) error {
- host, port, err := net.SplitHostPort(os.Getenv("OLLAMA_HOST"))
+ host, port, err := net.SplitHostPort(strings.Trim(os.Getenv("OLLAMA_HOST"), "\"'"))
if err != nil {
host, port = "127.0.0.1", "11434"
if ip := net.ParseIP(strings.Trim(os.Getenv("OLLAMA_HOST"), "[]")); ip != nil {