Ollama setup on Windows
Follow these steps so the Cognito Chrome extension can connect to Ollama on your Windows PC.
1. Install Ollama
If you haven't already:
- Download Ollama from ollama.com.
- Run the installer and complete the setup.
- Optionally open Ollama and pull a model (e.g. Llama 3.2), or run
ollama pull llama3.2in the terminal later.
2. Open Command Prompt or PowerShell as Administrator
The next command must run in an elevated (Administrator) session because it sets a system-wide environment variable.
How to open an Administrator terminal (pick one):
- Start menu: Press Win, type
cmdorpowershell, then right-click the result and choose Run as administrator. - Start button: Right-click the Start button → Terminal (Admin) or Command Prompt (Admin) or Windows PowerShell (Admin).
- Keyboard shortcut: Press Win + X, then A to open Terminal/PowerShell as Administrator.
If you open a normal (non-admin) window, the command in the next step will fail with "Access is denied."
3. Set OLLAMA_ORIGINS
In the Administrator terminal, run:
setx OLLAMA_ORIGINS "*" /M
You should see: SUCCESS: Specified value was saved.
This allows the Cognito extension (and other local tools) to connect to Ollama. The /M flag makes it a system-wide setting that persists across reboots — you only need to do this once.
Which value to use?
| Value | Description | When to use |
|---|---|---|
* | Allow all origins | Recommended for most users. Simple and safe — Ollama only listens on your machine, not the internet. |
chrome-extension://bcejicipnpgpcbmnafmnlgmpdingjkdk | Allow only the Cognito extension | Use if you want tighter access control. Update the ID if it changes. |
To use the extension-only value instead:
setx OLLAMA_ORIGINS "chrome-extension://bcejicipnpgpcbmnafmnlgmpdingjkdk" /M
If you use a different build of the extension (e.g. unpacked/dev), open the Cognito extension → Ollama panel to find your extension's ID and use that in the command instead.
4. Restart Ollama
The new variable only takes effect for new processes. You need to quit and restart Ollama:
If Ollama is already running:
- Right-click the Ollama icon in the system tray (bottom-right, near the clock) → choose Quit.
- Start Ollama again from the Start menu, or open a new terminal and run
ollama serve.
If Ollama isn't running yet:
Open a new Command Prompt or PowerShell window (no admin needed) and run:
ollama serve
Or simply start Ollama from the Start menu.
5. Verify the setting
To confirm OLLAMA_ORIGINS was saved correctly, open a new Command Prompt or PowerShell window and run:
echo %OLLAMA_ORIGINS%
You should see * (or your chosen extension origin). If it shows %OLLAMA_ORIGINS% literally, the variable wasn't saved — go back to Step 3 and make sure you used an Administrator terminal.
6. Check that it works
- Open the Cognito extension in Chrome.
- Go to Ollama / provider settings and choose Ollama.
- Use Refresh or Check connection. It should show a successful connection and list your installed models.
- Start a chat and select an Ollama model.
Troubleshooting
- Connection still fails: Make sure you restarted Ollama after running
setx. Open a new terminal to verify the variable is set withecho %OLLAMA_ORIGINS%. - "Access is denied" or setx fails: You're not running as Administrator. Close the terminal window, then right-click Command Prompt or PowerShell and choose Run as administrator.
- Ollama not found in terminal: Add Ollama to your PATH or use the full path to
ollama.exe(usually under%LOCALAPPDATA%\Programs\Ollama). Or just start Ollama from the Start menu. - Extension shows CORS error: Double-check that
OLLAMA_ORIGINSis set to*or to your extension's exact origin (no extra spaces). Restart Ollama after any change.
After setup, add more models from the extension's Ollama panel or with ollama pull <model> in the terminal.