Use a browser AI agent with an Ollama model running on another network
WebBrain can connect to Ollama through its OpenAI-compatible API, but a remote browser cannot use the model server's loopback address. This guide verifies each layer separately, creates a Localtonet HTTP tunnel, handles Ollama's Host header and browser-origin restrictions, and then configures WebBrain with the working public endpoint. Directly publishing an unauthenticated Ollama API is appropriate only for a short controlled test. Persistent deployments should place compatible authentication in front of Ollama.
๐ What's in this guide
How WebBrain, Ollama, and Localtonet fit together
WebBrain is an open-source browser extension for Chrome, Firefox, Edge, and compatible Chromium browsers. It runs in a side panel next to the active tab and can use the page as context for questions or browser tasks. Its three documented modes have different capabilities: Ask is read-only, Act can interact with pages, and Dev adds development-oriented information and reversible page edits.
WebBrain can use its managed default model or a model provider selected in Settings. Ollama is one of its documented local providers. Ollama exposes an HTTP API on port 11434 by default, including an OpenAI-compatible interface under /v1. WebBrain sends requests to that interface and receives model responses.
A loopback URL such as http://127.0.0.1:11434/v1 works only when the browser and Ollama are on the same computer. If WebBrain runs on a laptop and Ollama runs on a workstation elsewhere, 127.0.0.1 in WebBrain refers to the laptop. It does not refer to the Ollama workstation.
With Localtonet, our client runs on the Ollama computer or on another device that can reach it. The client establishes an outbound connection to a Localtonet relay server. An HTTP tunnel provides a public HTTPS URL and forwards requests to the configured local IP address and port. This avoids inbound router port forwarding, firewall changes, VPN setup, and the need for a public IP address.
Ollama validates incoming Host and browser Origin values. A public tunnel hostname may therefore produce 403 Forbidden even though the same API works through localhost. Localtonet documentation supplied for this guide does not establish an HTTP header-rewrite option, so this article does not claim that our tunnel changes the Host header. Test the public API before configuring WebBrain. If necessary, allow the required origin in Ollama or place a reverse proxy in front of Ollama that sets the expected Host header.
Prerequisites and decisions to make first
Prepare each component before exposing the model service. Keeping the stages separate makes it possible to identify whether a failure belongs to WebBrain, Ollama, the Localtonet tunnel, or browser-origin enforcement.
- A current Chrome, Firefox, Edge, or compatible Chromium browser.
- Permission to install an extension or use the browser's temporary development-loading feature.
- An existing Ollama installation on the model-server computer.
- At least one model already installed in that Ollama instance.
- A command-line HTTP client such as
curlfor independent API checks. - A Localtonet account and a connected client device that can reach Ollama.
- The device-specific Localtonet authentication token for that client.
- A decision between a short-lived direct test and a persistent authenticated deployment.
The simplest topology runs the Localtonet client on the same computer as Ollama. The tunnel can then target 127.0.0.1:11434, or a loopback reverse proxy if one is required. Keeping Ollama bound to loopback limits direct LAN exposure while the Localtonet client reaches it locally.
The Localtonet client can instead run on another private-network device, but Ollama must listen on an address reachable from that device. Ollama controls its listening address through OLLAMA_HOST. Changing it from loopback can expose the service to other devices on that network, so make that change only when the architecture requires it and apply appropriate host firewall policy.
| Layer | Independent check | What success proves |
|---|---|---|
| WebBrain extension | Open the side panel and use the managed default on a non-sensitive page. | The extension UI and basic page interaction work. |
| Ollama service | Request /api/tags and /v1/models through loopback. |
Ollama is listening and its model metadata is available locally. |
| Model inference | Send a local request to /v1/chat/completions. |
The selected model can perform an OpenAI-compatible generation. |
| Localtonet tunnel | Request the public /v1/models endpoint with curl. |
The public network path reaches the target and passes Ollama's Host validation. |
| WebBrain provider | Submit a controlled Ask-mode request through the public base URL. | The extension, browser-origin policy, provider settings, tunnel, and model all work together. |
Screenshots should show the relevant interface state without exposing Localtonet device tokens, API credentials, private model names, reusable public endpoints, browser extension identifiers, account details, or private page content. The figures in this guide should be rechecked against the current interfaces whenever the article is updated.
Install and verify WebBrain
Most users should install WebBrain from an official browser marketplace. The current project documents releases through the Chrome Web Store, Firefox Add-ons, and Microsoft Edge Add-ons. Visit the official WebBrain website and follow the installation link for your browser. Confirm the extension identity, review its requested permissions, and complete the browser's normal installation prompt.
After installation, open the WebBrain side panel from its extension icon. Pinning the icon is optional. If the browser requests access to a site, consider whether that access is necessary for the page and task you intend to use.
Optional direct source loading
Developers and reviewers can clone the official repository:
git clone https://github.com/webbrain-one/webbrain.git
For Chrome, open:
chrome://extensions/
Enable Developer mode, select Load unpacked, and choose:
webbrain/src/chrome
For Firefox, open:
about:debugging#/runtime/this-firefox
Select Load Temporary Add-on and choose:
webbrain/src/firefox/manifest.json
Firefox removes temporary add-ons when the browser restarts. Permanent Firefox installation requires signing through addons.mozilla.org. For routine use, the signed marketplace release is more convenient.
The repository also contains build scripts, but a reliable build tutorial must document the current runtime version, dependency installation, bootstrap sequence, and repository-specific development requirements together. Those prerequisites are not established by the evidence available for this revision. This tutorial therefore limits the optional path to the repository's documented direct source directories rather than presenting incomplete npm commands.
Verify the extension before selecting Ollama
Open a non-sensitive webpage
Use a public article or documentation page. Avoid account pages, financial information, private source code, and production administration interfaces during setup.
Open the WebBrain side panel
Click the extension icon and confirm that the prompt interface appears beside the active page.
Use Ask mode
Keep the first test read-only. Ask mode can read the page and answer questions without the broader interaction capabilities of Act or Dev.
Submit a basic request
With the managed default provider still selected, ask WebBrain to summarize the page or list its main headings. A relevant answer confirms that the extension itself works before Ollama and Localtonet are introduced.
Check the extension manager for duplicate installations before continuing. A marketplace copy and source-loaded copy can have different settings and separate storage. Disable the copy you are not testing.
Start Ollama and verify its API locally
Start Ollama using its documented server command if it is not already running:
ollama serve
Keep that process running while performing the following checks. If your operating-system installation manages Ollama as a background service, use its normal service controls instead of starting a duplicate process.
Check the basic service response
curl -i http://127.0.0.1:11434/
A successful response confirms that something is listening on Ollama's expected loopback port. A connection-refused error means that no process accepted the connection at that address and port. Resolve that before creating a tunnel.
Discover installed models through the native API
curl http://127.0.0.1:11434/api/tags
The JSON response lists models known to this Ollama instance. Copy the exact model identifier you intend to use, including any tag shown by the server. Do not substitute a model name from an example if it is not present in this response.
Verify the OpenAI-compatible model list
curl http://127.0.0.1:11434/v1/models
This is the interface relevant to WebBrain. A successful response should contain an OpenAI-style model list. If /api/tags works but /v1/models does not, the problem is local API compatibility rather than Localtonet.
Perform a local OpenAI-compatible generation
Replace YOUR_INSTALLED_MODEL with an exact identifier returned by the model-list check:
curl http://127.0.0.1:11434/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "YOUR_INSTALLED_MODEL",
"messages": [
{
"role": "user",
"content": "Reply with the single word READY."
}
],
"stream": false
}'
A successful JSON response containing an assistant message proves that the model can generate through the same API family WebBrain uses. A model-not-found response means the identifier is wrong or unavailable. A server error during loading or inference belongs to Ollama or the model environment and should be resolved before tunneling.
Do not create the tunnel merely because the Ollama process appears to be running. Verify model discovery and one real completion first. Otherwise, a model-loading failure can be mistaken for a networking problem later.
Create the Localtonet HTTP tunnel
Use an HTTP tunnel because WebBrain communicates with Ollama through HTTP. File Server, proxy tunnels, and VPN Manager address different use cases and are not substitutes for this forwarding configuration.
Install and run the Localtonet client
Run our client on the Ollama computer or on another device that can reach the locally verified service. The client establishes the outbound connection used by the tunnel.
Authenticate or select the client device
Use the device-specific authentication token for the intended client. Keep the token private and confirm that the correct device appears connected.
Select an available relay server
Choose from the relay servers or regions currently available in our dashboard. Do not copy a server code from an old tutorial because availability can vary.
Create the HTTP tunnel configuration
Set the local target to the IP address and port reachable from the Localtonet client. When Ollama and the client share a computer, begin with 127.0.0.1 and port 11434. Select the appropriate HTTP Process Type from Random Sub Domain, Custom Sub Domain, or Custom Domain.
Start the tunnel
Creating the configuration does not start it. Press Start, wait for the tunnel to run, and copy its assigned public HTTPS URL. The endpoint remains available only while the selected client is connected and the tunnel is running.
The current dashboard options should be checked against our HTTP tunnel documentation. Exact relay choices and account-specific options come from the live dashboard.
Test the public API and handle Host or origin failures
Do not enter the endpoint into WebBrain immediately. First test the public API with a command-line client. If the tunnel URL is https://your-assigned-address, request:
curl -i https://your-assigned-address/v1/models
Use the exact HTTPS URL assigned by the running tunnel. The hostname above is only a placeholder. Do not append the local port to an HTTP tunnel URL unless the dashboard explicitly supplies a public host-and-port endpoint.
| Observed result | Likely layer | Next action |
|---|---|---|
| Model-list JSON | Public transport and Host validation succeeded | Perform a public completion test, then configure WebBrain. |
403 Forbidden |
Ollama Host or origin allow-list validation | Use a stable allowed origin where appropriate or put a Host-rewriting reverse proxy in front of Ollama. |
502, gateway error, or connection failure |
Tunnel target or local service reachability | Confirm Ollama, the Localtonet client, tunnel state, local IP, and port. |
| Ollama JSON error | Request or model-server layer | Read the error body and compare the same request against the local API. |
| Command-line request works but WebBrain fails | Browser origin or WebBrain provider configuration | Inspect the browser console and provider settings for CORS, model, endpoint, or credential errors. |
Option A: Configure the required Ollama origins
Ollama uses OLLAMA_ORIGINS to add trusted origins. If the public hostname is stable, add the exact public origin rather than using a broad wildcard, then restart Ollama so the changed environment takes effect. For example, the value would include the real origin in this form:
OLLAMA_ORIGINS=https://your-assigned-address
Browser requests can also carry an extension origin such as a chrome-extension:// or moz-extension:// value. Do not guess it. If the command-line public test succeeds but WebBrain reports a CORS or origin error, inspect the failed request in the browser's extension or developer tools and identify the exact Origin value. Add only the specific trusted origin required by your installation, then restart Ollama and repeat the test.
Environment-variable configuration and service restart steps differ among operating systems and installation methods. Apply OLLAMA_ORIGINS using the same supported service environment mechanism used by your Ollama installation. Confirm the effective behavior with a request rather than assuming that editing a shell variable changed an already-running background service.
A wildcard origin expands which browser contexts can attempt to call the API. Use exact trusted origins where possible. Origin allow-listing is also not user authentication, so it does not make an otherwise unauthenticated public Ollama service suitable for persistent use.
Option B: Put a Host-rewriting reverse proxy in front of Ollama
Ollama's public-tunnel guidance uses a Host header override because a tunnel normally forwards its own public hostname. Since this guide cannot claim that Localtonet rewrites that header, a local reverse proxy is the predictable fallback. The proxy receives the tunnel request and sends it to Ollama with the Host value Ollama expects.
A minimal Nginx server block can listen only on loopback port 8080 and forward to Ollama:
server {
listen 127.0.0.1:8080;
location / {
proxy_pass http://127.0.0.1:11434;
proxy_set_header Host localhost:11434;
}
}
Validate and reload Nginx using the supported procedure for your operating system and installation. Then test the proxy locally before changing Localtonet:
curl -i http://127.0.0.1:8080/v1/models
If that succeeds, change the Localtonet HTTP tunnel target from port 11434 to 8080, restart the tunnel, and repeat the public /v1/models request. The reverse proxy addresses the Host header sent to Ollama. If WebBrain still reports a browser-origin error, configure the required exact origin through Ollama's supported OLLAMA_ORIGINS mechanism.
Binding the example proxy to 127.0.0.1 allows a Localtonet client on the same computer to reach it without opening port 8080 to the LAN. If the client is on another device, the proxy must listen on a reachable private address and should be protected with appropriate firewall policy.
Verify a completion through the public endpoint
After /v1/models succeeds, replace the model placeholder and send a controlled public request:
curl https://your-assigned-address/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "YOUR_INSTALLED_MODEL",
"messages": [
{
"role": "user",
"content": "Reply with the single word REMOTE."
}
],
"stream": false
}'
This test proves that the public endpoint can perform inference independently of WebBrain. If model discovery works publicly but completion fails, compare the response with the same request sent locally. The tunnel cannot make an unavailable model load successfully.
Configure WebBrain for the remote Ollama server
Open WebBrain's Settings and go to its provider or model configuration. The current project includes an Ollama provider card and also supports generic OpenAI-compatible providers. Choose the Ollama card for a standard Ollama server. Use a generic OpenAI-compatible provider only when your gateway requires that configuration.
Choose the Ollama provider
In WebBrain Settings, select the Ollama provider card for this configuration. Confirm that you are editing the provider used by the active browser profile and extension installation.
Enter the public base URL
Enter the exact Localtonet public HTTPS URL followed by /v1, such as https://your-assigned-address/v1. Do not enter the Localtonet device token or append Ollama's local port.
Select or discover the model
If the interface offers model discovery, refresh it after the endpoint is reachable and choose a model returned by this Ollama server. Otherwise, enter the exact identifier returned by /api/tags or /v1/models. WebBrain also documents an optional Model field that can remain blank so loaded-model capability is rechecked on each user turn.
Review credentials and research sharing
A direct local Ollama service normally does not require an API key. If an authenticated gateway is in front of Ollama, enter only the credential format required by that gateway. Keep the provider-specific Share queries for research switch off unless you deliberately want to participate.
Save and confirm the configuration
Use the save or apply control shown by the installed WebBrain version. If the current interface persists fields immediately, close and reopen Settings and confirm that the selected provider, endpoint, and model remain present.
Send a controlled Ask-mode request
Open a non-sensitive page, select Ask mode, and request a short summary. Confirm that the answer relates to the active page and that no provider or browser-origin error appears.
Understand WebBrain's research-sharing control
For local and bring-your-own providers, WebBrain's provider-specific Share queries for research switch is documented as off by default. When enabled, it can share a scrubbed prompt and response plus a bounded, content-free diagnostic timeline for that provider's model attempts, including failed runs. The diagnostic timeline can contain tool names, outcomes, error codes, and timings, but not tool arguments, page content, or screenshots.
A failure before normal generation can still contribute a bounded model-facing request and final blocker when sharing is enabled. Turning the switch off also purges queued diagnostics. Review this setting for the specific provider rather than assuming that using a local model alone determines all research-sharing behavior.
Distinguish provider errors from tunnel errors
A tunnel failure usually appears before Ollama can return a meaningful model response. Examples include DNS failure, connection failure, gateway errors, or inability to reach the local target. A provider failure occurs after the endpoint is reachable and can include an invalid model identifier, unsupported request behavior, missing gateway credentials, or an Ollama error response.
A browser CORS failure occupies a third category. The command-line public test can succeed while the browser blocks WebBrain from reading the response. Look for an Origin or CORS message in the relevant developer console, identify the exact rejected origin, and update the narrow Ollama origin policy. Do not rebuild the tunnel merely because a browser-only request was rejected.
Security and privacy considerations
Local inference can keep model execution on hardware you control, but the remote browser still sends prompts and page context to the public endpoint. The tunnel makes the target reachable. It does not add application authentication to an Ollama service that does not already require it.
Use direct unauthenticated publication only for a short test
A direct Localtonet HTTP tunnel to Ollama can be useful for a controlled validation window. Start it immediately before testing, avoid sensitive page content, do not share the URL, and stop it as soon as the test is complete. A difficult-to-guess URL is not a durable authorization mechanism.
For persistent access, place a compatible authenticated gateway in front of Ollama and tunnel the gateway rather than the bare model API. The gateway should enforce the access policy required by your environment. Confirm that its authentication format is supported by the WebBrain provider configuration you choose.
Use least-capability browser modes
Ask mode is read-only and is the safest starting point. Act can click, type, navigate, upload, download, and fill forms. Dev adds page source, styles, console and network context, plus reversible page edits. Use Act or Dev only when the task requires those capabilities, and review plans and permission prompts before consequential actions.
Separate Localtonet identity from API authorization
A Localtonet authentication token identifies the client device that carries a tunnel. It is not an Ollama API key and should never be entered into WebBrain. The public tunnel URL is also not the device token, but it should still be treated as sensitive when it leads to an unauthenticated service.
Restrict origins without confusing them with authentication
OLLAMA_ORIGINS controls which browser origins Ollama accepts. Host rewriting determines which Host value Ollama receives. Neither mechanism verifies the identity of an individual user. A persistent deployment still needs an appropriate authentication and authorization layer.
Test with low-risk content
Use public documentation during installation and connectivity checks. Avoid financial dashboards, authentication pages, health information, private code, confidential files, customer records, and production administration panels. Prove the architecture before evaluating higher-risk workflows.
Routine operation and safe shutdown
Use a consistent startup sequence so each dependency can be checked before the next one:
- Start Ollama and request the local
/v1/modelsendpoint. - If used, start or verify the local reverse proxy and test its
/v1/modelsendpoint. - Run the Localtonet client on the device that can reach the selected target.
- Start the saved HTTP tunnel.
- Request the public
/v1/modelsendpoint. - Confirm that WebBrain still uses the correct HTTPS base URL with
/v1. - Begin with a low-risk Ask-mode request.
- Use Act or Dev only when required.
If the Ollama port, proxy port, listening address, or host computer changes, update and retest the Localtonet target. If the public URL changes, update WebBrain and any exact OLLAMA_ORIGINS entry that referred to the old origin.
For shutdown, stop the Localtonet tunnel first to end public reachability. Then stop the reverse proxy or Ollama if your operating policy does not require them to remain available locally. You can retain the stopped tunnel configuration for later use or delete it when it is no longer needed.
Document which machine owns the model, which Localtonet device carries the tunnel, whether the target is Ollama or a reverse proxy, which provider is active in WebBrain, and who is authorized to use the endpoint. Keep tokens, gateway credentials, private model names, and reusable URLs out of screenshots and support transcripts.
Troubleshooting WebBrain, Ollama, and Localtonet
The WebBrain icon or side panel does not appear
Confirm that the extension is installed and enabled. For a source-loaded Chrome copy, verify that the selected directory is webbrain/src/chrome. For Firefox, reload webbrain/src/firefox/manifest.json after a browser restart because temporary add-ons are removed. Disable duplicate store and source installations.
The local Ollama connection is refused
Confirm that Ollama is running and listening at the address used by the request. Test http://127.0.0.1:11434/ on the Ollama host. If the Localtonet client runs on another machine, loopback is not reachable from that client and Ollama or the reverse proxy must listen on an appropriate private address.
/api/tags works but generation fails
Model metadata can be available even when inference fails. Verify the exact model identifier, check the Ollama error body, and repeat the same completion locally. Resolve model loading, memory, or server errors before testing remotely.
The public endpoint returns 403
This commonly indicates Ollama's Host or origin validation. Localtonet is forwarding the public request, but this guide does not assume that it rewrites the Host header. Add the exact trusted origin through Ollama's supported configuration where appropriate, or tunnel a local reverse proxy that sets Host to localhost:11434.
The public endpoint returns a gateway or target error
Confirm that the Localtonet client is connected, the tunnel is started, and the local target is correct from the client's perspective. Test that exact target on the client device. If the tunnel now points to port 8080, verify that the reverse proxy is running there.
curl works but WebBrain reports CORS or Origin errors
Command-line clients do not enforce browser CORS policy. Inspect the failed browser request to find the exact Origin value. Add only the required trusted origin to Ollama through OLLAMA_ORIGINS, restart the Ollama service, and retest. Do not assume the public hostname and extension origin are the same value.
WebBrain reports that the model does not exist
Compare its configured model field with the exact identifiers returned by /api/tags or /v1/models. Tags are part of the identifier. If model discovery is available, refresh it after changing the endpoint. Alternatively, leave WebBrain's optional Model field blank when that behavior is suitable so loaded-model capability is checked again on each turn.
WebBrain works with its managed provider but not Ollama
This confirms the extension itself is operational. Recheck the selected provider, the HTTPS base URL, the /v1 suffix, the model identifier, and any authenticated gateway requirements. Then compare WebBrain's failure with the independent public completion test.
The tunnel worked and then stopped
Ollama must remain running, any reverse proxy must remain running, the Localtonet client must remain connected, and the tunnel must remain started. A saved tunnel configuration is not evidence that the tunnel is currently active.
Responses fail on large pages
WebBrain documents automatic context-window detection for Ollama and automatic conversation compaction, but fixed instructions, tool schemas, page content, history, and requested output still consume context. Its documented 16k value is a fallback rather than a guaranteed minimum. Try a model with a larger usable context window, shorten the conversation, narrow the task, or use a smaller page.
Remote generation is slow
Send a comparable request locally. If local inference is already slow, the model, context size, workload, or server hardware is the likely constraint. If local inference succeeds but the public request fails, diagnose connectivity and policy without assuming a performance guarantee from the tunnel.
Frequently asked questions
Does WebBrain itself need a Localtonet tunnel?
No. WebBrain is the browser-side API client. The tunnel targets Ollama or a gateway or reverse proxy in front of Ollama.
What URL should I enter in WebBrain?
For a same-computer setup, the typical Ollama base URL is http://127.0.0.1:11434/v1. For this remote workflow, use the exact public HTTPS URL assigned to the running Localtonet HTTP tunnel and append /v1.
Why does Ollama return 403 through the tunnel?
Ollama validates Host and Origin values. A public tunnel hostname may not be accepted even though localhost works. Configure the exact trusted origin where appropriate or place a reverse proxy in front of Ollama that sets the expected Host header. This guide does not claim that Localtonet rewrites request headers.
Why does curl work while WebBrain fails?
A successful curl request proves public API reachability, but curl does not enforce browser CORS policy. WebBrain can still fail because its browser extension origin is not allowed, the wrong provider is selected, the model name is invalid, or a gateway credential is missing.
Does Ollama require an API key?
A standard local Ollama service normally does not require an API key. That is why direct publication should be temporary. For persistent remote use, put compatible authentication in front of Ollama rather than relying on URL secrecy or CORS alone.
Can the Localtonet client run on another machine?
Yes, provided that device can reach the Ollama service or reverse proxy. Do not configure 127.0.0.1 unless the target runs on the same device as the Localtonet client.
Why is a newly created Localtonet tunnel unavailable?
Creating a tunnel saves its configuration but does not start it. The selected client must be connected, and you must press Start. The configured local service must also be running and reachable.
Is WebBrain research sharing enabled automatically for Ollama?
No. WebBrain documents the provider-specific Share queries for research switch as off by default for local and bring-your-own providers. Review the switch for the configured provider and leave it off unless you deliberately choose to participate.
Will Localtonet make Ollama generate faster?
This workflow provides reachability, not model acceleration. Generation speed still depends on the Ollama host, model, context size, and workload. We do not claim a fixed latency or performance improvement.
Connect a verified Ollama endpoint with Localtonet
Verify Ollama and its model locally, create an HTTP tunnel, resolve Host and origin policy deliberately, and test the public API before adding it to WebBrain. Keep direct unauthenticated exposure short-lived and stop the tunnel when remote access is no longer required.
Get Started Free โ