From 82009f556957762fde7a920e7591f1df9c2bb18b Mon Sep 17 00:00:00 2001 From: Azgaar Date: Sat, 14 Jun 2025 16:12:24 +0200 Subject: [PATCH] Updated Ollama text generation (markdown) --- Ollama-text-generation.md | 43 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/Ollama-text-generation.md b/Ollama-text-generation.md index de979a1..f46c2e0 100644 --- a/Ollama-text-generation.md +++ b/Ollama-text-generation.md @@ -35,7 +35,48 @@ After installing Ollama, you need to download an AI model (think of it as the "b 5. Visit [ollama.com/search](https://ollama.com/search) to see what other models you can download. -## Step 3: Start the server +## Step 3: Allow Ollama to be accessed from the web +If you are running FMG locally, you don't need this step. But if you want Ollama to be available form the web-version of the FMG, you need to set OLLAMA_ORIGINS. + +### For Windows Users: +1. **Press `Windows key + R`** +2. **Type `sysdm.cpl` and press Enter** +3. **Click "Environment Variables..." button** +7. **Click "New..." and enter:** + - Variable name: `OLLAMA_ORIGINS` + - Variable value: `https://azgaar.github.io,https://*afmg.netlify.app,http://127.0.0.1:5501` +8. **Click "OK" on everything** +9. **Restart ollama sever if it's running. You may need to restart you computer as well** + +### For Mac Users: +1. **Open Terminal** +2. **Type this command:** `nano ~/.zshrc` +3. **Add these two lines at the end:** + ``` + export OLLAMA_ORIGINS="https://azgaar.github.io,https://*afmg.netlify.app,http://127.0.0.1:5501" + ``` +4. **Save and exit:** + - Press `Ctrl + X` + - Press `Y` to confirm + - Press `Enter` to save +5. **Apply the changes:** + ``` + source ~/.zshrc + ``` +6. **Restart your computer** + +### For Linux Users: + +1. **Open Terminal** +2. **Type these commands one by one:** + ``` + echo 'export OLLAMA_HOST="0.0.0.0"' >> ~/.bashrc + echo 'export OLLAMA_ORIGINS="https://azgaar.github.io,https://*afmg.netlify.app,http://127.0.0.1:5501"' >> ~/.bashrc + source ~/.bashrc + ``` +3. **Restart your computer** + +## Step 4: Start the server 1. Open Command Prompt/Terminal. Type: `ollama serve`. Leave this window open** - Ollama is now running! 2. Open Fantasy Map Generator. Open AI notes generator and select "ollama" from the AI model list