Significant-Gravitas / AutoGPT

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
https://agpt.co
Other
168.87k stars 44.48k forks source link

Solve the API cost issue! Free unlimited GPT-3.5 & GPT-4 #310

Closed tonymacx86PRO closed 1 year ago

tonymacx86PRO commented 1 year ago

Duplicates

Summary 💡

I am done some research about how I can use GPT-4 API for free with unlimited query!

Please don't abuse it How you can do it? Register on MindsDB (It's a SQL database that integrates AI into it) Now you maked a demo account that can create 2 models in the demo instance with openai (NO API KEY NEEDED), hf, tensorflow or pytorch Now you can "train" models with ur parameters like temperature, top_p and system prompt (prompt template)

Here's some sql queries to do some stuff

-- "Train" a model (For example gpt4)
CREATE MODEL mindsdb.gpt4 -- mindsdb.[yourmodelname]
PREDICT response -- What we want from model  a response!
USING -- Using WHAT?
engine = 'openai', -- OpenAI Engine
max_tokens = 6000, -- Adjusted max token size to 6k, you can make also temperature and more stuff...
-- api_key = demo instances already have one
model_name = 'gpt-4', -- you can also use text-davinci-003 or gpt-3.5-turbo
prompt_template = 'You are ChatGPT a large language model trained by OpenAI. Answer as concisely as possible. Knowledge cutoff: 2021 (year)\
Question: {{text}} Answer:'; -- Prompt template is similar to System Prompt
-- View the status of model
SELECT * -- Select all
FROM mindsdb.models -- From models table
WHERE name='gpt4'; -- Where is [yourmodelname] model
-- Query the model to response
SELECT response from mindsdb.[yourmodelname] WHERE text="[Prompt]";
-- Delete model
DROP MODEL mindsdb.gpt4; -- mindsdb.[yourmodelname]

And the awesome part u can use it with python using sql connector and ur credentials :D

import mysql.connector
import os

mindsdb = mysql.connector.connect(
    host = "cloud.mindsdb.com",
    user = os.environ.get("USER"),
    password = os.environ.get("PASSWORD"),
    port="3306"
)
cursor = mindsdb.cursor()

cursor.execute('''
SELECT response from mindsdb.gpt4
WHERE 
text="Make a mini rap about factory";
'')
for x in cursor:
     print(cursor)

More in MindsDB Docs

Examples 🌈

No response

Motivation 🔦

This will affect all comunity that uses paid expensive GPT-4 to make auto-tasks!

amauryfischer commented 1 year ago

I'm not sur this is under MindsDB terms of use. As they are paying to use openai on their side.

tonymacx86PRO commented 1 year ago

And i am not sure

tonymacx86PRO commented 1 year ago

In general, the worst part is that there are no analogues of GPT-4 and therefore you can't stupidly use this project

tonymacx86PRO commented 1 year ago

I don't understand at all why OpenAI closed its GPT-4 in paper?

tonymacx86PRO commented 1 year ago

Just then this project is useless if you can't pay for the API, I don't want to pay OpenAI at all just because there's no Paypal there and there's a credit card to leak it Horrible... I remember the last incident at OpenAI

tonymacx86PRO commented 1 year ago

I'm not sur this is under MindsDB terms of use. As they are paying to use openai on their side.

What do you suggest?

amauryfischer commented 1 year ago

@tonymacx86PRO I suggest you put 5 dollard on a virtual card so you can avoid card leak

tonymacx86PRO commented 1 year ago

@tonymacx86PRO I suggest you put 5 dollard on a virtual card so you can avoid card leak

I can't!

tonymacx86PRO commented 1 year ago

I will delete this issue if anyone doesn't care about the API, peace!

crypticsymmetry commented 1 year ago

super interesting, did you find a way to use it with auto gpt?

tonymacx86PRO commented 1 year ago

If u can connect via SQL connector and use it, u can of course!

crypticsymmetry commented 1 year ago

can you show me how you implemented it into the Auto-Gpt code? im curious how gpt4 works with it.

tonymacx86PRO commented 1 year ago

Like I have idea to make integration of sql mindsdb base but i have not implemented it yet

tonymacx86PRO commented 1 year ago

Maybe i will download AutoGPT and patch it

tonymacx86PRO commented 1 year ago

But my problem that mysql connector can't connect to the server with my auth I am still using via web editor

crypticsymmetry commented 1 year ago

apparently you can only use it within there web editor, to use it locally you have to add your own api key.

We use the OpenAI engine to create a model in MindsDB. Please note that the api_key parameter is optional on cloud.mindsdb.com but mandatory for local usage/on-premise. You can obtain an OpenAI API key by signing up for OpenAI’s API services on their website. Once you have signed up, you can find your API key in the API Key section of the OpenAI dashboard. You can then pass this API key to the MindsDB platform when creating models.

tonymacx86PRO commented 1 year ago

No, i tried via mysql connector and It worked i changed password of my account for this you don't need API key this cool part, i am from yesterday working on patched babyagi (freeagi)

Hamiltongilpin commented 1 year ago

I'm also looking for local and free autogpt integration if anyone figures it out :)