Ollama: Full Tutorial for Beginners
Ollama for beginners, start to finish on a real laptop with no graphics card: install it on Linux (and where to get it for Mac and Windows), pull and run Llama 3.2, chat, read the speed with --verbose, see what is loaded with ollama ps, why an 8 GB model crashes with only 'EOF' (the out-of-memory killer) and how to pick a model that fits your memory, build your own model with a Modelfile, the long-input trap (a log cut short by the 4096-token default context) and the num_ctx fix, the REST API on port 11434 (/api/generate, /api/chat and its history, Python, the OpenAI-compatible /v1 endpoint), and letting another computer use it safely with OLLAMA_HOST.

AI on your own computer
Here's how to run AI models on your own computer with Ollama. Same laptop, two models: one crashes, one answers.

No account, no API key, and nothing leaves your machine. By the end, you'll know why the big one failed, and how to pick, build and call one that works.
ollama run gemma4:12b "Hello!"Error: Post "http://127.0.0.1:11434/api/generate": EOF
ollama run llama3.2 "In one sentence, what is a log file?"A log file is a record of events, activities, or errors that occur during a software application, system operation, or process execution, typically in a text or digital format.
What Ollama is
Think of a music app. A store with millions of songs. You download the ones you like, they stay on your phone, and you press play, even with no signal.
Ollama works the same way with AI models. The store is ollama.com. pull downloads a model. list shows what's on your computer. And run presses play.

Here's the whole system. Ollama is a server: a program that runs in the background on your computer, and waits for questions. You talk to it with the ollama command, or from your own app. It downloads a model from ollama.com once, keeps the files on your disk, and loads them into memory to answer. A model is one big file of numbers, trained to predict the next word. The first one we'll use, Meta's Llama 3.2, came out in September 2024, in sizes made for phones and laptops. Apart from that one download, everything here runs on your computer.
Install it
Here's the computer for this tutorial: a laptop running Ubuntu Linux, with no graphics card. free dash h shows its memory: 7.7 gigabytes in total, 7.1 available. Remember that number: in this video, memory decides almost everything. And Ollama isn't installed yet. The lab files and every command are linked in the description, so you can follow along.
free -htotal used free shared buff/cache available Mem: 7.7Gi 650Mi 6.9Gi 224Ki 377Mi 7.1Gi Swap: 1.0Gi 23Mi 1.0Gi
ollama --versionbash: ollama: command not found
On a Mac or on Windows, you download the app from ollama.com. On Linux, it's one command. curl downloads Ollama's install script, and the pipe hands it to sh, the shell, to run. In 46 seconds, it installs the ollama program, creates a user called ollama to run it, and sets it up as a service: a program Linux starts at boot and keeps running. You'll see one warning: it found no NVIDIA or AMD graphics card. That's expected on this laptop, so Ollama will use the CPU instead.
curl -fsSL https://ollama.com/install.sh | sh>>> Installing ollama to /usr/local >>> Downloading ollama-linux-arm64.tar.zst >>> Creating ollama user... >>> Adding ollama user to video group... >>> Adding current user to ollama group... >>> Creating ollama systemd service... >>> Enabling and starting ollama service... Created symlink /etc/systemd/system/default.target.wants/ollama.service → /etc/systemd/system/ollama.service. WARNING: Unable to detect NVIDIA/AMD GPU. Install lspci or lshw to automatically detect and install GPU dependencies.
Check it. ollama dash dash version: 0.40.19. systemctl status: enabled, so it starts at boot, and active, running now. The server has an address: localhost, which means this computer, and port 11434: a port is a numbered door that one program listens at. ss lists those doors: 127.0.0.1, port 11434. 127.0.0.1 is localhost as a number. And curl, a tool that sends web requests, gets a plain answer: Ollama is running.
ollama --versionollama version is 0.40.19
systemctl status ollama --no-pager -n 0● ollama.service - Ollama Service Loaded: loaded (/etc/systemd/system/ollama.service; enabled; preset: enabled) Active: active (running) since Wed 2026-12-02 22:29:22 UTC; 11s ago Main PID: 228 (ollama) Tasks: 12 (limit: 9563) Memory: 15.9M (peak: 35.9M) CPU: 65ms CGroup: /system.slice/ollama.service └─228 /usr/local/bin/ollama serve
ss -ltn 'sport = :11434'State Recv-Q Send-Q Local Address:Port Peer Address:Port Process LISTEN 0 4096 127.0.0.1:11434 0.0.0.0:*
curl localhost:11434; echoOllama is running
Your first model
ollama list shows the models here: none yet. ollama pull llama3.2 downloads Llama 3.2 from the library. Guess first: this model has 3.2 billion parameters, the numbers it learned in training. How big is the download? Two gigabytes. It took 29 seconds here. And before it says success, Ollama checks the file's fingerprint, the sha256 digest, so you know nothing got corrupted on the way.
ollama listNAME ID SIZE MODIFIED
ollama pull llama3.2pulling manifest pulling dde5aa3fc5ff: 100% ▕█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ ▏ 2.0 GB/2.0 GB 93 MB/s 0s pulling 34bb5ab01051: 100% ▕██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ 561 B verifying sha256 digest writing manifest success
But why only two gigabytes? At 16 bits, two bytes each, 3.2 billion numbers fill 6.4 gigabytes. At 8 bits, one byte each: 3.2. Ollama's models are rounded further, to about five bits a number, on average. That's called quantization. The answers get a little less precise, and the model fits on an ordinary laptop.

