Coder Social home page Coder Social logo

babyblue26 / agentllm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from idosal/agentllm

1.0 0.0 0.0 10.63 MB

AgentLLM is a PoC for browser-native autonomous agents

Home Page: https://agentllm.vercel.app

License: GNU General Public License v3.0

Shell 0.42% JavaScript 59.81% TypeScript 39.20% CSS 0.45% Dockerfile 0.11%

agentllm's Introduction

AgentLLM

Demo Medium Badge Twitter Follow


AgentLLM is the first proof of concept to utilize an open-source large language model (LLM) to develop autonomous agents that operate solely on the browser. Its main goal is to demonstrate that embedded LLMs have the ability to handle the complex goal-oriented tasks of autonomous agents with acceptable performance. Learn more on Medium and feel free to check out the demo.

ย 

AgentLLM.mp4

ย 

The implementation of the embedded LLM builds on the fantastic research of WebLLM, which takes advantage of Chromium's bleeding edge introduction of WebGPU to run inference utilizing the GPU. It offers significant performance gains over the previously available CPU-based implementations.

To create a sanitary and accessible sandbox, I chose to modify the popular AgentGPT project by replacing ChatGPT with WizardLM and changing the prompt mechanism. At its core, AgentGPT allows deploying autonomous agents to perform any arbitrary goal (from basic tasks to complex problem solving) by running a loop of task generation and execution. It's a perfect match for our requirements as its agents do not use tools, eliminating the complexity and unpredictability of external factors (which is present in full-blown implementations of other popular frameworks), and its GUI is friendly and feature-rich. The sandbox enables quick prototyping of the models' ability to break down tasks and plan ahead (feel free to try it!).

Consider supporting AgentGPT (the template for this project) by clicking here.

๐Ÿš€ Motivation

Recent advancements in large language models (LLMs) like OpenAI's ChatGPT and GPT-4 have led to the rise of autonomous agents that can act independently, without human intervention, to achieve specified goals. However, most notable LLMs require massive computational resources, restricting their operation to powerful remote servers. Their remote operation leads to a variety of issues concerning privacy, cost, and availability. Enter browser-native LLMs come in, changing the way we think about autonomous agents and their potential applications.


Disclaimer

This project is a proof-of-concept utilizing experimental technologies. It is by no means a production-ready implementation, and it should not be used for anything other than research. It's provided "as-is" without any warranty, expressed or implied. By using this software, you agree to assume all risks associated with its use, including but not limited to data loss, system failure, or any other issues that may arise.

โžก๏ธ Getting Started

๐Ÿƒ Running the demo

  1. Install Chrome or Edge. Make sure you're up-to-date (at least M113 Chromium version).
  2. Launch the browser (preferably with --enable-dawn-features=disable_robustness for performance). For example, in MacOS with Chrome, run the following command in the terminal: /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --enable-dawn-features=disable_robustness
  3. Navigate to AgentLLM

Since running the model locally is very taxing, lower-tier devices may not be able to run the demo. For the best experience, try AgentLLM on a powerful desktop device.

๐Ÿณ Docker Setup

The easiest way to run AgentLLM locally is by using docker. A convenient setup script is provided to help you get started.

./setup.sh --docker

Docker-compose

Using docker-compose deploy

./setup.sh --docker-compose

๐Ÿ‘ท Local Development Setup

If you wish to develop AgentLLM locally, the easiest way is to use the provided setup script.

./setup.sh --local

๐Ÿ› ๏ธ Manual Setup

๐Ÿšง You will need Nodejs +18 (LTS recommended) installed.

  1. Fork this project:
  1. Clone the repository:
git clone [email protected]:YOU_USER/AgentLLM.git
  1. Install dependencies:
cd AgentLLM
npm install
  1. Create a .env file with the following content:

๐Ÿšง The environment variables must match the following schema.

# Deployment Environment:
NODE_ENV=development

# Next Auth config:
# Generate a secret with `openssl rand -base64 32`
NEXTAUTH_SECRET=changeme
NEXTAUTH_URL=http://localhost:3000
DATABASE_URL=file:./db.sqlite

# Your open api key
OPENAI_API_KEY=changeme
  1. Modify prisma schema to use sqlite:
./prisma/useSqlite.sh

Note: This only needs to be done if you wish to use sqlite.

  1. Ready ๐Ÿฅณ, now run:
# Create database migrations
npx prisma db push
npm run dev

๐Ÿš€ GitHub Codespaces

Set up AgentLLM in the cloud immediately by using GitHub Codespaces.

  1. From the GitHub repo, click the green "Code" button and select "Codespaces".
  2. Create a new Codespace or select a previous one you've already created.
  3. Codespaces opens in a separate tab in your browser.
  4. In terminal, run bash ./setup.sh --local
  5. When prompted in terminal, add your OpenAI API key.
  6. Click "Open in browser" when the build process completes.
  • To shut AgentLLM down, enter Ctrl+C in Terminal.
  • To restart AgentLLM, run npm run dev in Terminal.

Run the project ๐Ÿฅณ

npm run dev

agentllm's People

Stargazers

 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.