Zero cost, Docker builds local ChatGPT

picture

Hi, friends, this is Xiaoyu.

In my last article, I shared about the creation of a ChatGPT account, and I also started from 0, and even the required network is prepared for everyone.

Of course, I didn't write a detailed documentation on the use of ti, and I still need everyone to study the use, or consult the author, so I persuaded some people who pursue convenience.

The popularity of ChatGPT may be somewhat reduced in some media. Although we know about it, we haven’t fully understood its charm. It does require a certain amount of energy to make good use of it, and even some professional technical level to expand the scope of application.

It also needs to invest a certain amount of cost. For example, the GPT 3.5 graphic model cannot meet actual needs, and the GPT 4.0 model can be upgraded to meet more applications.

However, in the actual use process, the use of the official environment is not very smooth, and it is easy to cut off half of the output.

Let's solve this problem as an advanced ChatGPT series.

Then, we deploy the ChatGPT environment locally, which can be played very smoothly and without restrictions, which is close to the use environment of the official website.

The method is to deploy the service locally through Docker using the image. The principle is also the way to use the API, which requires your account or Token permissions.

The first step, we need the next Docker, an open source container engine. It will be easier and more convenient to operate Docker on a linux server.

But we will use Docker in Windows environment to build this article, which is convenient for more partners to operate. If you are familiar with Linux, it will be more convenient and no additional operations are required.

We need to go to the official address of Docker and choose the installation environment of windows

Docker 官网地址: https://www.docker.com

picture

After downloading, install it directly according to the default method. After installation, if you want to start it, you need to open the virtual environment on your local machine.

As shown in the figure, enter the control panel, enter the program, click to enable or disable Windows features.

Then check Hyper-V, Windows Subsystem for Linux two options.

picture

The configuration has been successfully configured, and the virtualization status will be checked in the task manager. If it is enabled, the configuration is successful.

picture

If it is disabled, you need to check the virtualization status. Usually, enter the [systeminfo] command in the cmd command window, and the Hyper-V requirements will be displayed. If the four items in the box are all: Yes, it means success.

If the second item [Virtualization enabled in the firmware] is no, you need to enter Bios to open it, which will not be expanded here, and you can search for data processing by yourself.

picture

Here we proceed to the next step. After installing Docker normally, we can view the image in the Docker Desktop tool.

picture

Of course, configuring the Docker tool on Windows has a certain degree of complexity, and you may encounter a series of problems during the period, such as: insufficient memory allocation, subsystem needs to be upgraded, etc. You can also find related solutions for these, and I will not share them here. If necessary, you can chat with the author privately.

After the installation is successful, we can enter [docker --version] in cmd to check whether the installation is successful.

picture

Next, we can configure the accelerator of the Docker image, because cross-network transmission is very slow, usually we will configure some accelerators.

picture

At this point, the installation and configuration of Docker in the Windows environment is complete. It does take a few more steps to install Docker in the Windows environment, but it will be easier and more convenient to install Docker in Linux.

Next we need to use an open source project: Pandora.

镜像安装:docker pull pengzhile/pandora

When downloading the mirror image here, because the service is foreign, I obtained it through tizi. Don’t worry here. I also prepared tools for you in the previous article.

picture

As you can see, we have installed the mirror image, and then enter the following command for port mapping to start the container:

docker run  -e PANDORA_CLOUD=cloud -e PANDORA_SERVER=0.0.0.0:8899 -p 8899:8899 -d pengzhile/pandora

After execution:

picture

At this point, we have successfully created the container, enter: https://127.0.0.1:8899

The following website will appear, is it similar to the official website?

图片

Of course, you can use your own ChatGPT account or Token to log in here. After entering, the ChatGPT model you have follows the authority of your account.

If you have recently logged into the ChatGPT official website, you can go through this link:

chat.openai.com/api/auth/se…

图片

At this point, I can already use ChatGPT very fluently, and there will be no interception, no limit on the amount of words, and no risk of being banned from time to time.

Guess you like

Origin juejin.im/post/7257410745636634679