https://github.com/samay-jain/chatbot-with-context-and-memory-management
A lightweight, privacy-focused command-line chatbot built in Python that interacts with large language models locally using the Ollama API. Supports conversation saving, loading, and automatic summarization to manage token limits. Perfect for offline, secure AI-assisted chats leveraging models like LLaMA.
https://github.com/samay-jain/chatbot-with-context-and-memory-management
ai chatbot cli command-line conversation language-model llama local-llm machine-learning nlp offline-ai ollama privacy-focused python token-management
Last synced: about 2 months ago
JSON representation
A lightweight, privacy-focused command-line chatbot built in Python that interacts with large language models locally using the Ollama API. Supports conversation saving, loading, and automatic summarization to manage token limits. Perfect for offline, secure AI-assisted chats leveraging models like LLaMA.
- Host: GitHub
- URL: https://github.com/samay-jain/chatbot-with-context-and-memory-management
- Owner: samay-jain
- Created: 2025-06-21T17:03:42.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-23T17:28:35.000Z (about 1 year ago)
- Last Synced: 2025-08-02T01:58:06.649Z (11 months ago)
- Topics: ai, chatbot, cli, command-line, conversation, language-model, llama, local-llm, machine-learning, nlp, offline-ai, ollama, privacy-focused, python, token-management
- Language: Python
- Homepage:
- Size: 12.4 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ๐ง Local Chatbot Using Ollama API
This is a simple command-line chatbot built in Python that uses the [Ollama](https://ollama.com/) API to interact with large language models (such as LLaMA). It allows you to chat with the model, save and load conversations, and summarize previous messages to manage token usage.
---
## ๐ Features
- ๐ค Interactive chatbot powered by local LLMs via Ollama
- ๐พ Save and load conversation history to/from a file
- ๐งน Automatically or manually summarize past messages to reduce token usage
- ๐ก Connects to `localhost:11434` using Ollama's REST API
- ๐ ๏ธ Easy to extend or customize
---
## ๐ Requirements
- Python 3.7+
- [Ollama](https://ollama.com/) installed and running locally
- An Ollama-compatible model (e.g., LLaMA 3) pulled and ready
### Install required Python packages:
```bash
pip install requests