Artificial intelligence

How to install ChatGPT locally on your computer

We can install ChatGPT on our computer, and in this article we will see together how to install ChatGPT on the computer locally.

ChatGPT was born as a variant of the GPT-3 linguistic model (Generative Pre-trained Transformer 3), developed by OpenAI . It was designed to generate text, as close to human as possible. Conversational-style, and usable for a variety of natural language processing tasks. For example chatbot, linguistic translation, and in all cases where the conversation can be considered as an answer to questions.

We can also install ChatGPT locally, and you can easily do this by installing the OpenAI API client, and setting up an API key. The OpenAI API client needs Python 3.7, and then you need to install it on your computer.

Installing ChatGPT as Python code:

To install chatGPT locally follow these steps:

  1. Install Python 3.7 or later, download it from the official site by clicking on the link
  1. Install the client OpenAI API :

You can do this by running the following command (pip: Package Installer for Python):

pip installa openai

At this point, you need to register on the OpenAI website to get API access to OpenAI. It's simple and quick, you can do it directly on the site open AI by clicking here.

At the end of the registration, an API key will be displayed in the private area which you will need later in the code, you will have to replace it where you will find written YOUR_API_KEY

  1. Install dependencies:

ChatGPT requires several python libraries to be installed, including requests, numpy, and tqdm.

The command to install the libraries:

pip install requests numpy tqdm
At this point, you can use ChatGPT by importing it into your Python code, and to do that you must use the method openai.Completion.create(). Here is an example:

import openai

# Set the API key
openai.api_key = “YOUR_API_KEY”

# Use the ChatGPT model to generate text
model_engine = “text-davinci-002”
prompt = “Hello, how are you today?”
completion = openai.Completion.create(engine=model_engine, prompt=prompt, max_tokens=1024, n=1,stop=None,temperature=0.7)
message = completion.choices[0].text
print(message)

Installing ChatGPT as an application:

If you want to install ChatGPT on a local system as an application:

Windows
# install the latest version 
winget install - id=lencx.ChatGPT -e 
# install the specified version 
winget install - id=lencx.ChatGPT -e - version 0.10.0

Note: If the installation path and application name are the same, a conflict will occur ( #142 )

Mac
brew tap lencx/chatgpt https://github.com/lencx/ChatGPT.git 
brew install - cask chatgpt - no-quarantine
  • Also, if you keep a brewfile , you can add something like this:
repo = "lencx/chatgpt" tap repo, "https://github.com/#{repo}.git" cask "chatgpt", args: { "no-quarantine": true }
Linux
  • chat-gpt_0.10.3_amd64.deb : Download the installer .deb, with small size, but with poor compatibility
  • chat-gpt_0.10.3_amd64.AppImage : Works reliably, you can try it if .deb it doesn't start
  • Available on AUR with the package name chatgpt-desktop-binand you can use your favorite AUR package manager to install it.
  • Furthermore, Gold is available with package name chatgpt-desktop-git.

You might also like:

For any questions, feel free to contact me writing here

Ercole Palmeri

You might also like
Innovation newsletter
Don't miss the most important news on innovation. Sign up to receive them by email.

Latest Articles

Green and Digital Revolution: How Predictive Maintenance is Transforming the Oil & Gas Industry

Predictive maintenance is revolutionizing the oil & gas sector, with an innovative and proactive approach to plant management.…

April 22 2024

UK antitrust regulator raises BigTech alarm over GenAI

The UK CMA has issued a warning about Big Tech's behavior in the artificial intelligence market. There…

April 18 2024

Casa Green: energy revolution for a sustainable future in Italy

The "Green Houses" Decree, formulated by the European Union to enhance the energy efficiency of buildings, has concluded its legislative process with…

April 18 2024

Ecommerce in Italy at +27% according to the new Report by Casaleggio Associati

Casaleggio Associati's annual report on Ecommerce in Italy presented. Report entitled “AI-Commerce: the frontiers of Ecommerce with Artificial Intelligence”.…

April 17 2024