ollama show prints the model's card. Parameters: 3.2B, for 3.2 billion. Quantization: Q4_K_M: mostly four bits a number, with a few parts kept at more. That's where the average of about five comes from. And context length: 131,072. That's how much text the model can read at once, counted in tokens: pieces of text, often a short word, sometimes part of a longer one. Keep that number in mind. It comes back, with a catch.
ollama show llama3.2Model architecture llama parameters 3.2B context length 131072 embedding length 3072 quantization Q4_K_M template source go_template Capabilities completion tools Parameters stop "<|start_header_id|>" stop "<|end_header_id|>" stop "<|eot_id|>" License LLAMA 3.2 COMMUNITY LICENSE AGREEMENT Llama 3.2 Version Release Date: September 25, 2024 ...
Ask it something
Now ask it something: ollama run, the model, and your question in quotes. The answer arrives word by word, in about 8 seconds, loading included. Nothing left this laptop: the model and the answer are both right here.
Leave the question off, and you get a chat. Three arrows mean it's waiting for you. Tell it your web server is called web-7. Then ask what it's called. It remembers, because the ollama command sends the whole chat again with every message. Type slash bye to end the chat.
ollama run llama3.2>>> My web server is called web-7. Reply with one word: OK. OK. >>> What is my web server called? web-7. >>> /bye
Ask the same question twice. Write a one-line motto for a web server. Guess first: will you get the same answer both times? No. Two different answers. A model picks each next word with a little randomness, and a setting called temperature sets how much. That's good for ideas, and bad when you want the same answer every time. You'll fix that in your own model soon.
ollama run llama3.2 "Write a one-line motto for a web server.""Reliable, resilient, and responsive: Serving the web, one connection at a time."
ollama run llama3.2 "Write a one-line motto for a web server.""Serving stability, securing reliability, and scaling with precision."
How fast is it? Add dash dash verbose. 49 tokens in about 2.4 seconds: an eval rate of 20.10 tokens a second, on the CPU alone. That's how fast it writes. The prompt eval rate, 24.06, is how fast it reads your words.
ollama run llama3.2 --verbose "Explain a 404 error in one sentence."A 404 error, short for "Not Found," is a web page error that occurs when a user attempts to access a URL that does not exist or has been removed, resulting in a message indicating that the requested page cannot be found. total duration: 3.068797668s load duration: 1.253333ms prompt eval count: 35 token(s) prompt eval cached: 20 token(s) prompt eval duration: 623.497ms prompt eval rate: 24.06 tokens/s eval count: 49 token(s) eval duration: 2.437439s eval rate: 20.10 tokens/s
ollama ps shows what's loaded right now. Guess first: the file on disk is two gigabytes. How much memory does it take once it's loaded? More. 2.9 gigabytes. The extra is working space for the context. 100 percent CPU, which means the whole model sits in the computer's ordinary memory, not on a graphics card. Context: 4,096 tokens, not the 131,072 from the card. That's the catch, and it bites later. Ollama keeps a model loaded for five minutes after you use it. ollama stop frees it now.
ollama psNAME ID SIZE PROCESSOR CONTEXT RUNNER UNTIL llama3.2:latest a80c4f17acd5 2.9 GB 100% CPU 4096 llamacpp 4 minutes from now
ollama stop llama3.2; ollama psNAME ID SIZE PROCESSOR CONTEXT RUNNER UNTIL
A smaller size: ollama pull llama3.2 colon 1b, 1.3 gigabytes. The same question with dash dash verbose: 39.78 tokens a second, against 20.10 for the 3B, and ps shows 1.8 gigabytes of memory. Smaller models are faster and lighter, and their answers are usually less careful. We'll keep the 3B, so ollama rm deletes the 1B.
ollama pull llama3.2:1bpulling manifest pulling 74701a8c35f6: 100% ▕████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ ▏ 1.3 GB/1.3 GB 106 MB/s 0s pulling 966de95ca8a6: 100% ▕██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ 1.4 KB pulling fcc5a6bec9da: 100% ▕██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ 7.7 KB pulling a70ff7e570d9: 100% ▕██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ 6.0 KB pulling 4f659a1e86d7: 100% ▕██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ 485 B verifying sha256 digest writing manifest success
ollama run llama3.2:1b --verbose "Explain a 404 error in one sentence."A 404 error is a type of internet error that occurs when a webpage or resource on a website cannot be found, indicating that the requested URL is not accessible or has been removed. total duration: 2.410928833s load duration: 1.295171625s prompt eval count: 35 token(s) prompt eval duration: 159.178ms prompt eval rate: 219.88 tokens/s eval count: 38 token(s) eval duration: 955.142ms eval rate: 39.78 tokens/s
ollama psNAME ID SIZE PROCESSOR CONTEXT RUNNER UNTIL llama3.2:1b baf6a787fdff 1.8 GB 100% CPU 4096 llamacpp 4 minutes from now
ollama stop llama3.2:1b; ollama rm llama3.2:1bdeleted 'llama3.2:1b'
A model too big
Bigger models usually give better answers. So try one: Google's Gemma 4, the 12B size. It's 8.0 gigabytes, and the download takes 90 seconds. ollama list now shows both: 8.0 and 2.0.
ollama pull gemma4:12bpulling manifest pulling 0cb0cd0a5c49: 98% ▕████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ ▏ 171 MB/175 MB 53 MB/s 0s pulling bb722270d543: 100% ▕█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ ▏ 7.4 GB/7.4 GB 105 MB/s 0s pulling 7008a656050b: 100% ▕████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ ▏ 463 MB/465 MB 108 MB/s 0s pulling e5ca99f91896: 100% ▕██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ 242 B verifying sha256 digest writing manifest success
ollama listNAME ID SIZE MODIFIED gemma4:12b 6114515d63c1 8.0 GB 5 seconds ago llama3.2:latest a80c4f17acd5 2.0 GB 3 minutes ago
Now run it. After 14 seconds: Error, EOF. EOF means end of file: the server hung up in the middle. That tells you nothing. The service's log does. journalctl reads a service's log on Linux, and grep keeps the lines that mention OOM, short for out of memory. And there it is: killed by the OOM killer. Linux ran out of memory, and stopped the biggest program to save itself. Then systemd, Linux's service manager, started Ollama again, by itself.
journalctl -u ollama --no-pager | grep -i 'oom'Dec 02 22:33:54 laptop systemd[1]: ollama.service: A process of this unit has been killed by the OOM killer. Dec 02 22:33:54 laptop systemd[1]: ollama.service: Failed with result 'oom-kill'.
So here's the rule. Llama 3.2 takes 2.0 gigabytes on disk, and 2.9 once it's loaded: the file, plus working space. Gemma 12B is 8.0 on disk, before any working space: nearly all of this laptop's memory. So pick a file well under your free memory. To see yours: free dash h, or your system monitor.

