Skip to main content

ollama-client

A small command-line client for an Ollama server running on another machine.

It replaces the ollama command on machines that only need to talk to a server: same commands, same flags, same output. Install it on your laptop, point it at the machine with the GPU, and use it as you would use ollama.

uv tool install ollama-client
export OLLAMA_HOST=http://my-server:11434

ollama-client list
ollama-client run qwen3.5:4b "Why is the sky blue?"

Why not install ollama?

The ollama download (about 1.9 GB) includes the full inference server: GPU runtimes and the model runner. On a machine that never runs models itself, none of that is used. ollama-client is a 30 KB pure-Python package.

  • Keep models in one place. Models, GPU memory and the server process live on one machine; every laptop, WSL shell or CI runner uses the client.
  • Easy to install anywhere. uv tool install or pip install, no sudo, no installer script, no background service.
  • Script-compatible. Tables, size and time formats, and error messages follow the official client, so scripts that parse ollama output keep working. See Compatibility for the exceptions.

Install

Requires Python 3.11 or later.

uv tool install ollama-client    # or: pip install ollama-client

Connect to your server

Tell the client where the server is. The first of these that is set wins:

  1. The --host (or -H) flag: ollama-client -H http://192.168.1.10:11434 list

  2. OLLAMA_CLIENT_HOST: use this to point the client somewhere other than OLLAMA_HOST.

  3. OLLAMA_HOST: the variable the official client uses. A server-side bind address such as 0.0.0.0 is read as localhost.

  4. The config file ~/.config/ollama-client/config.toml:

    [ollama]
    host = "http://192.168.1.10:11434"
    
  5. The default, http://localhost:11434.

The http:// prefix and the port are optional: my-server becomes http://my-server:11434.

Usage

ollama-client COMMAND [flags]

  run       Chat with a model, or run a single prompt
  pull      Download a model to the server
  list, ls  List models on the server
  ps        List models loaded in memory
  stop      Unload a model from memory
  show      Show information about a model
  rm        Delete models from the server
  cp        Copy a model under a new name
  launch    Start a coding tool (Claude Code, Codex, ...) that uses the server
  signin    Sign in to ollama.com
  signout   Sign out of ollama.com
  help      Show help for a command (also: COMMAND --help)

Chat and prompts

# Interactive chat; the conversation is kept until you type /clear or /bye
ollama-client run qwen3.5:4b

# Single prompt
ollama-client run qwen3.5:4b "Why is the sky blue?"
ollama-client run qwen3.5:4b "Summarise this." --system "You are a concise assistant."

# Piped input is placed before the prompt
cat notes.txt | ollama-client run qwen3.5:4b "Summarise this."

# Reasoning models: show the thinking (dimmed), or let the model think but hide it
ollama-client run qwen3.5:4b "What is 17 * 23?" --think
ollama-client run qwen3.5:4b "What is 17 * 23?" --think --hidethinking

# Timing and token statistics after the answer
ollama-client run qwen3.5:4b "Hello" --verbose

Other run flags: --format json, --keepalive 10m (how long the model stays loaded), --nowordwrap. In the chat, /help lists the commands; /bye or Ctrl+D exits; Ctrl+C stops a reply in progress.

Embedding models

run on an embedding model prints the embedding vector as JSON.

ollama-client run embeddinggemma "hello world"
ollama-client run embeddinggemma "hello world" --dimensions 256   # shorter vector

Inputs longer than the model's context are truncated; add --truncate=false to get an error instead.

Decision models

Decision models (such as nimble) don't write text: they answer questions about a piece of text with a probability. Give the text as the prompt or on stdin, and one or more --ask questions:

# Yes or no
ollama-client run nimble --ask "Is a refund being requested?" < ticket.txt

# Pick one label (an optional description follows =)
ollama-client run nimble --ask "Which team should handle this?" \
  --choice billing="Payments and refunds" \
  --choice technical="Software problems" < ticket.txt

# Place on a scale, lowest level first
ollama-client run nimble --ask "How urgent is this?" \
  --level Routine --level Soon --level Immediate < ticket.txt

Each --choice or --level belongs to the --ask before it. Add --format json for the full response with all probabilities.

Manage models

ollama-client pull qwen3.5:4b
ollama-client list                    # all models
ollama-client list qwen               # names starting with "qwen"
ollama-client ps                      # loaded models, CPU/GPU split, context size
ollama-client stop qwen3.5:4b
ollama-client show qwen3.5:4b         # architecture, capabilities, parameters, license
ollama-client show qwen3.5:4b -v      # also all metadata and tensors
ollama-client show qwen3.5:4b --modelfile   # or --parameters, --template, --system, --license
ollama-client rm qwen3.5:4b qwen3.5:9b
ollama-client cp qwen3.5:4b my-qwen

