Skip to main content

An Ollama chat web application

Project description

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

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ollama_chat-0.9.69.tar.gz (29.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ollama_chat-0.9.69-py3-none-any.whl (32.5 kB view details)

Uploaded Python 3

File details

Details for the file ollama_chat-0.9.69.tar.gz.

File metadata

  • Download URL: ollama_chat-0.9.69.tar.gz
  • Upload date:
  • Size: 29.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for ollama_chat-0.9.69.tar.gz
Algorithm Hash digest
SHA256 09ab44d741dedb40fb42bec05b38bd39414a75c8402d8d3a1e855d51d113f6d3
MD5 00df1027809542cdb6ac851067831755
BLAKE2b-256 f90d4a7043f877924b46f66971f09b024ae4f80e16c7f47bb2f1a7f956bc76d6

See more details on using hashes here.

File details

Details for the file ollama_chat-0.9.69-py3-none-any.whl.

File metadata

  • Download URL: ollama_chat-0.9.69-py3-none-any.whl
  • Upload date:
  • Size: 32.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for ollama_chat-0.9.69-py3-none-any.whl
Algorithm Hash digest
SHA256 6daa283a295008775287f013d423a8b8cdde525f2558ced8e13cdcfab17fb617
MD5 f1dfefa58f806e1ec29544bbc6936c6c
BLAKE2b-256 6e6006af1a6317fd1bb05d5a902795eb00b5eec70f0b9e03800427fc7cfe6a6b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page