← Journal
Running an LLM without a cloud service: A hands-on Ollama test

Running an LLM without a cloud service: A hands-on Ollama test

A test of Ollama, a local LLM runtime, with the network disabled. Inference succeeded, but a CPU-only environment limited to two cores could not deliver usable speed.

Repository covered in this article

ollama/ollama

Get up and running with Kimi-K2.6, GLM-5.1, MiniMax, DeepSeek, gpt-oss, Qwen, Gemma and other models.

176.2k Go MIT License

Each time you test an LLM through a cloud API, the costs and network traffic add up. A model stored on your machine can return responses without a network connection. Ollama provides a runtime for running LLMs on your machine. I downloaded the official binary and tested whether a small model could run inference with the network disabled.

Ollama puts model downloads, execution, and an API server into one binary for local LLM use. Ollama publishes its source under the MIT License(*1).

1. Download the official binary and model

I downloaded and unpacked the official binary from GitHub Releases instead of piping an install script into curl | sh.

FROM docker.io/library/debian:bookworm-slim
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl zstd && rm -rf /var/lib/apt/lists/*
RUN curl -fsSL -o /tmp/ollama.tar.zst https://github.com/ollama/ollama/releases/download/v0.32.0/ollama-linux-amd64.tar.zst \
    && tar --zstd -xf /tmp/ollama.tar.zst -C /usr/local \
    && rm /tmp/ollama.tar.zst
ENV OLLAMA_HOST=127.0.0.1:11434
ENV OLLAMA_MODELS=/opt/ollama-models
COPY pull_model.sh /tmp/pull_model.sh
RUN bash /tmp/pull_model.sh
WORKDIR /work
# pull_model.sh (during build, with network access)
ollama serve &
SERVER_PID=$!
for i in $(seq 1 30); do
  curl -sf http://127.0.0.1:11434/api/version >/dev/null 2>&1 && break
  sleep 1
done
ollama pull qwen2.5:0.5b
kill "$SERVER_PID"
podman build -t ollama-sandbox .

The build downloads a small model (Qwen2.5 0.5B, quantized, about 370MB) and embeds it in the image.

2. Run inference with the network disabled

podman run --rm --network none --memory 3g --cpus 2 --pids-limit 512 \
  -v "$(pwd)":/work -w /work ollama-sandbox \
  bash -c 'ollama serve & sleep 3; ollama run qwen2.5:0.5b "In one short sentence, why do developers like open source software?"'

The -v option makes the specified directory readable and writable from the container. Run the command in an empty directory dedicated to this experiment.

The command returned a response.

Open source software offers developers not just the flexibility and innovation
needed for software development but also a way to collaborate with others who
share their vision. Developers appreciate that they can contribute code without
fear of intellectual property issues or having to worry about proprietary terms.
Open source often emphasizes simplicity, portability, and accessibility, making
it easier for non-developers to understand and work with the software.

The model produced a coherent, natural English response. During execution, Ollama emitted a warning log, model recommendations refresh failed. Ollama had tried to fetch its own model recommendation data from the cloud, and --network none blocked that request. Inference continued after that request failed.

Inference speed fell short of practical use

I ran this CPU-only test with --cpus 2, limiting the container to two cores, and measured the following generation speed.

prompt eval: 42 tokens, 181 ms/token (5.52 tokens/sec)
generation:  77 tokens, 6,195 ms/token (0.16 tokens/sec)
total:       119 tokens in about 8 minutes 5 seconds

The run took about eight minutes to produce a short answer of about three sentences. I ran the test without a GPU and limited the CPU to two cores. Under those conditions, a small model with around 500M parameters produced tokens at this speed. The resource limits drove the result. Ollama did not cause the slowdown. I set a deliberate CPU limit on the test container for this verification. With a GPU or more CPU cores, the same model can feel much faster. When you consider a local LLM, estimate speed from the combination of model size and the compute resources you can use.

Local LLMs trade speed for independence from external services

The choice to run an LLM on your machine trades speed for less reliance on external services. A resource-constrained setup like this one runs slower, yet the model still returns a response. Before you use speed as a decision criterion, confirm that the model runs and that it can keep data from leaving your environment.

Sources

*1 Ollama (GitHub), https://github.com/ollama/ollama, MIT License