Skip to main content

An Ollama chat web application

Project description

ollama-chat

PyPI - Status PyPI GitHub PyPI - Python Version

Ollama Chat is a web chat client for Ollama that allows you to chat locally (and privately) with Large Language Models (LLMs).

Features

  • Platform independent - tested on macOS, Windows, and Linux
  • Chat with any local Ollama model
  • Save conversations for later viewing and interaction
  • Single and multiline prompts
  • 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
  • Prompt commands for including file and URL content
  • Conversation templates for repeating prompts with variable substitutions

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
    

Updating

To update Ollama Chat:

pip install -U 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 web application.

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

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

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

Prompt Commands

Ollama Chat supports special prompt commands that allow you to include file 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.
    
  • /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 or title

    /do city-report -v CityState "Seattle, WA"
    

To get prompt command help use the -h option:

/file -h

Conversation Templates

Conversation Templates allow you to repeat the same prompts with different models. Templates can define variables that may be included in the template title and prompt text ({{var}}). For example:

{
    "conversations": [],
    "templates": [
        {
            "title": "City Report for {{CityState}}",
            "prompts": [
                "Tell me about {{CityState}}",
                "What is the average cost of living in {{CityState}}?"
            ],
            "variables": [
                {
                    "label": "City, State",
                    "name": "CityState"
                }
            ]
        }
    ]
}

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


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.25.tar.gz (20.1 kB view details)

Uploaded Source

Built Distribution

ollama_chat-0.9.25-py3-none-any.whl (21.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ollama_chat-0.9.25.tar.gz
  • Upload date:
  • Size: 20.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for ollama_chat-0.9.25.tar.gz
Algorithm Hash digest
SHA256 9c6503261548fe80b51c354d1d106b8728a9c274f59cbc9e3769b8a3129eb70a
MD5 dd344581571b9327fee6c0615912311c
BLAKE2b-256 7a2366e79aa92215b1f7f7e8da9146a0ef0cf3bd5c09befbcf91f373aaa43fad

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ollama_chat-0.9.25-py3-none-any.whl
Algorithm Hash digest
SHA256 acd74745e1c8121e905724bea242085527463ae1550072fc637c0fc9feb8c932
MD5 7ca5cf11ec87e2d5a2fd6b93f820d2e1
BLAKE2b-256 efe24ca21a4ee7bc90f76c62b795cb4417fc84bb8b285e1e317d3755799465e1

See more details on using hashes here.

Supported by

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