fatdoge

fatdoge

https://im.fatdoge.im/
twitter
github
telegram

Maybe it's time to have your own "ChatGPT"

1280X1280.JPEG

This article will introduce detailed steps to help you quickly have a privately deployed ChatGPT Web App and explain the proprietary concepts involved.

Quick Start#

OpenAI Account Registration#

  • 🏠 Open the website and register: OpenAI

  • 📮 Use your personal email, preferably Gmail

  • 📱 Phone number verification

    • 🙅 This part does not support domestic phone numbers due to regional restrictions

    • 💰 Use a third-party platform to receive verification codes, such as: SMS-Activate, you can directly refer to the tutorial provided by the website

      • After completing the registration, recharge in the upper right corner, supporting Alipay, 1 USD is enough
      • Choose the 🇮🇳India region to purchase the number (cheaper)
      • Enter the purchased virtual number in the OpenAI registration page (do not paste the area code of the virtual number)
      • SMS-Activate should display the verification code, enter it into OpenAI (didn't receive it? The amount will be automatically refunded to the balance after 20 minutes)
        2001d95b690c43ccb3f021dd54471bed_tplv-k3u1fbpfcp-zoom-1.webp
  • 🙆 Successfully verified by the verification code

f67658f1dc93499ea203059db31085f8_tplv-k3u1fbpfcp-zoom-1.webp

Generate API Keys#

  • 🔑 After successful registration, click on the upper right corner to enter this page, and new users click Create new secret key

4f01b7a6002d4be7bf21bdb658fbc1de_tplv-k3u1fbpfcp-zoom-1.webp

  • ❗️ This key needs to be properly kept and will be used for deploying your own application later

Private Deployment#

  • Related repository: ChatGPT-Vercel

  • Vercel one-click deployment: Link (recommended to log in with your personal Github account)

Click on the first Github icon, Vercel will associate with your personal Github account, enter the name of the new repository and click Create to clone the repository. Enter the API key to start the deployment.

dc16200068684ba6b53ad6bd67c28147_tplv-k3u1fbpfcp-zoom-1.webp

a7115368-b8e6-4ef3-a2ec-97807dbdfb34.png

At this point, we have completed the deployment, and Vercel will automatically assign a domain.

screenshot-20230331-140814.png

  • Configure environment variables

In the previous step, we have set OPENAI_API_KEY before deployment. If you need to change it, there are two options:

  • There is a place on the page itself to set it, just fill it in ( this setting has a higher priority than Vercel ).

screenshot-20230331-141137.png

  • Go to Vercel for settings, path Settings / Environment Variables, the field name is OPENAI API KEY, and the value is the API key you created on the OpenAI platform.

4f9f56f5-7d52-4381-9e28-23166931c542.png
7cd80ad0-30e3-4a80-9c13-0f474425337e.png

  • Done

(Optional) Custom Domain#

  • Vercel can add custom domains, path Settings / Domains

  • Go to the service provider to configure CNAME to take effect.

b0c01ba1-fb93-4323-a82a-4cdb980cd15b.png

(Optional) Stay Up-to-Date with the Project#

Since the project we are using is constantly being iterated, if you use the method in step 3 above, Vercel will help you establish an independent private repository directly from the original project at the time of submission. If the original project adds new features or bug fixes, your repository will not be aware of them.

If you want to be able to update to new features and deploy new versions of the application in a timely manner after the original repository is updated, it is recommended that you first go to this repository to fork it, and then go to Vercel to import this forked project for deployment.

86177bbb-c201-466c-9c25-224839b91821.png

If there are new commits in the original repository at this time, Github will prompt you to sync the fork, so that you can update your repository to the latest version, and Vercel will automatically deploy it.

ad53b308-0e75-4d7d-b520-c0766ce38b39.jpeg

Other Methods#

Is API Usage Free and How is it Billed?#

The private deployment mentioned above uses the API service provided by OpenAI, and this is not free. You can see how much quota you have used so far on this page:

431642a0-2eb0-4b89-a9e6-e095a239c894.png

The above image shows that our account has a quota of 5 USD, which is valid for 3 months from the registration of the account. The gpt-3.5-turbo model used for API calls is charged at 0.002 USD per 1,000 tokens. That is, it is not charged based on the number of calls. OpenAI will merge the question and answer content of each conversation for calculation. Token calculation can be viewed in this repository or experience the algorithm visually by clicking here.

f7ed7659-a7be-4cb3-8446-713e665ed30a.png

Are There Other Ways to Use?#

Free! The premise is that you have an OpenAI account. You can also upgrade to ChatGPT Plus for $20 per month. The difference from the free version is that it is more stable, uses updated models, and can guarantee availability even during peak periods. The billing for ChatGPT Plus is separate from API calls.

3d01fb74-a766-4c45-b526-f4e4b4b38a52.png

Billed! Essentially, it still uses the API, so it will consume your quota, and the billing rules are different for different models. The use case is generally for developing specific applications based on the API and can be conveniently used for debugging prompt engineering and providing "examples" (examples of the expected input-output format) in the Playground.

abfba4aa-9450-4062-8577-8b4cf38873aa.png

  • Third-party

    • OpenCat - Requires API key, available on the App Store, supports iPhone / iPad / Mac
    • Access Siri - Requires API key Link
    • lencx/ChatGPT - Requires API key, cross-platform application (supports Mac, Windows, and Linux) Repository

From Usage to Development#

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.