Connecting Lumen to Local Ollama
Lumen can connect directly to Ollama running on your own computer, allowing you to use your locally installed AI models inside Lumen.
This is useful because your model runs locally rather than requiring a cloud AI API.
There is one important catch, though:
Lumen is a website, while Ollama is a local server.
Your browser therefore has to make a request from Lumen's website to your computer.
The two addresses are:
Lumen
https://lumendesk.pages.dev
and
Ollama
http://127.0.0.1:11434
Because these are different origins, your browser applies a security mechanism called CORS (Cross-Origin Resource Sharing).
If Ollama doesn't explicitly allow Lumen's origin, the browser request can be rejected with:
403 Forbidden
Lumen then interprets this as Ollama being unreachable.
The solution is to tell Ollama:
Allow requests coming from https://lumendesk.pages.dev.
That's what OLLAMA_ORIGINS does.
Using an AI Agent — Recommended for Beginners
If you're unfamiliar with environment variables, PowerShell, or restarting background services, you can use an AI coding/terminal agent to help configure this.
Examples include:
- OpenCode
- Codex
- Antigravity
- Other reputable local coding/terminal agents
The agent doesn't need to modify Lumen itself. Its job is simply to:
- Check whether Ollama is installed and running.
- Check the current
OLLAMA_ORIGINS configuration.
- Set the correct origin if necessary.
- Restart Ollama.
- Test whether the browser origin is accepted.
- Tell you exactly what worked or what is still wrong.
How much AI usage will this consume?
Very little. This isn't a large coding project. A capable agent should normally only need a small number of terminal commands and a short conversation. For example, the agent may need to:
Check Ollama
Check OLLAMA_ORIGINS
Set variable
Restart Ollama
Run CORS test
Done
So you shouldn't need to spend hundreds of thousands of tokens on this. A few thousand tokens or less is generally plenty for the actual troubleshooting. If an agent somehow turns this into a 47-file software architecture project, it has gotten way too excited.
Recommended approach
Give the agent the prompt below before letting it make changes. That way, it knows exactly what you're trying to accomplish and is less likely to start changing unrelated settings.
Prompt for an AI Agent
Copy this into OpenCode, Codex, Antigravity, or a similar agent:
I need to connect my locally installed Ollama server to the Lumen website:
https://lumendesk.pages.dev
Ollama normally runs locally at:
http://127.0.0.1:11434
Lumen is showing Ollama as unreachable, and I suspect this is a CORS issue.
Please diagnose the problem and configure Ollama so that browser requests from:
https://lumendesk.pages.dev
are allowed.
Use OLLAMA_ORIGINS for this. On Windows, check the User environment variable first.
Please follow this process:
1. Check whether Ollama is installed and running.
2. Check the current value of OLLAMA_ORIGINS.
3. If necessary, set the User-level OLLAMA_ORIGINS value to exactly:
https://lumendesk.pages.dev
4. Do not change unrelated environment variables.
5. Do not expose Ollama to the internet.
6. Do not set OLLAMA_HOST to 0.0.0.0.
7. Do not port-forward port 11434.
8. Fully restart Ollama so it reads the new environment variable.
9. Test the Ollama API.
10. Test a request containing:
Origin: https://lumendesk.pages.dev
against:
http://127.0.0.1:11434/api/tags
11. Confirm whether the response is HTTP 200.
12. If it still returns 403, diagnose the actual cause rather than randomly changing settings.
Do not delete, move, reinstall, or modify my Ollama models.
Do not make unrelated system changes.
At the end, clearly tell me:
- whether Ollama is running
- what OLLAMA_ORIGINS is set to
- whether the CORS test returned 200
- what Base URL I should enter into Lumen
- whether I need to do anything else
Ask for confirmation before making any potentially unrelated or risky system changes.
One important thing
Don't give an agent unnecessary permissions just because it says it needs them. For this task, it should not need to:
- Access your browser passwords
- Access your personal files
- Change firewall rules
- Modify your router
- Expose your PC to the internet
- Delete Ollama data
The task is basically an environment-variable + restart + test job.
Requirements
Before beginning, make sure you have:
- Ollama installed
- Ollama running on your computer
- At least one model downloaded
- Chrome, Edge, Firefox, or another modern browser
- Internet access to Lumen
For example:
ollama pull llama3.2
Check your installed models:
ollama list
Step 1 — Confirm Ollama Is Running
Open this in your browser:
http://127.0.0.1:11434
You should see:
Ollama is running
If you don't, launch Ollama and wait for it to start.
Terminal test
You can also run:
curl.exe http://127.0.0.1:11434/api/tags
If Ollama is working, you'll receive JSON containing your installed models.
Step 2 — Allow Lumen's Origin
This is the actual CORS fix. Set:
OLLAMA_ORIGINS=https://lumendesk.pages.dev
Windows — easiest method
- Press Windows.
- Search for Edit the system environment variables.
- Open it.
- Click Environment Variables...
- Under User variables, click New...
- Enter:
Variable name
OLLAMA_ORIGINS
Variable value
https://lumendesk.pages.dev
Click OK through all the dialogs.
Or use PowerShell
Run:
[Environment]::SetEnvironmentVariable("OLLAMA_ORIGINS","https://lumendesk.pages.dev","User")
Step 3 — Restart Ollama — VERY IMPORTANT
Changing the environment variable doesn't automatically update an Ollama process that is already running. Ollama needs to start again so it can read the new value.
Windows
- Right-click the Ollama icon in the system tray.
- Choose Quit.
- Launch Ollama again from the Start menu.
macOS
Quit Ollama completely and relaunch it.
Linux
If you're running Ollama as a system service:
sudo systemctl restart ollama
The restart is essential. Without it, you can correctly set OLLAMA_ORIGINS and still get a 403 because the old Ollama process is still running with its previous configuration.
Step 4 — Test the CORS Configuration
This is the best way to determine whether the problem is actually fixed. On Windows:
curl.exe -s -o NUL -w "%{http_code}" -H "Origin: https://lumendesk.pages.dev" http://127.0.0.1:11434/api/tags
You want:
200
200 — Success
Great! Ollama accepted a request carrying Lumen's origin. You can move on to Lumen.
403 — Still rejected
Ollama is still rejecting the origin. Continue to Troubleshooting.
Step 5 — Connect Ollama in Lumen
Open:
https://lumendesk.pages.dev
Go to Settings and select:
Provider: Ollama
Base URL:
http://127.0.0.1:11434
Then select a model that you've already downloaded with Ollama. For example:
llama3.2
Send a test message. If everything is configured correctly, Lumen should now be able to communicate with your local model.
Troubleshooting
Still getting 403?
Check the environment variable:
[Environment]::GetEnvironmentVariable("OLLAMA_ORIGINS","User")
It should output exactly:
https://lumendesk.pages.dev
Make sure there aren't:
- Extra spaces
- Quotes
- Markdown formatting
- Typos
- A different domain
Then fully restart Ollama again.
Diagnostic test: temporarily allow all origins
If you're certain everything looks correct but you're still getting 403, you can temporarily test whether the problem is definitely the origin restriction.
Set:
[Environment]::SetEnvironmentVariable("OLLAMA_ORIGINS","*","User")
Restart Ollama. Then run the CORS test again:
curl.exe -s -o NUL -w "%{http_code}" -H "Origin: https://lumendesk.pages.dev" http://127.0.0.1:11434/api/tags
If you now get 200, then you've confirmed that the problem is the origin configuration.
Afterwards, change it back
Don't leave it at * unnecessarily. Set it back to:
[Environment]::SetEnvironmentVariable("OLLAMA_ORIGINS","https://lumendesk.pages.dev","User")
Then restart Ollama one more time.
Lumen Still Says "Ollama Unreachable"
Work through these checks:
Check 1 — Ollama
Open: http://127.0.0.1:11434 — Does it say Ollama is running?
Check 2 — Models
Run: ollama list — Make sure at least one model is installed.
Check 3 — API
Run: curl.exe http://127.0.0.1:11434/api/tags — You should receive JSON.
Check 4 — CORS
Run the CORS test above. You want 200.
Check 5 — Try localhost
If Lumen still can't connect using http://127.0.0.1:11434, try http://localhost:11434 as the Base URL.
Security Notes
This setup is designed to keep Ollama local.
The intended architecture is:
Internet
|
v
+-----------------+
| Lumen |
| lumendesk.pages |
+--------+--------+
|
Browser request
|
v
+-----------------+
| 127.0.0.1 |
| :11434 |
+--------+--------+
|
v
+----------+
| Ollama |
+----+-----+
|
v
Your local model
You do not need to expose Ollama to the internet.
Avoid doing things like:
- Setting
OLLAMA_HOST=0.0.0.0
- Port-forwarding
11434
- Disabling your firewall just to make Lumen work
What OLLAMA_ORIGINS Actually Does
It's worth understanding what you're changing. The browser essentially tells Ollama:
"I'm making this request from: https://lumendesk.pages.dev"
Ollama checks whether that origin is allowed.
Without the configuration:
Lumen -> Ollama
X Origin not allowed
-> 403
With OLLAMA_ORIGINS=https://lumendesk.pages.dev:
Lumen -> Ollama
OK: Origin allowed
-> 200
Your model itself doesn't change. Your downloaded model files don't change. You're simply telling Ollama which web origin is allowed to communicate with it.
TL;DR
If you're comfortable with the terminal:
1. Set the origin
[Environment]::SetEnvironmentVariable("OLLAMA_ORIGINS","https://lumendesk.pages.dev","User")
2. Restart Ollama
Quit Ollama completely -> launch it again.
3. Test
curl.exe -s -o NUL -w "%{http_code}" -H "Origin: https://lumendesk.pages.dev" http://127.0.0.1:11434/api/tags
You want: 200
4. Lumen
Provider: Ollama
Base URL: http://127.0.0.1:11434
Choose your installed model. Done.
Final Recommendation
If you aren't comfortable with the terminal, I recommend using an agent like OpenCode, Codex, or Antigravity for this setup.
This is exactly the kind of small system-configuration task where an agent is useful: it can inspect your current configuration, run the appropriate commands, restart Ollama, and verify the result rather than making you hunt through Windows settings yourself.
And importantly, this should be a very small agent task. You don't need to burn through a giant context window or use an expensive model. A lightweight but competent coding model should generally be more than enough.
Just give the agent the prompt above and tell it:
Diagnose this first. Don't make unrelated changes.
That one sentence can save you from the classic AI-agent experience of asking it to fix one environment variable and watching it decide that your entire computer needs a spiritual reboot.