Skip to main content

ollama-chat

PyPI - Status PyPI GitHub PyPI - Python Version

Ollama Chat is a conversational AI chat client that uses Ollama to interact with local large language models (LLMs) entirely offline. Ideal for AI enthusiasts, developers, or anyone wanting private, offline LLM chats.

Features

  • Chat with local large language models (LLMs) entirely offline
  • Prompt Commands to include files, images, and URL content
  • Conversation Templates for repeating prompts with variable substitutions
  • Browse, download, monitor, and select local models directly in the app
  • Multiple concurrent chats
  • Show/hide thinking of reasoning models
  • Regenerate the most recent conversation response
  • Delete the most recent conversation exchange
  • View responses as Markdown or text
  • Save conversations as Markdown text
  • Start a conversation or template from the command line
  • Platform independent - tested on macOS, Windows, and Linux

Installation

To get up and running with Ollama Chat follow these steps:

  1. Install Ollama

  2. Install Ollama Chat

    macOS and Linux

    python3 -m venv $HOME/venv --upgrade-deps
    . $HOME/venv/bin/activate
    pip install ollama-chat
    

    Windows

    python3 -m venv %USERPROFILE%\venv --upgrade-deps
    %USERPROFILE%\venv\Scripts\activate
    pip install ollama-chat
    

Start Ollama Chat

To start Ollama Chat, open a terminal prompt and follow the steps for your OS. When you start Ollama Chat, a web browser is launched and opens the Ollama Chat application.

By default, a configuration file, "ollama-chat.json", is created in the user's home directory.

macOS and Linux

. $HOME/venv/bin/activate
ollama-chat

Windows

%USERPROFILE%\venv\Scripts\activate
ollama-chat

Start a Conversation from the Command Line

To start a conversation from the command line, use the -m argument:

ollama-chat -m "Why is the sky blue?"

Start a Template from the Command Line

To start a named template from the command line, use the -t and -v arguments:

ollama-chat -t askAristotle -v question "Why is the sky blue?"

Add a Desktop Launcher

To add a desktop launcher, follow the steps for your OS.

macOS

In Finder, locate the "ollama-chat" executable and drag-and-drop it into the lower portion of the Dock.

Windows

In File Explorer, locate the "ollama-chat" executable, right-click it, and select "Pin to Start".

GNOME (Linux)

  1. Copy the following Ollama Chat desktop file contents:

    [Desktop Entry]
    Name=Ollama Chat
    Exec=sh -c "$HOME/venv/bin/ollama-chat"
    Type=Application
    Icon=dialog-information
    Terminal=true
    Categories=Utility;
    
  2. Create the Ollama Chat desktop file and paste the contents:

    nano $HOME/.local/share/applications/ollama-chat.desktop
    
  3. Update the "Exec" path, if necessary, and save

Conversation Templates

Conversation Templates allow you to repeat a sequence of prompts. Templates can include variable substitutions in the title text and the prompt text (e.g., {{var}}).

Create a Template

There are two ways to create a template:

  • Click "Add Template" from the home page
  • Click "Template" on a conversation page

Run a Template

To run a template, click on its title on the home page. If the template has any variables, the user is prompted for their values prior to running the template. When a template runs, a new conversation is created and each prompt is entered in sequence.

Edit a Template

To edit a template, from the home page, click "Select" on the template you want to edit, and then click "Edit". On the template editor page you can update the template's title, set its name, add or remove variables, and add or remove prompts.

Prompt Commands

Ollama Chat supports special prompt commands that allow you to include files, images, and URL content in your prompt, among other things. The following prompt commands are available:

  • /file - include a file

    /file README.md
    
  • /image - include an image

    /image image.jpeg
    
  • /dir - include files from a directory

    /dir src/ollama_chat py
    
  • /url - include a URL resource

    /url https://craigahobbs.github.io/ollama-chat/README.md
    
  • /do - execute a conversation template by name

    /do city-report -v CityState "Seattle, WA"
    
  • /? - list available prompt commands

    /?
    

To get prompt command help use the -h option:

/file -h

File Format and API Documentation

Ollama Chat File Format

Ollama Chat API

Development

This package is developed using python-build. It was started using python-template as follows:

template-specialize python-template/template/ ollama-chat/ -k package ollama-chat -k name 'Craig A. Hobbs' -k email 'craigahobbs@gmail.com' -k github 'craigahobbs' -k noapi 1

Metadata

Release files for ollama-chat 1.4.1

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-chat 1.4.1
File Size Uploaded
ollama_chat-1.4.1.tar.gz 33.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ollama-chat 1.4.1
File Interpreter ABI Platform
ollama_chat-1.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 69.2 kB

Release files / ollama_chat-1.4.1.tar.gz

Download URL ollama_chat-1.4.1.tar.gz
Size 33.0 kB
Tags Source
SHA-256 checksum
How to use checksums
1f4fd731ae04cbddf1590c8885cfca113395f53351b1037e240e99500d2ce09d
BLAKE2b-256 checksum
How to use checksums
617b25da969f3624d0c57e1605d8ff09683a8f7ef9014612b50acd3b606898fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / ollama_chat-1.4.1-py3-none-any.whl

Download URL ollama_chat-1.4.1-py3-none-any.whl
Size 36.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0c6fa31282d4d0c0f815412a4930175281fc3408c8b7c2ed1101fa34ee54d0bf
BLAKE2b-256 checksum
How to use checksums
029727e752f7f04753f6075d4a95cc72a6f36cd13f958d6d5813dc52c4cc509d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release history Release notifications | RSS feed

This release

1.4.1 This release

2 release files

1.4.0

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.9.84

2 release files

0.9.83

2 release files

0.9.81

2 release files

0.9.80

2 release files

0.9.79

2 release files

0.9.77

2 release files

0.9.76

2 release files

0.9.75

2 release files

0.9.74

2 release files

0.9.73

2 release files

0.9.72

2 release files

0.9.71

2 release files

0.9.68

2 release files

0.9.67

2 release files

0.9.66

2 release files

0.9.64

2 release files

0.9.63

2 release files

0.9.62

2 release files

0.9.61

2 release files

0.9.60

2 release files

0.9.59

2 release files

0.9.58

2 release files

0.9.57

2 release files

0.9.56

2 release files

0.9.55

2 release files

0.9.54

2 release files

0.9.52

2 release files

0.9.51

2 release files

0.9.50

2 release files

0.9.49

2 release files

0.9.48

2 release files

0.9.47

2 release files

0.9.46

2 release files

0.9.45

2 release files

0.9.44

2 release files

0.9.42

2 release files

0.9.41

2 release files

0.9.40

2 release files

0.9.39

2 release files

0.9.38

2 release files

0.9.35

2 release files

0.9.30

2 release files

0.9.29

2 release files

0.9.28

2 release files

0.9.21

2 release files

0.9.20

2 release files

0.9.19

2 release files

0.9.18

2 release files

0.9.17

2 release files

0.9.16

2 release files

0.9.15

2 release files

0.9.9

2 release files

0.9.8

2 release files

0.9.7

2 release files

0.9.6

2 release files

0.9.5

2 release files

0.9.4

2 release files

0.9.3

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

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