A terminal chatbot, powered by Groq Cloud API (Windows / macOS / Linux / Android / iOS)
Modified groq chatbot developed in https://github.com/eliranwong/freegenius
A simple chatbot that runs fast on mobile phones as well as pc.
Get a Groq API key first. Read https://github.com/eliranwong/freegenius/wiki/Set-up-a-Groq-Cloud-API-Key
iOS/iPad/iPhone: Use iSH on iOS/iPad/iPhone.
Android: Use Termux on Android.
With python installed, setup gropchat via pip:
pip install groqchat
Or
pip install gchat
- Install rust
pkg install rust
- Use "--system-site-packages" if you create a virtual environment, e.g.
python -m venv gchat --system-site-packages
source gchat/bin/activate
pip install --upgrade gchat
On Android, use Android built-in voice typing keyboards of Ctrl+S.
Install Termux:API, to work with response output on Andoird.
Simply run 'gchat':
gchat
Enter your Groq cloud a single API key or a list of multiple API keys:
(Remarks: If a list of multiple API keys are entered, entered API keys are automatically rotated for running inference.)
![groqapi](https://private-user-images.githubusercontent.com/25262722/335528244-a510f465-1768-4fcb-8ae5-cfab9f3adad8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2ODE2MjUsIm5iZiI6MTczOTY4MTMyNSwicGF0aCI6Ii8yNTI2MjcyMi8zMzU1MjgyNDQtYTUxMGY0NjUtMTc2OC00ZmNiLThhZTUtY2ZhYjlmM2FkYWQ4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE2VDA0NDg0NVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNiZDQzZTBlZDA5OGMwYjc1ODY0ZWMyYzIwZjNlY2NiOWI0NzhjNDQ4ODI4ZGI3MGU0MGY2NDQ1OTQ0NDczZjImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.0HvlHd81tZ6yIiQ6xy3XlGFZdOizKnLz_S9-ezkHrD8)
Select a model:
![models](https://private-user-images.githubusercontent.com/25262722/335526906-42cbcd85-b13a-4188-98e6-2abf99542993.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2ODE2MjUsIm5iZiI6MTczOTY4MTMyNSwicGF0aCI6Ii8yNTI2MjcyMi8zMzU1MjY5MDYtNDJjYmNkODUtYjEzYS00MTg4LTk4ZTYtMmFiZjk5NTQyOTkzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE2VDA0NDg0NVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWIzMTc4ODBhNmIyNWUwYjMxYTVmMmFjMDdmNjY4ZGM1NWRiMTQzMzZlMTZiYzBlODEwMDQzMmRlMTAzMjA3NWMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.SdgT_shq-bwNVltR0hseYVfEtFP0wuPgtUE4AUg8cPo)
Enter a dot '.' to display available special entries:
![ui](https://private-user-images.githubusercontent.com/25262722/335526914-31fa20e7-24cb-4aa1-b67e-38f6bf24971d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2ODE2MjUsIm5iZiI6MTczOTY4MTMyNSwicGF0aCI6Ii8yNTI2MjcyMi8zMzU1MjY5MTQtMzFmYTIwZTctMjRjYi00YWExLWI2N2UtMzhmNmJmMjQ5NzFkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE2VDA0NDg0NVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTU4ODFhZjA0MjM2MWFjMDdmNjAyMmU5ZTM2YmY5MDA5NzFkNTcyNDU2MjI2Y2NjNDE3MDQxNzk1ODc5NmZhMjEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.UO3-bj4Tucnhhif3LyRRGAvMXVhMFMRzX2RXP427p4A)
'.new' - start a new chart session
'.api' - change api key
'.model' - change model
'.systemmessage' - change system message
'.temperature' - change temperature
'.maxtokens' - change max tokens
'.togglewordwrap' - toggle word wrap
'.togglevoiceoutput' - toggle voice output
'.exit' - exit the application
By default:
Ctrl+Z - cancel
Ctrl+Q - exit / quit
Ctrl+I / TAB - insert new line
Ctrl+N - new chat session
Ctrl+W - toggle word wrap
Ctrl+Y - toggle voice output
Ctrl+S - trigger voice typing
Advanced users may change configurations manually by editing the file "config.py" located in the package folder.
Remarks: Close the app before editing the file.
Run 'gchat --help' for cli options
gchat --help
![cli_option](https://private-user-images.githubusercontent.com/25262722/335526884-eb58aeaf-7cc7-4170-b253-1200b99d57e9.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2ODE2MjUsIm5iZiI6MTczOTY4MTMyNSwicGF0aCI6Ii8yNTI2MjcyMi8zMzU1MjY4ODQtZWI1OGFlYWYtN2NjNy00MTcwLWIyNTMtMTIwMGI5OWQ1N2U5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE2VDA0NDg0NVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTk5YTRhOTE5MmY3ZGFkYTM4ZjU5OWU4YzgzNmU1OGMxMWI3MzAyMWFjNDRkNWU5MzY3YzgyNTA4MWFiMGRmZjEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.ZVpUiAyVtgKzU5FySEhzBQkdMI4SityUmHBDptDIROc)
For example, to start with a greeting:
gchat "Hi!"
For example, to set temperature to 0.8 and maximum output tokens to 1024, run:
gchat -t 0.8 -o 1024 "Hi!"
You may want to install multiple copies to customise them with different system messages or other settings.
An easy way to achieve it is to use alias, e.g.:
mkdir apps
cd apps
python3 -m venv assist explain quote illustrate summarize
source assist/bin/activate
pip install gchat
source explain/bin/activate
pip install gchat
source quote/bin/activate
pip install gchat
source illustrate/bin/activate
pip install gchat
source summarize/bin/activate
pip install gchat
nano .bashrc
Add the following aliases:
alias explain=$HOME/apps/explain/bin/gchat
alias illustrate=$HOME/apps/illustrate/bin/gchat
alias quote=$HOME/apps/quote/bin/gchat
alias assist=$HOME/apps/assist/bin/gchat
alias summarize=$HOME/apps/summarize/bin/gchat