Giter VIP home page Giter VIP logo

deploy-chatgpt-to-api's Introduction

Deploy ChatGPT to API

These days I found an interesting repo ChatGPT to API. You can deploy a fake API using the web version of ChatGPT.
However, it's docs are not specific. This repo is to help you easily config and deploy ChatGPT to API.

Requirements

  • git
  • python3
  • Docker (if deploy in Docker)
  • golang and go command in PATH (if deploy in host)
  • One or more ChatGPT accounts

Steps

  1. Clone this repo to somewhere (suppose /dcta/)
  2. Edit the following variables in run.py:
    • proxy: format: host:port. If you don't need proxy, set it to ""
    • proxy_type: possible values: "socks5" or "http"
    • accounts: It's a dictionary of accounts' info. Multiple users are supported. See the example bellow
    • server_host: the host you want ChatGPT-to-API to listen
    • server_port: the port you want ChatGPT-to-API to listen

image
3. If deployed in host: run pip3 install -r requirements.txt
If deployed in docker: nothing to do in this step
4. run build.py and follow the instructions.
5. run the service:
If deployed in docker:
open a terminal in /dcta/. run docker compose up -d
If deployed in host: open a terminal in /dcta/. run run.py
6. Enjoy~

FAQ

  • Q: What if the access_token of OpenAI expire?
    A: If this happen, the request to the fake api will cause 500 status code in ChatGPT-to-API. I use python to inspect this code and will regenerate access_token and restart ChatGPT-to-API automatically.

deploy-chatgpt-to-api's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.