Gemma 4 also comes smaller: the E2B size, 4.6 gigabytes, well under this laptop's memory. Run it, and it answers, thinking out loud first. Then ollama rm deletes the 12B you can't use.
ollama pull gemma4:e2bpulling manifest pulling 6dd7ac24fe13: 100% ▕█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ ▏ 3.5 GB/3.5 GB 90 MB/s 0s pulling 7ba3bbacdf1b: 100% ▕█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ ▏ 986 MB/986 MB 79 MB/s 0s pulling dd57b3b7308f: 100% ▕████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ ▏ 97 MB/ 97 MB 81 MB/s 0s pulling b507b9c2f6ca: 100% ▕██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ 13 B pulling 2365fbb6d97b: 100% ▕██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ 64 B pulling 3ff8a734c316: 100% ▕██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ 241 B verifying sha256 digest writing manifest success
ollama run gemma4:e2b "Hello!"Thinking... Thinking Process: 1. **Analyze the input:** The input is "Hello!". 2. **Determine the intent:** This is a standard greeting. 3. **Formulate an appropriate response:** A friendly, welcoming, and conversational response is expected. 4. **Standard response components:** * A reciprocal greeting (e.g., Hello, Hi). * An inquiry about the user's well-being or purpose (e.g., How can I help?). 5. **Draft the response:** Keep it concise and open-ended. *(Self-Correction/Refinement: Keep it simple and positive.)* 6. **Final Output Generation.** ...done thinking. Hello! How can I help you today?
ollama rm gemma4:12bdeleted 'gemma4:12b'
Your own model: a Modelfile
Remember the two different mottos? For reading logs, you want the same answer every time, and you don't want to repeat your instructions in every question. A Modelfile fixes both: a text file with a few lines. FROM picks the base model. PARAMETER temperature 0 takes the randomness out, so answers stay steady. SYSTEM is an instruction it follows in every chat: read server logs, and answer in one short sentence.
cat ModelfileFROM llama3.2 PARAMETER temperature 0 SYSTEM """You read server logs. Answer in one short sentence."""
ollama create builds it, under the name logbot. A model in Ollama is a set of layers: the numbers, the template, the license, the settings. Read the lines: using existing layer. It reuses Llama's layers, and adds two new ones: your settings and your system message. du, which measures a folder's size, shows the models folder: 6.2 gigabytes before, 6.2 after. Almost no disk space. Hand it a real log line: one sentence back. Ask again: the same answer, word for word. That's temperature 0.
ollama create logbot -f Modelfilegathering model components using existing layer sha256:dde5aa3fc5ffc17176b5e8bdc82f587b24b2678c6c66101bf7da77af9f7ccdff using existing layer sha256:966de95ca8a62200913e3f8bfbf84c8494536f1b94b49166851e76644e966396 using existing layer sha256:fcc5a6bec9daf9b561a68827b67ab6088e1dba9d1fa2a50d7bbcc8384e0a265d using existing layer sha256:a70ff7e570d97baaf4e62ac6e6ad9975e04caa6d900d3742d37698494479e0cd creating new layer sha256:7acf551e24ec95218a9d3757d1b7786511c5a4d66f51478169a962577d6b946c creating new layer sha256:989cadf17acfb5e3ce5d63c1df3bf629a1d24262e857d0098c85cb34282cfc62 writing manifest success
sudo du -sh /usr/share/ollama/.ollama/models6.2G /usr/share/ollama/.ollama/models
ollama run logbot "2026-12-02 02:14:07 ERROR backup: disk full on /var (0 bytes left), backup stopped"The backup process was interrupted due to a disk full error on the /var partition, leaving no space for further backups.
ollama run logbot "2026-12-02 02:14:07 ERROR backup: disk full on /var (0 bytes left), backup stopped"The backup process was interrupted due to a disk full error on the /var partition, leaving no space for further backups.
The long-input trap
Now a real job: a log of 201 lines. The first line is the error: the backup stopped at 02:14:07. Ask logbot: at what time did the backup stop? The dollar sign and brackets paste the whole file into the question. 02:18:19. Wrong, and said with total confidence.
wc -l app.log201 app.log
head -3 app.log2026-12-02 02:14:07 ERROR backup: disk full on /var (0 bytes left), backup stopped 2026-12-02 02:15:00 INFO web: GET /login 200 22ms 2026-12-02 02:15:01 INFO web: GET /static/app.js 200 86ms
ollama run logbot "$(cat app.log) At what time did the backup stop?"The backup stopped at 02:18:19.
The reason is in the server's log, read with journalctl as before. Truncating input prompt: your log came to 5,070 tokens, about 25 a line, and Ollama kept only 2,050 of them. It kept the end, and cut the start, where the error was, without a word on your screen.
journalctl -u ollama --no-pager | grep truncating | tail -1Dec 02 22:36:11 laptop ollama[537]: time=2026-12-02T22:36:11.748Z level=WARN source=llama_server.go:350 msg="truncating input prompt" limit=2050 prompt=5070 keep=4 new=2050
And when your input won't fit, Ollama's code keeps about half the window free for the answer. So of your 5,070 tokens, only 2,050 got in: the last ones, not the error at the top.

