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).

Features

  • Platform independent - tested on macOS, Windows, and Linux
  • Chat with local LLMs (using Ollama) entirely offline
  • Prompt commands to include files, images, and URL content
  • Regenerate the most recent conversation response
  • Delete the most recent conversation exchange
  • View responses as Markdown or text
  • Save conversations as Markdown text
  • Multiple concurrent chats
  • Conversation templates for repeating prompts with variable substitutions
  • Start a conversation or template from the command line
  • Download and manage models

Installation

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

  1. Install and start Ollama

  2. Install Ollama Chat

    pip install ollama-chat
    

Start Ollama Chat

To start Ollama Chat, open a terminal prompt and run the Ollama Chat application:

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.

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?"

Conversation Templates

Conversation Templates allow you to repeat the same prompts with different models. Templates can define variables for use in the template title and prompt text (e.g., {{var}}).

There are two ways to create a template. Click "Add Template" from the index page, and a new template is created and opened in the template editor. The other way is to click "Template" from a conversation view's menu.

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
    
    Please summarize the README file.
    
  • /image - include an image

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

    /dir src/ollama_chat py
    
    Please provide a summary for each Ollama Chat source file.
    
  • /url - include a URL resource

    /url https://craigahobbs.github.io/ollama-chat/README.md
    
    Please summarize the README file.
    
  • /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.50.tar.gz (135.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.50-py3-none-any.whl (137.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for ollama_chat-0.9.50.tar.gz
Algorithm Hash digest
SHA256 ec5434e5946d81f3b830a8d8c947468d919a27c990f1c1da314ae6ae4b4dfcf3
MD5 bf86d5d182f61dd05fc2697c97d8c6b0
BLAKE2b-256 ee9ae8f9136719b5f615b944d842ddcc93871aefa02ce5cb59317aa9ddc0f529

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for ollama_chat-0.9.50-py3-none-any.whl
Algorithm Hash digest
SHA256 91941c8ab2b6714a593f78d044dd2da736e60ce84ae01174a059e1da8f9093bc
MD5 8ffb2c38de48537b440e00d939bfd28d
BLAKE2b-256 ae342c51b05e75e0fd3de1887c6948a2c7a2447b948f0d546efdd6ba9e04d88a

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