Interactive GPT for text completions models
Welcome to iGPT, one way to call OpenAI's GPT models from Bash! This script allows you to easily query the OpenAI API from anywhere, using the text completions models available.
bash: The born again shell. An sh-compatible shell to run sh scripts.
curl: A tool to transfer data from or to a server
python: To convert the json reponses
Just download this script and run in your terminal by typing
bash igpt.sh
or make it executable and run it once
chmod +x igpt.sh
and then just run ./igpt.sh
You can download this image from docker hub
To get started, you need to have an OpenAI API Key
open your terminal or terminal emulator and run
bash igpt.sh
If your TOKEN (OpenAI API Key) is empty you must informing before using.
or run the program passing the TOKEN value
TOKEN=YOUR-TOKEN-HERE bash igpt.sh
Now you can make prompts to OpenAI. Enjoy it!
FIELD | DESCRIPTION |
---|---|
TOKEN | (OpenAI API Key) Default is empty, please provide a token before starting to prompt. |
MODEL | gpt-3.5-turbo-instruct |
TEMPERATURE | 1.0 |
MAX_TOKENS | 1000 |
You can also start this program changing the default values:
TOKEN=TOKEN-HERE MODEL=YOUR-MODEL TEMPERATURE=0.9 MAX_TOKENS=1000 bash igpt.sh
Just type ?
to interact with the menu and you'll see these following options:
OPTION | DESCRIPTION |
---|---|
1) Interact to ChatGPT | Return to prompt |
2) Insert Tokens | To change or insert a new Token |
3) Change Model | To change text completion models |
4) Change Temperature | To change the temperature of your response, from 0 to 2. |
5) Change Max Tokens | To change the max. tokens, according to the model. |
6) Quit | To exit the app. |
What would you like to do? [1-6]
You can choose an option from the list and follow the instructions in the terminal.
Remember your OpenAI API Key must be valid.
If you don't like the colors or want to try new colors, you can change the INPUT_COLOR, OUTPUT_COLOR, INFO_COLOR and ERROR_COLOR parameters according to the ASCII table.
This script runs in a text completion mode from OpenAI's API, and I'm working on it to use other endpoints.
This script runs on Linux. I haven't tested it on Windows, so I recommend using it with WSL.
If you notice any issues or want to contribute to the project, feel free to create an issue or a pull request on the Github repository. I appreciate all contributions and feedback!