Are you continue to accessing ChatGPT by the web site, or through third celebration instruments? How about making an attempt one thing completely different? You recognize, you don’t at all times must open your browser and navigate to the ChatGPT web site. You’ll be able to truly use ChatGPT straight out of your Mac’s Terminal as nicely.
Setting it up is fairly simple. On this tutorial, I’m going to information you thru simply that. So, let’s soar proper in and get began.
Observe: This works for Linux and Home windows too.
Step 1. Get an OpenAI API key
First, we have to get a brand new OpenAI API key. Join an OpenAI account for those who don’t have one, else simply log in to your account.
Search for the ‘USER’ part, then click on on ‘API keys‘.
Subsequent, create a brand new secret key by clicking ‘+ Create new secret key‘.
Make a copy of this API key as we’ll want it later.
Step 2. Set up Homebrew
Subsequent, we might want to set up Homebrew. Homebrew assist makes putting in different stuff we want in later stage straightforward.
To put in Homebrew, head over to the Homebrew’s web site. There, you’ll discover a line of code beneath the part ‘Set up Homebrew‘.
Or, you too can use the next code. Copy it, then go to your Terminal, paste it in, and hit Enter.
/bin/bash -c "$(curl -fsSL https://uncooked.githubusercontent.com/Homebrew/set up/HEAD/set up.sh)"
Observe: Take into accout, putting in Homebrew could take a little bit of time.
After every thing is completed, kind the next command within the Terminal and hit Enter.
brew --version
This can present the model of Homebrew you’ve put in, confirming that the set up is full.
Step 3. Set up AIChat
After acquiring your API key and efficiently putting in Homebrew, our subsequent step is to put in AIChat.
On the identical Terminal window, enter the next command and hit Enter.
brew set up airchat
This can start the set up of AIChat in your Mac. The set up course of needs to be fairly fast.
Step 4. Configure AIChat
With AIChat now put in, the subsequent step is to configure it. Since we’re assuming that is your first time setting it up, you’ll want to offer the next, in sequence, for the configuration.
- Enter “y” to create a brand new config file
- Paste in your API key.
- Enter “y” for those who don’t wish to use Proxy. (You usually gained’t want it.)
- Enter “y” if you wish to save all chat messages, else, simply hit “n”.
An editable model of the config file can be created and it may be discovered on the following location shall you wish to make any modifications later:
/Customers/<your_username>/Library/Utility Help/aichat/config.yaml
And that’s all there may be to it. Now you can begin utilizing ChatGPT proper out of your Mac’s terminal.
Step 5. Utilizing AIChat
To start out utilizing AIChat, merely kind within the following in Terminal and hit Enter.
aichat
That’s it! Now you can kind in your prompts and hit Enter. Watch for the responses simply as you’d when utilizing ChatGPT on-line.
Bonus: Additional Configuring AIChat
Earlier, I discussed {that a} copy of your configuration is saved at this location: /Customers/<your_username>/Library/Utility Help/aichat/config.yaml.
If you open that file, you’ll see your API key. Nonetheless, you possibly can add extra configurations to this file. As an illustration, you possibly can specify a selected ChatGPT mannequin for use.
Let’s check out an instance of the varied settings you possibly can outline in your configuration file.
api_key: "<YOUR SECRET API KEY>" # Request through https://platform.openai.com/account/api-keys organization_id: "org-xxx" # elective, set group id mannequin: "gpt-3.5-turbo" # elective, select a mannequin temperature: 1.0 # elective, see https://platform.openai.com/docs/api-reference/chat/create#chat/create-temperature save: true # elective, If set true, aichat will save chat messages to message.md spotlight: true # elective, Set false to show spotlight proxy: "socks5://127.0.0.1:1080" # elective, set proxy server. e.g. http://127.0.0.1:8080 or socks5://127.0.0.1:1080 conversation_first: false # elective, If set true, begin a dialog instantly upon repl light_theme: false # elective, If set true, use gentle theme connect_timeout: 10 # elective, Set a timeout in seconds for connect with gpt.
FAQs
To assist improve your expertise utilizing AIChat in your Mac’s terminal, right here’s some further data you may discover helpful.
1. Find out how to begin AIChat?
To start out AIChat, kind within the following in Termimal and hit Enter.
aichat
2. Find out how to give up AIChat?
To give up AIChat, kind within the observe in Terminal and hit Enter
.exit
Find out how to cease AIChat from producing response?
If you should instantly cease the response that ChatGPT is offering, use the next shortcut key:
Management + C
3. One-off request, vs. Dialog conscious.
Similar to common ChatGPT, AIChat isn’t in a position to deal with follow-up questions. So, for those who ask it, ‘what number of occasions has Germany gained the World Cup?‘, it gives you a solution.
Nonetheless, for those who follow-up asking, ‘what was their rating in 1954?‘, it gained’t have the ability to present a related response.
If you wish to ask questions which can be a part of a dialog, or follow-up questions, simply enter the next command and hit Enter.
.dialog
Then kind in your questions, one after the other.
4. Find out how to give up dialog mode?
To give up dialog mode, use this command:
.clear dialog
5. Find out how to change ChatGPT mannequin?
You’ll be able to change it proper within the Terminal itself. If in case you have entry to GPT-4, merely kind within the following command and hit Enter.
.mannequin gpt-4.
Alternatively, you possibly can seek advice from the “Additional Configuring AIChat” part above, the place you possibly can edit the ChatGPT mannequin model within the config file.
Ending
Aichat’ has extra capabilities than you may initially see. You’ll be able to kind .information
or .assist
to find extra options. Additionally, you possibly can go to the AIChat’s GitHub web page for extra detailed data.