ai16z / eliza
- вторник, 29 октября 2024 г. в 00:00:01
Conversational Agent for Twitter and Discord
As seen powering @DegenSpartanAI and @MarcAIndreessen
https://docs.npmjs.com/downloading-and-installing-node-js-and-npm
src/core/defaultCharacter.ts
- you can modify thisnode --loader ts-node/esm src/index.ts --characters="path/to/your/character.json"
and run multiple bots at the same time.You might need these
npm install --include=optional sharp
You can run Llama 70B or 405B models by setting the XAI_MODEL
environment variable to meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo
or meta-llama/Meta-Llama-3.1-405B-Instruct
You can run Grok models by setting the XAI_MODEL
environment variable to grok-beta
You can run OpenAI models by setting the XAI_MODEL
environment variable to gpt-4o-mini
or gpt-4o
If you are getting strange issues when starting up, make sure you're using Node 20+. Some APIs are not compatible with previous versions. You can check your node version with node -v
. If you need to install a new version of node, we recommend using nvm.
You may need to install Sharp. If you see an error when starting up, try installing it with the following command:
npm install --include=optional sharp
You will need to add environment variables to your .env file to connect to various platforms:
# Required environment variables
# Start Discord
DISCORD_APPLICATION_ID=
DISCORD_API_TOKEN= # Bot token
# Start Twitter
TWITTER_USERNAME= # Account username
TWITTER_PASSWORD= # Account password
TWITTER_EMAIL= # Account email
TWITTER_COOKIES= # Account cookies
If you have an NVIDIA GPU, you can install CUDA to speed up local inference dramatically.
npm install
npx --no node-llama-cpp source download --gpu cuda
Make sure that you've installed the CUDA Toolkit, including cuDNN and cuBLAS.
Add XAI_MODEL and set it to one of the above options from Run with Llama - you can leave X_SERVER_URL and XAI_API_KEY blank, it downloads the model from huggingface and queries it locally
In addition to the environment variables above, you will need to add the following:
# OpenAI handles the bulk of the work with chat, TTS, image recognition, etc.
OPENAI_API_KEY=sk-* # OpenAI API key, starting with sk-
# The agent can also ask Claude for help if you have an API key
ANTHROPIC_API_KEY=
# For Elevenlabs voice generation on Discord voice
ELEVENLABS_XI_API_KEY= # API key from elevenlabs
# ELEVENLABS SETINGS
ELEVENLABS_MODEL_ID=eleven_multilingual_v2
ELEVENLABS_VOICE_ID=21m00Tcm4TlvDq8ikWAM
ELEVENLABS_VOICE_STABILITY=0.5
ELEVENLABS_VOICE_SIMILARITY_BOOST=0.9
ELEVENLABS_VOICE_STYLE=0.66
ELEVENLABS_VOICE_USE_SPEAKER_BOOST=false
ELEVENLABS_OPTIMIZE_STREAMING_LATENCY=4
ELEVENLABS_OUTPUT_FORMAT=pcm_16000
For help with setting up your Discord Bot, check out here: https://discordjs.guide/preparations/setting-up-a-bot-application.html