Skip to content

liujiafu1514/Free-AUTO-GPT-with-NO-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

โš ๏ธ The Notebook on Google Colab is currently under maintenance โš ๏ธ

USE AI AGENTs, like AUTO-GPT or BABYAGI, without paids API๐Ÿ˜ค TOTALLY FOR FREE๐Ÿค‘

Tired of paying for OPENAI, PINECONE, GOOGLESEARCH APIs to try out the latest developments in the AI field? Perfect, this is the repository for you! ๐ŸŽ

For any problem open an ISSUE ๐Ÿšฌ, the project is very simple so any help is welcome๐Ÿ’ธ.

Are you bored reading๐Ÿ˜ด? Do you want to try our project nowโณ? Open the notebook on Colab everything is ready!

โš ๏ธ The Notebook on Google Colab is currently under maintenance โš ๏ธ Abusing this tool is at your own risk

image

By the way, thank you so much for Stars and all the support!!

WHY THIS REPOSITORY ? ๐Ÿค”

Hello everyone ๐Ÿฅฐ ,

I wanted to start by talking about how important it is to democratize AI. Unfortunately, most new applications or discoveries in this field end up enriching some big companies, leaving behind small businesses or simple projects. One striking example of this is Autogpt, an autonomous AI agent capable of performing tasks.

Autogpt and similar projects like BabyAGI only work with paid APIs, which is not fair. That's why I tried to recreate a simpler but very interesting and, above all, open-source version of Autogpt that does not require any API and does not need any particular hardware.

I believe that by providing free and open-source AI tools, we can give small businesses and individuals the opportunity to create new and innovative projects without the need for significant financial investment. This will allow for more equitable and diverse access to AI technology, which is essential for advancing society as a whole.


HOW TO GET CHATGPT & HUGGINGFACE TOKEN FREE ๐Ÿ”‘๐Ÿ”

  • HUGGINGFACE๐Ÿค— : Visit this simple official guide

  • Now Running also with HuggingCHAT

  • (OPTIONAL BUT BETTER RESULT) CHATGPT๐Ÿ–ฅ :

    1. Go to https://chat.openai.com/chat and open the developer tools by F12.
    2. Find the __Secure-next-auth.session-token cookie in Application > Storage > Cookies > https://chat.openai.com.
    3. Copy the value in the Cookie Value field.

image


HOW TO RUN CAMEL ๐Ÿซ

โš ๏ธ The Notebook on Google Colab is currently under maintenance โš ๏ธ Abusing this tool is at your own risk

Or use Locally :

Camel.mp4

HOW TO RUN BABY AGI ๐Ÿ‘ถ

โš ๏ธ The Notebook on Google Colab is currently under maintenance โš ๏ธ Abusing this tool is at your own risk

Or use Locally :

BAbyAGI.mp4

HOW TO RUN AUTOGPT ๐Ÿค–

โš ๏ธ The Notebook on Google Colab is currently under maintenance โš ๏ธ Abusing this tool is at your own risk

Or use Locally :

AUTOGPT.mp4

HOW TO RUN Your CUSTOM AGENT ๐Ÿค–

RUN NOW ON COLAB๐Ÿ˜ฎ Open in Colab โš ๏ธ Abusing this tool is at your own risk

Or use Locally :

  • Dowload the repository FREE AUTOGPT REPOSITORY
  • pip3 install -r requirements.txt
  • cd OtherAgent/
  • Choose or develop your agent [ csvAgent.py ; pythonAgent.py ; customAgent.py ]
  • Usage: python YourAgent.py
CustomAgent.mp4

HOW IT WORK ? ๐Ÿ”จ๐Ÿ”ฉ

To create an open-source version of Autogpt that does not require paid APIs or specific hardware, we performed a reverse engineering process on ChatGPT, a language model developed by OpenAI. By doing so, we were able to use the agents and new technologies of langchain for free.

We then created a custom LLM wrapper with langchain, which can be used as a plug-and-play solution with any langchain function or tool ๐Ÿ’ก.

from FreeLLM import ChatGPTAPI 

