Code Monkey home page Code Monkey logo

baileys.cpp's Introduction

Baileys.cpp

Baileys.cpp

Tutorial video

Video tutorial

Spanish

Baileys.cpp es un pequeño fork de Llama.cpp y Baileys para poder tener un Whatsapp Bot usando un modelo de Inteligencia Artificial Vicuna. Usando el proyecto Llama.cpp como base, que a su vez es una versión compilada de Large Language Model Meta AI, Baileys.cpp le permite crear WhatsApp Bots con facilidad.

Características

  • Baileys.cpp utiliza un modelo entrenado con 13 mil millones de parámetros, con un peso de hasta 4 GB. El modelo admite más de 20 idiomas diferentes. También tiene la opción de agregar números de WhatsApp a la lista de ignorados. Cuando se recibe un mensaje, el bot verificará si la persona está en la lista de ignorados y la ignorará si lo está.

  • También puede agregar un contexto o crear una personalidad para el bot: asígnele un nombre y defina lo que puede o no puede hacer. Para hacer esto, simplemente edite el archivo example/example.ts.

  • Puede definir el número de ejecuciones simultáneas del bot, si recibe más solicitudes de las que tiene permitido este en su lugar devolverá un mensaje al usuario diciendo que está ocupado procesando la información de otro usuario.

Tenga en cuenta que este proyecto es solo una idea y puede no tener un desarrollo futuro.

Compatibilidad

Baileys.cpp ha sido probado en ARM Ampere A1 con 24 GB de RAM.

Instalación

Para instalar Baileys.cpp, simplemente clone el repositorio usando:

git clone https://github.com/HirCoir/Baileys.cpp

Para definir el número máximo de solicitudes simultáneas que puede procesar el bot (modelo Llama.cpp), debes editar el archivo example.ts que se encuentra en la carpeta Example, donde editarás el valor de "const maxProcesses=1;" donde el valor predeterminado es 1.

Una vez dentro del directorio, crea el contenedor docker ejecutando:

docker build -t baileys_cpp .

Alternativamente, puede instalarlo manualmente en su servidor clonando los siguientes repositorios:

Luego, mueva la carpeta llama.cpp dentro de la carpeta Baileys.cpp, instala las dependencias necesarias: cmake make gcc g++ git, nodejs 18 y yarn usando:

sudo apt-get install cmake make gcc g++ git -y
curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo npm install -g yarn

Dentro de la carpeta Baileys.cpp, ejecuta el siguiente comando para instalar las dependencias requeridas:

cd Baileys.cpp
yarn

Luego, descargue el modelo Vicuna de https://huggingface.co/CRD716/ggml-vicuna-1.1-quantized/blob/main/ggml-vicuna-7b-1.1-q4_0.bin haciendo clic en Descargar y muévalo a carpeta llama.cpp. Asegúrese de que la carpeta llama.cpp esté dentro de la carpeta Baileys.cpp.

Para definir el número máximo de solicitudes simultáneas que puede procesar el bot (modelo Llama.cpp), debes editar el archivo example.ts que se encuentra en la carpeta Example, donde editarás el valor de "const maxProcesses=1;" donde el valor predeterminado es 1.

Finalmente, para iniciar el bot, ejecute:

yarn example

¡Escanee el código QR generado y comience a usar el bot!

English

Baileys.cpp is a small fork of Llama.cpp and Baileys to be able to have a Whatsapp Bot using a Vicuna Artificial Intelligence model. Using the Llama.cpp project as a base, which in turn is a compiled version of Large Language Model Meta AI, Baileys.cpp allows you to create WhatsApp Bots with ease.

Features

  • Baileys.cpp uses a model trained with 13 Billion parameters, weighing up to 4GB. The model supports more than 20 different languages. You also have the option to add WhatsApp numbers to the ignore list. When a message is received, the bot will check if the person is on the ignore list and ignore them if they are.

  • You can also add a context or create a personality for the bot - give it a name and define what it can or cannot do. To do this, simply edit the example/example.ts file.

  • You can define the number of simultaneous executions of the bot, if it receives more requests than it is allowed it will instead return a message to the user saying that it is busy processing the information of another user.

Please note that this project is only an idea and may not have future development.

Compatibility

Baileys.cpp has been tested on ARM Ampere A1 with 24GB RAM.

Installation

To install Baileys.cpp, simply clone the repository using:

git clone https://github.com/HirCoir/Baileys.cpp

To define the maximum number of simultaneous requests that the bot can process (Llama.cpp model), you must edit the example.ts file that is in the Example folder, where you will edit the value of "const maxProcesses = 1;" where the default is 1.

Once inside the directory, build the docker container by running:

docker build -t baileys_cpp .

Alternatively, you can manually install it on your server by cloning the following repositories:

Then, move the llama.cpp folder inside the Baileys.cpp folder, install the necessary dependencies: cmake make gcc g++ git, nodejs 18 and yarn using:

sudo apt-get install cmake make gcc g++ git -y
curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo npm install -g yarn

Inside the Baileys.cpp folder, run the following command to install the required dependencies:

cd Baileys.cpp
yarn

Then, download the Vicuna model from https://huggingface.co/CRD716/ggml-vicuna-1.1-quantized/blob/main/ggml-vicuna-7b-1.1-q4_0.bin by clicking on Download and move it to the llama.cpp folder. Ensure the llama.cpp folder is within the Baileys.cpp folder.

To define the maximum number of simultaneous requests that the bot can process (Llama.cpp model), you must edit the example.ts file that is in the Example folder, where you will edit the value of "const maxProcesses = 1;" where the default is 1.

Finally, to start the bot, run:

yarn example

Scan the generated QR code and start using the bot!

baileys.cpp's People

Contributors

adiwajshing avatar azmcode avatar hircoir avatar dependabot[bot] avatar kaatt avatar auties00 avatar rahulkasireddy avatar purpshell avatar edgardmessias avatar fadiinho avatar xxirfanx avatar moskoweb avatar lyfe00011 avatar fatiharridho avatar frmdeveloper avatar ibnusyawall avatar azudindaem avatar leonardobein avatar lightningneko avatar burstfreeze avatar ravindu01manoj avatar alenvelocity avatar nilsirl avatar pe77 avatar barkerpedro avatar prince-mendiratta avatar viniciusgdr avatar bhavya32 avatar faizbastomi avatar zennn08 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.