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
- Python 3.9+
- Git
- Internet connection
- OpenRouter API key
This project uses Git for installation across Windows, Linux, macOS, and Android (Termux).
Download from:
https://git-scm.com/
git clone https://github.com/ALIF101XL/PatriotGPT.git && cd PatriotGPT && chmod 777 *.pypip install -r requirements.txtpython PatriotGPT.pysudo apt update
sudo apt install git python3 python3-pip -ygit clone https://github.com/ALIF101XL/PatriotGPT.git &- cd PatriotGPT && chmod 777 *.pypip3 install -r requirements.txtpython PatriotGPT.pyDownload from:
https://brew.sh/
brew install git pythongit clone https://github.com/ALIF101XL/PatriotGPT.git && cd PatriotGPT && chmod 777 *.pypip3 install -r requirements.txtpython3 PatriotGPT.pyWhen 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
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.
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.
| 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.
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