THE WORLD IS NOT STANDING STILL.RSS
BIG CHANGE.
BIG CHANGE, one tap away
BIG CHANGE, one tap away

Make room for the big picture.

Add BIG CHANGE to your home screen or desktop. It opens in its own window, with the latest stories when you’re online.

iPhone & iPad
Open bigchange.ai in Safari. Tap Share, then Add to Home Screen. Turn on Open as Web App if shown, then tap Add.
Android
Open bigchange.ai in Chrome. In the browser menu, choose Install app or Add to Home screen.
Desktop
In Chrome or Edge, use the install icon in the address bar or the browser’s app menu. In Safari on Mac, choose File → Add to Dock.

Markdown edition

# Run a local Ollama model and check its chat API

> Install Ollama, choose a downloaded model, check its terminal answers and send the same prompt to its localhost chat API. Verify the model and cloud boundary before calling the setup local-only.

By BIG CHANGE Editorial

Published: 2026-10-20T14:31:39.416Z
Updated: 2026-10-20T14:31:39.416Z
Canonical: https://bigchange.ai/blog/run-local-ollama-model-chat-api-guide

![Conceptual charcoal illustration of a closed desktop computer tower beside a keyboard and an angled monitor showing indistinct terminal marks.](https://bigchange.ai/api/media/file/ollama-local-chat-api-desktop-hero-v2.png)
AI-generated conceptual illustration by BIG CHANGE.

Ollama can run a downloaded model on your computer and serve it at a local HTTP address. This guide takes one model from installation through terminal chat and a complete API reply, using the same model name at each step. It is a documentation-based procedure: BIG CHANGE has not installed the software or observed the results on your machine.

## The big change

- **What changed:** Ollama offers a direct route from a downloaded model to both terminal chat and a local API. A beginner can check the model name and response at each interface instead of assuming that a chat window proves where inference ran.
- **Why it matters:** The local server and Ollama's cloud API are different destinations. Someone handling an approved work or personal task can keep this exercise on their own computer by choosing a downloaded model and addressing `localhost`, while checking the server's configuration separately.
- **What to watch:** A local URL alone does not establish that every feature or connected app stays local. Ollama can also use cloud models through its local server. The decisive checks are the installed model tag, the request destination, the server bind address and, when strict local-only operation is required, the cloud-disable log after a restart.

## Before you start

Use a computer where you are allowed to install software. Pick a harmless factual question whose answer you can check in an original document you have open. Paste that question when the commands ask for a practice prompt; do not enter private or regulated material merely to test the setup. Keep the document available to check the answer, because a fluent reply is not proof of accuracy.

You need storage for Ollama and the model, enough memory to load your chosen model, and an internet connection for installation and download. [Ollama's quickstart](https://docs.ollama.com/quickstart) uses `gemma4:e2b` as its local example and recommends 8 GB of available VRAM, or unified memory on a Mac. Ollama says it can fall back to system RAM with slower responses. Inspect the [current model listing](https://ollama.com/library/gemma4:e2b) for the exact tag, download size and license before proceeding. A download size does not establish that your computer can run the model. If it does not fit your machine or permitted use, choose a smaller *downloadable local* model from the [library](https://ollama.com/library) and replace `gemma4:e2b` in **every** command below with its exact tag. Do not select a `:cloud` tag for this exercise.

## 1. Install Ollama and check the local server

Get Ollama from its [official download page](https://ollama.com/download) and follow the instructions for your operating system: [Windows](https://docs.ollama.com/windows), [macOS](https://docs.ollama.com/macos) or [Linux](https://docs.ollama.com/linux). On Windows and macOS, open the installed app. On Linux, follow your chosen installation method and start its service; if no service is running, the [quickstart](https://docs.ollama.com/quickstart) says to run `ollama serve` in a separate terminal. Do not start a second server over an app or service that is already listening.

In a new terminal, check the installed version and that the local server responds:

```shell
ollama -v
ollama ls
```

Record the actual version and operating system. The model list may be empty before your first pull; a command or connection error means you should resolve the installation or server startup before continuing. Ollama's [FAQ](https://docs.ollama.com/faq) says its default listener is `127.0.0.1:11434`. Leave it on loopback for this exercise; do not configure a network bind, proxy or tunnel.

## 2. Download one exact local model

After checking the model listing, run:

```shell
ollama pull gemma4:e2b
ollama ls
```

The exact tag must appear in `ollama ls` after the pull. Record the tag, listed size and the license shown on its model page. If the pull fails or the tag is absent, check the spelling against the current library, free disk space, network access and any proxy or permission error before retrying. A partial download is not a successful setup.

## 3. Check interactive and one-off terminal chat

Start an interactive chat:

```shell
ollama run gemma4:e2b
```

Paste your approved practice question at the chat prompt. Inspect the reply against the document you used to make the question, then type `/bye` to exit. Keep the question and actual reply for your own check; this article supplies no sample result.

For a separate one-off run, use the **same** question. In PowerShell on Windows:

```powershell
$practicePrompt = Read-Host 'Paste your approved practice question'
ollama run gemma4:e2b $practicePrompt
```

In a Bash terminal on macOS or Linux:

```bash
read -r -p 'Paste your approved practice question: ' practice_prompt
ollama run gemma4:e2b "$practice_prompt"
```

Check the actual one-off answer against the same source. The two answers need not use identical wording; the useful check is that both commands ran the intended tag and that any factual claim survives comparison with the source.

## 4. Ask the same model through localhost

The [chat API](https://docs.ollama.com/api/chat) takes a model name and messages at `POST /api/chat`. It streams by default; `stream: false` asks for one complete JSON response. The [API introduction](https://docs.ollama.com/api/introduction) distinguishes the local base URL, `http://localhost:11434/api`, from the direct cloud URL, `https://ollama.com/api`. The local request needs no API key.

On Windows, PowerShell can build the JSON safely from the question you paste:

```powershell
$practicePrompt = Read-Host 'Paste the same approved practice question'
$body = @{ model = 'gemma4:e2b'; messages = @(@{ role = 'user'; content = $practicePrompt }); stream = $false } | ConvertTo-Json -Depth 5
$response = Invoke-RestMethod -Uri 'http://localhost:11434/api/chat' -Method Post -ContentType 'application/json; charset=utf-8' -Body $body
$response | Select-Object model, done
$response.message.content
```

On macOS or Linux, the following Bash example uses Python 3 only to escape your prompt into JSON. Check that `python3` and `curl` are installed before using it:

```bash
read -r -p 'Paste the same approved practice question: ' practice_prompt
export practice_prompt
python3 -c 'import json,os; print(json.dumps({"model":"gemma4:e2b","messages":[{"role":"user","content":os.environ["practice_prompt"]}],"stream":False}))' | curl -fsS 'http://localhost:11434/api/chat' -H 'Content-Type: application/json' --data-binary @-
```

The request should return HTTP success and one JSON object whose `model` matches your downloaded tag, `done` is `true`, and `message.content` is nonempty. Read and check the actual answer against your source. A successful response establishes this request's local destination and selected model; keep your own output rather than relying on an example transcript.

## 5. Check placement and the local-only boundary

While the model is loaded, run:

```shell
ollama ps
```

The `PROCESSOR` column reports whether the model is loaded on the CPU, GPU or both, according to Ollama's [FAQ](https://docs.ollama.com/faq). Record what your machine actually shows. If it has already unloaded, send another prompt and check again. You can unload it when finished with `ollama stop gemma4:e2b`; removal with `ollama rm gemma4:e2b` is optional disk cleanup after you have saved your observations.

For a strict Ollama local-only setup, follow the [official cloud-disable instructions](https://docs.ollama.com/faq): put `disable_ollama_cloud` in `~/.ollama/server.json` for the account **running the Ollama server** (the `.ollama` folder in that account's user profile on Windows), retaining any other existing JSON settings:

```json
{
  "disable_ollama_cloud": true
}
```

On Linux, the [documented systemd service](https://docs.ollama.com/linux) runs as `User=ollama`, whose home is `/usr/share/ollama`; editing your own home file would not configure that service. For a systemd installation, you can instead use Ollama's documented `OLLAMA_NO_CLOUD=1` alternative in a service override. First inspect the existing service with `systemctl cat ollama.service`, then open an override with `sudo systemctl edit ollama.service`. Add the following under `[Service]`, preserving any other override settings:

```plaintext
[Service]
Environment="OLLAMA_NO_CLOUD=1"
```

Save the override, then reload and restart the service:

```bash
sudo systemctl daemon-reload
sudo systemctl restart ollama.service
```

Restart the Ollama app on Windows or macOS after changing its configuration. Check the server log for the exact line `Ollama cloud disabled: true`. On Windows the documented log is `%LOCALAPPDATA%\Ollama\server.log`; on macOS it is `~/.ollama/logs/server.log`; on a Linux systemd installation use `journalctl -e -u ollama`. An environment variable set in an unrelated terminal will not necessarily reach an already running app or service. Disabling cloud features removes Ollama cloud models and web search. If the log does not confirm the setting, fix the configuration and restart before describing the setup as local-only.

Confirm the listener is still on `127.0.0.1:11434` in the server log or with your operating system's listener inspection, and repeat the localhost request with the downloaded tag. `OLLAMA_HOST` can change the bind address, so inspect the running server rather than assuming its default. A separate Python library, browser interface, coding agent or other connected application needs its own endpoint and data-path check; Ollama's local response does not establish that application's privacy behavior.

On Windows, inspect the listening address in PowerShell:

```powershell
Get-NetTCPConnection -LocalPort 11434 -State Listen | Select-Object LocalAddress, LocalPort
```

On macOS, use `lsof -nP -iTCP:11434 -sTCP:LISTEN`; on Linux, use `ss -ltn '( sport = :11434 )'`. If a platform tool is unavailable, check the server log. A wildcard or non-loopback listener needs investigation before treating the API as confined to this computer.

## If a check fails

If `ollama -v` or `ollama ls` fails, return to the applicable operating-system installation and startup page. A refused localhost connection usually means the app or service is stopped or listening somewhere else; verify its logs and bind address instead of exposing the API on a network. If a response arrives as multiple JSON lines, make sure your request contains `"stream": false`. If the model runs out of memory or is impractically slow, check `ollama ps` and select a genuinely smaller local tag from the library, then repeat the pull, terminal and API checks with that one tag. Treat any stage you have not completed as unverified.

This local exercise needs hardware, electricity and download storage, but no Ollama API key or paid API account. A model's license can limit your intended use. Cloud models and optional third-party clients have separate terms and data paths. For a deeper hardware purchasing comparison, see our [128 GB local-model guide](https://bigchange.ai/blog/run-local-models-128gb-memory-cost); for a distinct coding task that uses Ollama with Claude Code, see our [checked-change guide](https://bigchange.ai/blog/claude-code-local-ollama-checked-change-guide).

## Sources & further reading

- [Ollama quickstart](https://docs.ollama.com/quickstart) explains the installation route, local `gemma4:e2b` example and memory recommendation. Its example is documentation, not a test of your machine.
- [CLI reference](https://docs.ollama.com/cli) lists the current `pull`, `run`, `ls`, `ps`, `stop`, `rm` and `serve` commands used here.
- [API introduction](https://docs.ollama.com/api/introduction) and [chat endpoint](https://docs.ollama.com/api/chat) separate the local and cloud addresses and define the nonstreaming request and response fields.
- [FAQ](https://docs.ollama.com/faq) documents loopback binding, processor placement and the cloud-disable setting and log check.
- [Gemma 4 E2B listing](https://ollama.com/library/gemma4:e2b) provides the current exact model tag, size and license materials to check before downloading.

## Sources

- [Ollama quickstart](https://docs.ollama.com/quickstart) — Official install entry point and local gemma4:e2b example, including pull, run, /bye, API request and memory recommendation. It does not establish a reader's hardware fit or actual result.
- [Ollama CLI reference](https://docs.ollama.com/cli) — Current pull, run, ls, ps, stop, rm and serve commands. No terminal run was performed for this article.
- [Ollama API introduction](https://docs.ollama.com/api/introduction) — Distinguishes localhost and direct cloud base URLs and local no-key access. Local servers can still access cloud models when enabled.
- [Ollama chat endpoint](https://docs.ollama.com/api/chat) — Defines model/messages request, default streaming, stream:false and complete model, done and message.content fields. It cannot prove a reader's response.
- [Ollama FAQ](https://docs.ollama.com/faq) — Documents default loopback binding, processor placement, cloud-disable configuration, restart and log indicator. Other client applications have separate data paths.
- [Ollama Gemma 4 E2B listing](https://ollama.com/library/gemma4:e2b) — Provides the exact example tag and current artifact/license materials. Readers must inspect live size, rights and machine capacity before pulling.
- [Ollama Windows installation](https://docs.ollama.com/windows) — Platform installation, CLI/background server behavior and server log location; does not establish the reader's installed version.
- [Ollama macOS installation](https://docs.ollama.com/macos) — Platform installation, app/CLI behavior and server log location; does not establish the reader's installed version.
- [Ollama Linux installation](https://docs.ollama.com/linux) — Platform installation and manual/service startup and journal instructions; readers must follow their actual configuration.