So raise it for logbot. Add one line to the Modelfile: PARAMETER num_ctx 8192. Create logbot again, ask the same question, and this time: 02:14:07. Right. It took 44 seconds to read the whole log on this CPU. The cost shows in ps: 8,192 tokens of context, and 3.5 gigabytes of memory, up from 2.9. You can also set num_ctx inside a chat, or in an API request, which is next.
cat ModelfileFROM llama3.2 PARAMETER temperature 0 PARAMETER num_ctx 8192 SYSTEM """You read server logs. Answer in one short sentence."""
ollama create logbot -f Modelfilegathering model components using existing layer sha256:dde5aa3fc5ffc17176b5e8bdc82f587b24b2678c6c66101bf7da77af9f7ccdff using existing layer sha256:966de95ca8a62200913e3f8bfbf84c8494536f1b94b49166851e76644e966396 using existing layer sha256:fcc5a6bec9daf9b561a68827b67ab6088e1dba9d1fa2a50d7bbcc8384e0a265d using existing layer sha256:a70ff7e570d97baaf4e62ac6e6ad9975e04caa6d900d3742d37698494479e0cd using existing layer sha256:7acf551e24ec95218a9d3757d1b7786511c5a4d66f51478169a962577d6b946c creating new layer sha256:7523dcd37bbc33834834e14178838f2ed684fac475f85d5193fc1780ab721a31 writing manifest success
ollama run logbot "$(cat app.log) At what time did the backup stop?"The backup stopped at 02:14:07.
ollama psNAME ID SIZE PROCESSOR CONTEXT RUNNER UNTIL logbot:latest 4264d9514086 3.5 GB 100% CPU 8192 llamacpp 4 minutes from now
The API on port 11434
So far you typed every question by hand. To use a model from your own program, you need its API. The ollama command is only a client: it talks to the server on port 11434 over HTTP, the language of the web, and your programs can do the same. Three addresses matter: api generate, for one question; api chat, for a conversation; and v1 chat completions, for tools written for OpenAI.