# Instantiate a ChatGPT object with your token
llm = ChatGPTAPI.ChatGPT((token="YOURTOKEN")  #for start new chat

# or if if u would to start from an existing chat 
# llm = ChatGPT(token = "YOUR-TOKEN", conversation = "Add-XXXX-XXXX-Convesation-ID")


# Generate a response based on the given prompt
response = llm("Hello, how are you?")

# Print the response
print(response)

Now support HuggingCHAT LLM

from FreeLLM import HuggingChatAPI 

# Instantiate a ChatGPT object with your token
llm = HuggingChatAPI.HuggingChat()  #for start new chat

# Generate a response based on the given prompt
response = llm("Hello, how are you?")

# Print the response
print(response)

exixstingchat

The code snippet provided above shows how to use our custom ChatGPT LLM class to interact with the language model. It requires a token from the ChatGPT API, which can be obtained from https://chat.openai.com/api/auth/session.

Please note that there is a limit of 50 requests per hour for each account on the ChatGPT API ๐Ÿ’ฃ. Therefore, we implemented a call counter in our ChatGPT class to prevent exceeding this limit.

We believe that our open-source version of Autogpt will promote equitable and diverse access to AI technology and empower individuals and small businesses to create innovative AI projects without significant financial investment.

This is an example of CUSTOM agent, in less of 60 line of code and totally for free, with:

  • Internet access
  • Python code execution
  • Wikipedia knowledge
#pip install langchain==0.0.150
from langchain.agents import initialize_agent #use for create new agent
from langchain.agents import initialize_agent, Tool

from langchain.utilities import PythonREPL #tool for execute python script
from langchain.utilities import WikipediaAPIWrapper #tool get wiki info
from langchain.tools import DuckDuckGoSearchTool #tool get interet live info

from FreeLLM import ChatGPTAPI # FREE CHATGPT API
#or
from FreeLLM import HuggingChatAPI 


# Instantiate a ChatGPT object with your token
llm = ChatGPTAPI.ChatGPT((token="YOURTOKEN")

# or use HuggingChatAPI if u dont have CHATGPT account
# llm = HuggingChatAPI.HuggingChat() 


# Define the tools
wikipedia = WikipediaAPIWrapper()
python_repl = PythonREPL()
search = DuckDuckGoSearchTool()

tools = [
    Tool(
        name = "python repl",
        func=python_repl.run,
        description="useful for when you need to use python to answer a question. You should input python code"
    )
]

wikipedia_tool = Tool(
    name='wikipedia',
    func= wikipedia.run,
    description="Useful for when you need to look up a topic, country or person on wikipedia"
)

duckduckgo_tool = Tool(
    name='DuckDuckGo Search',
    func= search.run,
    description="Useful for when you need to do a search on the internet to find information that another tool can't find. be specific with your input."
)

tools.append(duckduckgo_tool)
tools.append(wikipedia_tool)


#Create the Agent
iteration = (int(input("Enter the number of iterations: ")) if input("Do you want to set the number of iterations? (y/n): ") == "y" else 3)

zero_shot_agent = initialize_agent(
    agent="zero-shot-react-description", 
    tools=tools, 
    llm=llm,
    verbose=True,
    max_iterations=iteration,
)

# Start your Custom Agent in loop
print(">> STRAT CUSTOM AGENT")
print("> Digit 'exit' for exit or 'your task or question' for start\n\n")
prompt = input("(Enter your task or question) >> ")
while prompt.toLowerCase() != "exit":
    zero_shot_agent.run(prompt)
    prompt = input("(Enter your task or question) >> ")

Schermata del 2023-04-30 16-25-11

With this "CUSTOM LLM WRAPPER" now u can build or test your LLM APP's WITHOUT PAYing


๐Ÿค— Democratize AI ๐Ÿค—

Star History Chart

Stargazers repo roster for @IntelligenzaArtificiale/Free-AUTO-GPT-with-NO-API

Forkers repo roster for @IntelligenzaArtificiale/Free-AUTO-GPT-with-NO-API

By the way, thank you so much for Stars and all the support!!


LINK :


TODO , I NEED YOUR HELP

  • Create free LLM langchain wrapper based on Reverse Engineered ChatGPT API by OpenAI

  • Create a simple versione of AUTOGPT based on Camel theory

  • Find a way to replace OpenAIEmbeddings()

  • Create a simple version of AUTOGPT based on Baby AGI

  • Add web search agent

  • Add file writer agent

  • Finally AUTOGPT without paids API

  • Add other free Custom LLM wrapper Add this

  • Add long term memory

  • Find a way to replace PINECONE api

  • Find a way to replace official Google API


Inspiration and Credits ๐Ÿค—

RUN NOW ON COLAB๐Ÿ˜ฎ Open in Colab โš ๏ธ Abusing this tool is at your own risk

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published