gpt4free-demo
gpt4free-demo copied to clipboard
A slow guide on setting up a free OpenAI GPT-4 API on your local machine.
Welcome to gpt4free-demo 👋
Set up a free OpenAI GPT-4 API on your own
Demo
Usage
Follow these steps to get gpt4free-demo up and running:
-
Clone the Repository:
git clone https://github.com/username/gpt4free-demo.git cd gpt4free-demo -
Set Up Environment Variables: Copy the example environment file and set up your own variables:
cp .env.example .envOpen
.envwith your preferred text editor and fill in your own values for the given variables. Save and close the file when you're finished. -
Start the Services: Start your services using Docker Compose:
docker-compose up -d
If you change any environment variables in your
.envfile, restart your services withdocker-compose downanddocker-compose up -d. -
Access the API: Once the services are running, the API will be accessible at:
- Find supports model and site:
http://127.0.0.1:13000/supports[GET] - Return when chat is complete:
http://127.0.0.1:13000/ask?prompt=***&model=***&site=***[POST/GET] - Return with event stream:
http://127.0.0.1:13000/ask/stream?prompt=***&model=***&site=***[POST/GET]
More usage examples can be found at xiangsx/gpt4free-ts.
- Find supports model and site:
Certainly! If you want to include instructions on how to use hurl to test the API in the README, you can add a new section like this:
Testing with Hurl
Hurl is a command-line tool to run HTTP requests. You can use it to test the endpoints in this API. Here's how you can get started:
-
Install Hurl: Follow the instructions on the official website to install Hurl on your system.
-
Create a Hurl File: You can create a file with a
.hurlextension to define the HTTP requests you want to test. Here's an examplegpt.hurlfile for this project:# List all supports model GET http://127.0.0.1:13000/supports # Call Vita model GET http://127.0.0.1:13000/ask [QueryStringParams] site: vita model: gpt-3.5-turbo prompt: Tell me a joke about Software Engineering -
Run the Hurl File: Use the following command to execute the
gpt.hurlfile:hurl --verbose gpt.hurlThis will run the defined HTTP requests and print the responses to the terminal.
-
Read the Documentation: For more advanced usage, you can refer to the samples documentation.
Resources
Reference Videos
Author
- Website: productsway.com
- Twitter: @jellydn
- Github: @jellydn

