Skip to main content

A terminal-based chat application with mulitplayer games and an on-device AI assistant

Project description

Pardesi Chat 🤖🎮

Welcome to Pardesi Chat, a project by Arsalan Pardesi.

This is a feature-rich, terminal-based chat application built with Python. It allows users on the same local network to connect and chat in real-time. More than just a chat app, it's a multi-game platform and a powerful AI assistant, all running locally in your terminal. The application intelligently detects if a server is running on the network; the first user to launch automatically becomes the host.

✨ Features

  • Real-time LAN Chat: Instantly communicate with other users on your local network.

  • Automatic Server Discovery: No need to configure IP addresses. The first person to start is the host, everyone else joins automatically.

  • Private Messaging: Send direct messages to specific users with the /whisper command.

  • Integrated Games:

    • Hangman: Challenge the room with a word and see who can guess it first!
    • Stick Figure Fighter: A turn-based, 1v1 fighting game with standard and special moves, rendered in ASCII art.
  • On-Device AI Assistant:

    • Ask coding, general knowledge, or complex questions.
    • Provide a URL to an image and ask the AI to describe or analyze it.
    • Provide a URL to a news article or document and ask the AI to summarize it.

📥 Installation & Usage (for Users)

This application is packaged and available on PyPI. The recommended way to install it is using pip.

Install the Package
Open your terminal and run the following command:
pip install pardesichat

Run the Application Once installed, you can start the chat from any terminal window by simply typing:

pardesi-chat

The first person to run the command on a network will become the server host. All subsequent users running the same command will join the chat. To exit, type exit and press Enter.

🤖 One-Time AI Setup (For the Server Host)

These steps are only for the user who will host the chat and wants to enable the AI features. Client users do not need to do this.

Install Ollama

Download and install the Ollama application for your operating system from the official website: https://ollama.com. The pull command below will download it for you.

Start the Ollama Service Before starting the chat server, you must have the Ollama service running.

Open a separate, dedicated terminal window and run:

ollama serve

Keep this terminal window running in the background.

Pull the Required AI Models This application uses two different models: one for text/code and another for vision. Open another new terminal and pull both models. This is a one-time download.

For Text, Code, and Summarization:
ollama pull gemma3n:e4b

For Image Analysis:
ollama pull qwen2.5vl:3b

👨‍💻 Development Setup (For Contributors)

If you wish to contribute to the project or run it from the source code, follow these steps.

Clone the Repository
Bash
git clone https://github.com/arsalanpardesi/pardesichat.git
cd pardesichat

Create and Activate a Virtual Environment (optional)

Install Dependencies Install all required packages from the toml file

Run from Source
python pardesichat.py

📖 Command Reference

General Chat

Public Message: Just type your message and press Enter.

Private Message: /whisper @username your message ...

Games

Start Hangman: /hangman <word> (e.g., /hangman python)

Guess a Letter: /guess <letter> (e.g., /guess e)

Start a Fight: /fight @username

Accept a Fight: /accept

Fight Moves: /punch, /kick, /block, /special

AI Assistant (/ai)

General Question:

/ai What are the key differences between Python lists and tuples?

Analyze an Image:

/ai https://i.imgur.com/some_image.jpg

Summarize an Article:

/ai https://www.bbc.com/news/some-article-url

License note

The base application is offered under the MIT license but please refer to the licenses for Gemma and Qwen.

Gemma is provided under and subject to the Gemma Terms of Use found at ai.google.dev/gemma/terms"

Qwen is subject to the following license agreement: registry.ollama.ai/library/qwen2.5vl:latest/blobs/832dd9e00a68

Please also refer to the license requirements for all the libraries used before you deploy the application.

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

pardesichat-1.0.1.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

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

pardesichat-1.0.1-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file pardesichat-1.0.1.tar.gz.

File metadata

  • Download URL: pardesichat-1.0.1.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.11

File hashes

Hashes for pardesichat-1.0.1.tar.gz
Algorithm Hash digest
SHA256 51c3bf778a60a577fd3139620608b3bd125d4aa6fbeb8230a2e28e01c917568b
MD5 0f6a3a68db7b288c6ae9277935183bdc
BLAKE2b-256 4fad6f684b6f851a0e8aaf684bfc737a52372d73f2920709251f515d0bd2ac13

See more details on using hashes here.

File details

Details for the file pardesichat-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: pardesichat-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 10.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.11

File hashes

Hashes for pardesichat-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8fc4c99ad3b3421ebb09c224395dc7ca66f06bfbed2796abc300eb90146223a7
MD5 3703bcdc972bc0d0e62d792cc6031de3
BLAKE2b-256 8132dc1fc49895a5a08e452f97a19f74df03667b596232e8573b343da75226fb

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