Launch a coding tool

launch configures a coding assistant to use models on your Ollama server, then starts it.

ollama-client launch                                   # pick the tool and model from a menu
ollama-client launch claude --model qwen3.5:4b         # start directly
ollama-client launch codex --config --model qwen3.5:4b # write the configuration only
ollama-client launch codex -- --sandbox workspace-write # pass arguments to the tool
Name Description Configuration method
claude Claude Code Environment variables (ANTHROPIC_BASE_URL, model overrides)
copilot Copilot CLI Environment variables (COPILOT_PROVIDER_BASE_URL)
codex Codex ~/.codex/config.toml (merged, not overwritten)
hermes Hermes Agent ~/.hermes/config.yaml (merged, legacy ollama provider removed)
opencode OpenCode OPENCODE_CONFIG_CONTENT environment variable
pi Pi ~/.pi/agent/models.json and ~/.pi/agent/settings.json
vscode VS Code Launches code (no Ollama config; use the Ollama VS Code extension)

Aliases: copilot-cli for copilot, code for vscode.

Compatibility with ollama

Output is byte-for-byte the same as the official client's (checked against ollama 0.40.18), so scripts parsing it keep working:

  • list and ps tables, including column padding
  • show and show -v sections, including how long values wrap
  • Sizes in SI units (9.5 GB, 1 MB) and relative times (About an hour ago, 8 weeks ago)
  • run: the response on stdout followed by a blank line; the spinner and --verbose statistics on stderr
  • Embedding vectors and decision answers
  • Errors as Error: ... on stderr; pull ends with success

Differences

  • Not included: serve (this is only a client), create and push.
  • run flags not supported: --voice (speech models), the hidden --runner, and image file paths in the prompt.
  • Decision models answer --ask questions in a single run only; there is no interactive decision mode.
  • Chat commands: only /help, /clear and /bye. The official /save, /load, /show, /set, /unset and """ multi-line input are not available.
  • launch covers configuring and starting the tool. The official version adds a full-screen menu, capability checks, automatic installation of the tool and cloud models.
  • Spinners and the pull progress bar look similar but not identical.

A single run MODEL PROMPT uses /api/generate; the interactive chat uses /api/chat and sends the whole conversation each turn, as the official client does.

Dependencies

  • httpx: HTTP client.
  • rich: live streaming text, spinners and the pull progress bar.
  • pyyaml: used only by launch hermes, to update ~/.hermes/config.yaml without losing the existing settings.

Development

uv sync
uv run ollama-client --help
uv run pytest                     # unit tests, no server needed
uv run mypy src/ollama_client
uv run ruff check src/ollama_client

Compatibility tests

The compat tests run both this client and the real ollama against a live server and compare the results. They need a running Ollama server (default http://localhost:11434), the ollama binary on PATH, and tmux for the interactive tests.

uv run pytest -m compat                                   # default model: rnj-1:latest
OLLAMA_COMPAT_MODEL=qwen3.5:4b uv run pytest -m compat    # another model
uv run pytest -m compat tests/test_compat.py::TestHelp    # flag checks only; needs just the ollama binary

Metadata

Release files for ollama-client 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ollama-client 0.2.0
File Size Uploaded Provenance Actions
ollama_client-0.2.0.tar.gz 103.4 kB With provenance Details for ollama_client-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ollama-client 0.2.0
File Interpreter ABI Platform Actions
ollama_client-0.2.0-py3-none-any.whl Python 3 none any Details for ollama_client-0.2.0-py3-none-any.whl

Total release size: 135.1 kB

Release files / ollama_client-0.2.0.tar.gz

Download URL ollama_client-0.2.0.tar.gz
Size 103.4 kB
Tags Source
SHA-256 checksum
How to use checksums
b86724306e12c5b1bce907006ebca0f499574b3a640260097946c10078ce4d48
BLAKE2b-256 checksum
How to use checksums
48854e631934a60257f6ef78594ccf69a97c90ca9f793f5135a7384962c019a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

Release files / ollama_client-0.2.0-py3-none-any.whl

Download URL ollama_client-0.2.0-py3-none-any.whl
Size 31.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ed555911e8dd88494579c386d4c30beeeb7a84623d58a11f0488b5da398637cf
BLAKE2b-256 checksum
How to use checksums
77e2723e3934cbda5f0fa545c80eb9a114d48be6f03130c1dc83c562f191d081
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

Security for ollama-client 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ollama_client-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page