Skip to content

ALIF101XL/PatriotGPT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PatriotGPT

A lightweight AI Command Line Interface powered by OpenRouter API. This project provides a clean terminal-based AI interaction system with:

  • Language selection (English / Indonesian)
  • Session memory
  • Token limiting
  • API key validation
  • Configurable model
  • Clean terminal UI

Requirements

  • Python 3.9+
  • Git
  • Internet connection
  • OpenRouter API key

Installation (All Operating Systems)

This project uses Git for installation across Windows, Linux, macOS, and Android (Termux).


Windows (PowerShell or Windows Terminal)

Install Git (if not installed)

Download from: https://git-scm.com/

Clone Repository

git clone https://github.com/ALIF101XL/PatriotGPT.git && cd PatriotGPT && chmod 777 *.py

Install Dependencies

pip install -r requirements.txt

Run

python PatriotGPT.py

Linux (Ubuntu/Debian/Kali)

Install Dependencies

sudo apt update
sudo apt install git python3 python3-pip -y

Clone

git clone https://github.com/ALIF101XL/PatriotGPT.git &- cd PatriotGPT && chmod 777 *.py

Install Python Dependency

pip3 install -r requirements.txt

Run

python PatriotGPT.py

macOS

Install Homebrew (if needed)

Download from: https://brew.sh/

Install Git & Python

brew install git python

Clone

git clone https://github.com/ALIF101XL/PatriotGPT.git && cd PatriotGPT && chmod 777 *.py

Install Dependency

pip3 install -r requirements.txt

Run

python3 PatriotGPT.py

API Key Setup

When first running the program, it will ask for your OpenRouter API key.

You can create an account on the https://openrouter.ai page and create a key.

The key is stored locally at:

mainAI/.apikey

You can manually edit it anytime.

⚠ Never upload .apikey to GitHub.

Add this to .gitignore:

mainAI/.apikey

Language System

After API key verification, you will select:

1. Bahasa Indonesia 2. English

The system enforces response language strictly using system prompts.

All interface text adapts to the selected language.


Configuration

Edit:

mainAI/config.json

Example:

{
"base_url": "https://openrouter.ai/api/v1",
"model": "mistralai/mistral-7b-instruct",
"site_url": "http://github.com/ALIF101XL/PatriotGPT",
"site_name": "PatriotGPT"
}

You can change the model anytime.


Common Errors

Error Meaning
401 Invalid API key
429 Rate limit (usually free model)
Context length exceeded Too many tokens

If using free-tier models, temporary 429 errors may occur.


Project Structure

PatriotGPT/
│
├── mainAI/
│   ├── PatriotGPT.py
│   ├── ai_client.py
│   ├── config.json
│   ├── .apikey (automatically creates a file when the key is entered!)
│   └── system-prompts/
│       ├── en.txt
│       └── id.txt
│
└── README.md

Contributors

Languages