move OLLAMA_HOST to envconfig (#5009)

This commit is contained in:
Patrick Devine 2024-06-12 18:48:16 -04:00 committed by GitHub
parent bba5d177aa
commit c69bc19e46
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 119 additions and 103 deletions

View file

@ -960,17 +960,11 @@ func generate(cmd *cobra.Command, opts runOptions) error {
}
func RunServer(cmd *cobra.Command, _ []string) error {
// retrieve the OLLAMA_HOST environment variable
ollamaHost, err := api.GetOllamaHost()
if err != nil {
return err
}
if err := initializeKeypair(); err != nil {
return err
}
ln, err := net.Listen("tcp", net.JoinHostPort(ollamaHost.Host, ollamaHost.Port))
ln, err := net.Listen("tcp", net.JoinHostPort(envconfig.Host.Host, envconfig.Host.Port))
if err != nil {
return err
}