Now a question. curl sends it to api generate as JSON, a text format of names and values in curly brackets: the model, the prompt, and stream false, so the answer comes back in one piece. jq keeps three fields: the response; the eval count, 29 tokens; and the eval duration. That one is in nanoseconds, billionths of a second, so 1.18 seconds here.
curl -s localhost:11434/api/generate -d '{"model": "logbot", "prompt": "What does HTTP 503 mean?", "stream": false}' | jq '{response, eval_count, eval_duration}'{ "response": "HTTP 503 Service Unavailable indicates that the server is currently unable to handle the request due to maintenance, overload, or other temporary issues.", "eval_count": 29, "eval_duration": 1183521000 }
Now api chat, and a surprise. Tell it your server is called web-7. Then, in a second request, ask what it's called. It has no idea. In the chat earlier, the ollama command sent the history for you. Here, nothing does. So send it yourself: your first message, its reply, then the question, each marked with its role: user for you, assistant for the model. Now it answers web-7.
curl -s localhost:11434/api/chat -d '{"model": "llama3.2", "messages": [{"role": "user", "content": "My web server is called web-7. Reply with one word: OK."}], "stream": false, "options": {"seed": 7}}' | jq -r .message.contentOK.
curl -s localhost:11434/api/chat -d '{"model": "llama3.2", "messages": [{"role": "user", "content": "What is my web server called?"}], "stream": false, "options": {"seed": 7}}' | jq -r .message.contentI don't have any information about your specific web server. The term "web server" is a general term that can refer to any server that hosts and serves websites, web applications, or other online content. If you're referring to your own web server, it's likely that you have a specific name or hostname for it, such as "yourwebsite.com" or "yourserver.com". If you're asking about the type of web server software or hardware you're using, I'd be happy to try and help with that information.
curl -s localhost:11434/api/chat -d '{"model": "llama3.2", "messages": [{"role": "user", "content": "My web server is called web-7. Reply with one word: OK."}, {"role": "assistant", "content": "OK."}, {"role": "user", "content": "What is my web server called?"}], "stream": false, "options": {"seed": 7}}' | jq -r .message.contentweb-7.
Here's the same call from Python. requests, a popular library for web calls, posts your log and your question to logbot on api chat, and prints the reply. Run it: 02:14:07. Right. And for tools written for OpenAI's API, set the address to localhost, port 11434, slash v1. They'll want an API key: Ollama's docs say it's required but ignored, so any word works, and logbot answers.
cat ask.pyimport sys import requests URL = "http://localhost:11434/api/chat" log = open(sys.argv[1]).read() question = sys.argv[2] reply = requests.post(URL, json={ "model": "logbot", "messages": [{"role": "user", "content": log + "\n" + question}], "stream": False, }).json() print(reply["message"]["content"])
python3 ask.py app.log "At what time did the backup stop?"The backup stopped at 02:14:07.
curl -s localhost:11434/v1/chat/completions -d '{"model": "logbot", "messages": [{"role": "user", "content": "What does HTTP 503 mean?"}]}' | jq -r '.choices[0].message.content'HTTP 503 Service Unavailable indicates that the server is currently unable to handle the request due to maintenance, overload, or other temporary issues.
From another computer
Say the model runs on your laptop, but you want to use it from your desktop. Let's try. The desktop asks the laptop's Ollama, by the laptop's name, on port 11434. Failed to connect. Remember: 127.0.0.1 listens only to its own computer.
curl http://laptop:11434curl: (7) Failed to connect to laptop port 11434 after 2 ms: Couldn't connect to server
That's on purpose, and a server setting called OLLAMA_HOST changes it. On Linux, you set it with an override file: a small file that adds to the service's settings. Inside: OLLAMA_HOST equals 0.0.0.0, port 11434: every network the laptop is on. Reload systemd, restart Ollama, and ss shows it listening on every address: the star. Other server settings, like OLLAMA_CONTEXT_LENGTH, go in the same file.
sudo mkdir -p /etc/systemd/system/ollama.service.d && printf '[Service]\nEnvironment="OLLAMA_HOST=0.0.0.0:11434"\n' | sudo tee /etc/systemd/system/ollama.service.d/override.conf[Service] Environment="OLLAMA_HOST=0.0.0.0:11434"
sudo systemctl daemon-reload && sudo systemctl restart ollama
ss -ltn 'sport = :11434'State Recv-Q Send-Q Local Address:Port Peer Address:Port Process LISTEN 0 4096 *:11434 *:*
Back on the desktop, ask again: Ollama is running. And a real answer from logbot, running on the laptop. Any program on the desktop can do the same, pointed at the laptop's name.
curl http://laptop:11434; echoOllama is running
curl -s http://laptop:11434/api/generate -d '{"model": "logbot", "prompt": "What does HTTP 503 mean?", "stream": false}' | jq -r .responseHTTP 503 Service Unavailable indicates that the server is currently unable to handle the request due to maintenance, overload, or other temporary issues.
One warning before you do this. Ollama has no password. Anyone who can reach that port can use your models, and the computer behind them. So open it only on a network you trust, let your firewall block the port for everyone else, and never open it to the internet. And if only this laptop needs it, keep the default: 127.0.0.1.

Recap
So: pick a model that fits your memory, run it, or call port 11434 from your code. Long input? Raise num_ctx. And no password, so open it with care.

If you now have a model answering on your own computer, a like helps other beginners find this, and subscribing brings you the next full tutorial. Thanks for watching Cloud Explainers.
Sources
- Ollama FAQ (v0.40.19): default context window, bind address, five minutes in memory
- Ollama docs, OpenAI compatibility (v0.40.19)
- Ollama download (macOS, Windows, Linux)
- Llama 3.2 tags (latest = 3b, 1b = 1.3 GB)
- Ollama source (v0.40.19), how a too-long input is cut (contextShiftPromptLimit)
- Meta, Llama 3.2 announcement (September 25, 2024)
Demos: two containers on our own Mac standing in for your laptop and a second computer, with no graphics card. Every command, output, size and time was real. Watch the full video on YouTube.