May 25, 2023

Create Your Local ChatGPT

Forward

It will be great if we have our local ChatGPT especially when we have difficulty using Google. By following this post, you will be able to create your local ChatGPT so you do not need to use your VPN all the time while you are working unless you need to login to your OpenAI account.

In this post, I will show you how to create your local ChatGPT service or you can set up it on your cloud server if you have one.


Environments & Tools

Environments

Tools


Steps

  1. Download and install Docker.

    image-20230525020638713


    If you are installing docker on a cloud server, use docker --version to validate the installation.

    image-20230525020855093

  2. Install Pandora in the docker

    1
    docker pull pengzhile/pandora
    1
    docker run  -e PANDORA_CLOUD=cloud -e PANDORA_SERVER=0.0.0.0:8899 -p 8899:8899 -d pengzhile/pandora
  3. If you are installing on localhost, you can skip this step. If you are installing on the cloud server side, follow this step.

    Pandora is running on port 8899 by default, so we need to open port 8899 for it.

    Go to your cloud server security group, and open port 8899.

    image-20230525021652192

  4. Done.

    Now your local ChatGPT service is ready to use. If you are installing Pandora on the cloud server side, visit your cloud server public IPv4 address followed by Pandora running port 8899 or visit from the localhost if you are installing Pandora on the localhost.

    Eg.

    Visit from localhost: http://127.0.0.1:8899

    image-20230525022328482

    You should be able to see this page, use your OpenAI account to log in.

  5. (Optional) Acquire your Access Token.

    After successfully logging in to ChatGPT, enter the URL below to get your Access Token.

    http://chat.openai.com/api/auth/session

    image-20230525023429794

    Record all content (Orange part) wrapped inside “accessToken”: “Record_All_Content” so you can log in via Access Token.


Demo

All the chat history was the same either from the localhost, cloud server side, or OpenAI ChatGPT.

image-20230525024238547

Cloud Server side

image-20230525024341597

OpenAI ChatGPT side

Last words

In the description of the project Pandora, it mentioned you will only need to use VPN to log in to your OpenAI account, once you have logged in, you will no longer need to use your VPN until your Access Token expired.

The Access Token is only valid for 14 days“ which I am doubting about it. Based on my seen in the Access Token, it says its expiration period is around a month o.0 ) so I am not sure about how often you need to re-login your account to get a new Access Token. Will test it after I back to China.

There are a few free VPNs to use for iOS which I found is USABLE, I will put the link below, you can use them for free. (But you need to watch ads)

Note: It may be unavailable in your region! At least I can find it in the Australia region App Store : )

IMG_2027

HotspotShield VPN & Wifi Proxy

https://apps.apple.com/au/app/hotspotshield-vpn-wifi-proxy/id443369807

IMG_2028

VPN Master - Secure VPN

https://apps.apple.com/au/app/vpn-master-secure-vpn/id1025707485



Reference

About this Post

This post is written by Andy, licensed under CC BY-NC 4.0.

#ChatGPT