Coder Social home page Coder Social logo

gpt4free-demo's Introduction

Welcome to gpt4free-demo 👋

How to setup a free OpenAI GPT-4 API on your own

IT Man - Tech #38 - Setting Up Your Own Free GPT-4 API with gpt4free-ts [Vietnamese]

Demo

https://gyazo.com/482f04e3061ebec1e12d39cd3850265d.gif https://gyazo.com/d44a9ad144deb85e8a29952926acae43.gif

Usage

  1. Clone this repository to your local machine.
git clone https://github.com/username/gpt4free-demo.git
  1. Navigate into the cloned directory.
cd gpt4free-demo
  1. There is an example environment file in this directory called .env.example. You need to copy this file and rename the copy to .env. You can do this with the following command:
cp .env.example .env
  1. Open the newly created .env file with your preferred text editor. Fill in your own values for the given variables. Save and close the file when you're finished.

  2. Now, you can start your services using Docker Compose. Run the following command:

docker-compose up -d

https://gyazo.com/d9a6b8be62174b2c6d227334ff8adc6c.gif

This command will start the services defined in your docker-compose.yml file in the background and leave them running.

Note: If you change any environment variables in your .env file, you will need to stop and restart your services for the changes to take effect. You can do this with docker-compose down and docker-compose up -d respectively.

  1. Once the services are running, the API will be accessible at http://127.0.0.1:13000. You can test it using the following examples:

    • Forefront Model

      http://127.0.0.1:13000/ask?prompt=whoareyou&model=forefront
      http://127.0.0.1:13000/ask/stream?prompt=whoareyou&model=forefront
      
    • MCBBS Model

      http://127.0.0.1:13000/ask?prompt=nothing&model=mcbbs&messages=[{"role":"system","content":"IMPORTANT: You are a virtual assistant powered by the gpt-3.5-turbo model, now time is 2023/6/3 13:42:27}"},{"role":"user","content":"你好\n"},{"role":"assistant","content":"你好!有什么我可以帮助你的吗?"},{"role":"user","content":"写个冒泡排序\n"}]
      
    • You Model

      http://127.0.0.1:13000/ask?prompt=whoareyou&model=you
      http://127.0.0.1:13000/ask/stream?prompt=whoareyou&model=you
      

Resources

Reference videos

IT Man - Talk #34 - Bye Bye #Docker Desktop [Vietnamese]

IT Man - Tip #36 - #Raycast AI - #ChatGPT - Anytime, anywhere [Vietnamese]

Author

Show your support

kofi paypal buymeacoffee

gpt4free-demo's People

Contributors

renovate[bot] avatar jellydn avatar

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.