sammcj/gollama

Windows Build would be nice too

Closed this issue · 5 comments

Windows Build would be nice too

Me too!

Getting this when trying in windows terminal preview an after

$ go install github.com/sammcj/gollama@latest

$ gollama

Loading config from: .config\gollama\config.json
Error initializing logging: open /.config/gollama/gollama.log: The system cannot find the path specified.

Hey, This tool is designed for Linux/macOS. If there's someone that has a simple workaround for windows and wants to submit a PR I'm happy to have a look at it but in general I don't have plans to support Windows.

I got it to install on Windows 11. Here is what I did after debugging:

  1. Install Miniconda and Git, or already installed.
  2. Open Git Bash (needed for the Unix commands make build uses later)
  3. Make a conda environment: conda create -n gollama
  4. Activate the environment: conda activate gollama
  5. Install go and make into the env: conda install -c conda-forge go make
  6. Change folders to where you want to install Gollama.
  7. git clone https://github.com/Gaurav-Gosain/gollama.git
  8. cd gollama
  9. go get
  10. Only if you've changed the default location of your conda environments, set GOROOT to where Go is installed in Miniconda:
    export GOROOT=/path/to/your/conda/envs/gollama/go
  11. Edit /gollama/config/config.go and add this to the beginning of the LoadConfig() function, currently on about line 72, so it can properly find your Windows user home directory:
    // Determine the home directory based on the OS
    homeDir := os.Getenv("HOME")
    if homeDir == "" {
        homeDir = os.Getenv("USERPROFILE") // For Windows
    }
  1. Edit the viper.AddConfigPath line a few lines down to use the new homeDir variable: viper.AddConfigPath(filepath.Join(homeDir, ".config", "gollama"))
  2. make build
  3. Start Gollama in Git Bash: ./gollama (although the TUI is quite off in Git Bash)
  4. or, Start Gollama in command prompt: gollama. The TUI looks much better here.

I think that got it running for me on Windows. Hope it helps. Of course, you can use your favorite LLM to debug if it doesn't work for you.

Thanks for sharing @Jonseed!

FYI - It shouldn't need anything to do with conda - conda is for Python applications.

I'll look into adding the homeDir check for windows shortly :)

Sure! Conda was just to easily install and isolate the go and make packages. I know you can install go in Windows. You can install make with chocolatey, and probably other methods, but that seemed like more work than just using conda which I was already used to.