This project is an asynchronous chat client leveraging the Ollama API for answering user queries. It's built with Python and utilizes prompt_toolkit
for an enhanced terminal interface, offering a more interactive and engaging user experience.
Before installing and running this project, you need to have Python and some package management tools installed on your system. This guide covers the setup for macOS users.
- Homebrew: The simplest way to install Python on macOS is via Homebrew, a popular package manager for macOS. If you haven't installed Homebrew, open Terminal and run:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- Install Python: Once Homebrew is installed, you can install Python by running:
This command installs the latest version of Python.
brew install python
pipx
is a tool for installing and running Python applications in isolated environments. It's ideal for tools you want to use globally across your system but keep isolated from other Python projects.
- Install pipx:
brew install pipx
- Initialize pipx:
pipx ensurepath
Poetry
is a tool for dependency management and packaging in Python. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you.
- Install Poetry:
pipx install poetry
- Install ollama: Download the latest version of ollama from the official website and follow the installation instructions.
With Python and the necessary tools installed, follow these steps to get the project up and running.
- Clone the repository:
git clone https://github.com/rajasoun/ollama-poc.git
- Navigate to the project directory:
cd ollama-poc poetry shell
- Install dependencies with Poetry:
poetry install
To start the chat client, activate the Poetry shell and run the main script:
- Activate the Poetry shell:
poetry shell
- Run the application:
python main.py
Follow the on-screen instructions. Type your questions and receive responses from the Ollama model. Type exit
to terminate the session when you're finished.
Contributions to this project are welcome! To contribute:
- Fork the repository.
- Create a new branch for your features or fixes.
- Commit your changes and push them to your fork.
- Submit a pull request to the original repository.
Please adhere to the project's coding standards and guidelines.
This project is open-sourced under the MIT License. See the LICENSE file for more details.