|
| 1 | +--- |
| 2 | +id: "index" |
| 3 | +title: "eliza" |
| 4 | +sidebar_label: "Readme" |
| 5 | +sidebar_position: 0 |
| 6 | +custom_edit_url: null |
| 7 | +--- |
| 8 | + |
| 9 | +# Eliza |
| 10 | + |
| 11 | +<img src="./docs/eliza_banner.jpg" alt="Eliza Banner" width="100%" /> |
| 12 | + |
| 13 | +*As seen powering [@DegenSpartanAI](https://x.com/degenspartanai) and [@MarcAIndreessen](https://x.com/pmairca)* |
| 14 | + |
| 15 | +- Multi-agent simulation framework |
| 16 | +- Add as many unique characters as you want with [characterfile](https://github.com/lalalune/characterfile/) |
| 17 | +- Full-featured Discord and Twitter connectors, with Discord voice channel support |
| 18 | +- Full conversational and document RAG memory |
| 19 | +- Can read links and PDFs, transcribe audio and videos, summarize conversations, and more |
| 20 | +- Highly extensible - create your own actions and clients to extend Eliza's capabilities |
| 21 | +- Supports open source and local models (default configured with Nous Hermes Llama 3.1B) |
| 22 | +- Supports OpenAI for cloud inference on a light-weight device |
| 23 | +- "Ask Claude" mode for calling Claude on more complex queries |
| 24 | +- 100% Typescript |
| 25 | + |
| 26 | +# Getting Started |
| 27 | + |
| 28 | +## Install Node.js |
| 29 | +https://docs.npmjs.com/downloading-and-installing-node-js-and-npm |
| 30 | + |
| 31 | +## Edit the .env file |
| 32 | +- Copy .env.example to .env and fill in the appropriate values |
| 33 | +- Edit the TWITTER environment variables to add your bot's username and password |
| 34 | + |
| 35 | +## Edit the character file |
| 36 | +- Check out the file `src/core/defaultCharacter.ts` - you can modify this |
| 37 | +- You can also load characters with the `node --loader ts-node/esm src/index.ts --characters="path/to/your/character.json"` and run multiple bots at the same time. |
| 38 | + |
| 39 | +### Linux Installation |
| 40 | +You might need these |
| 41 | +``` |
| 42 | +npm install --include=optional sharp |
| 43 | +``` |
| 44 | + |
| 45 | +### Run with Llama |
| 46 | +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` |
| 47 | + |
| 48 | +### Run with Grok |
| 49 | +You can run Grok models by setting the `XAI_MODEL` environment variable to `grok-beta` |
| 50 | + |
| 51 | +### Run with OpenAI |
| 52 | +You can run OpenAI models by setting the `XAI_MODEL` environment variable to `gpt-4o-mini` or `gpt-4o` |
| 53 | + |
| 54 | +# Requires Node 20+ |
| 55 | +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](https://github.com/nvm-sh/nvm). |
| 56 | + |
| 57 | +## Additional Requirements |
| 58 | +You may need to install Sharp. If you see an error when starting up, try installing it with the following command: |
| 59 | +``` |
| 60 | +npm install --include=optional sharp |
| 61 | +``` |
| 62 | + |
| 63 | +# Environment Setup |
| 64 | + |
| 65 | +You will need to add environment variables to your .env file to connect to various platforms: |
| 66 | +``` |
| 67 | +# Required environment variables |
| 68 | +# Start Discord |
| 69 | +DISCORD_APPLICATION_ID= |
| 70 | +DISCORD_API_TOKEN= # Bot token |
| 71 | +
|
| 72 | +# Start Twitter |
| 73 | +TWITTER_USERNAME= # Account username |
| 74 | +TWITTER_PASSWORD= # Account password |
| 75 | +TWITTER_EMAIL= # Account email |
| 76 | +TWITTER_COOKIES= # Account cookies |
| 77 | +``` |
| 78 | + |
| 79 | +# Local Setup |
| 80 | + |
| 81 | +## CUDA Setup |
| 82 | + |
| 83 | +If you have an NVIDIA GPU, you can install CUDA to speed up local inference dramatically. |
| 84 | +``` |
| 85 | +npm install |
| 86 | +npx --no node-llama-cpp source download --gpu cuda |
| 87 | +``` |
| 88 | + |
| 89 | +Make sure that you've installed the CUDA Toolkit, including cuDNN and cuBLAS. |
| 90 | + |
| 91 | +## Running locally |
| 92 | +Add XAI_MODEL and set it to one of the above options from [Run with |
| 93 | +Llama](#run-with-llama) - you can leave X_SERVER_URL and XAI_API_KEY blank, it |
| 94 | +downloads the model from huggingface and queries it locally |
| 95 | + |
| 96 | +# Cloud Setup (with OpenAI) |
| 97 | + |
| 98 | +In addition to the environment variables above, you will need to add the following: |
| 99 | +``` |
| 100 | +# OpenAI handles the bulk of the work with chat, TTS, image recognition, etc. |
| 101 | +OPENAI_API_KEY=sk-* # OpenAI API key, starting with sk- |
| 102 | +
|
| 103 | +# The agent can also ask Claude for help if you have an API key |
| 104 | +ANTHROPIC_API_KEY= |
| 105 | +
|
| 106 | +# For Elevenlabs voice generation on Discord voice |
| 107 | +ELEVENLABS_XI_API_KEY= # API key from elevenlabs |
| 108 | +
|
| 109 | +# ELEVENLABS SETTINGS |
| 110 | +ELEVENLABS_MODEL_ID=eleven_multilingual_v2 |
| 111 | +ELEVENLABS_VOICE_ID=21m00Tcm4TlvDq8ikWAM |
| 112 | +ELEVENLABS_VOICE_STABILITY=0.5 |
| 113 | +ELEVENLABS_VOICE_SIMILARITY_BOOST=0.9 |
| 114 | +ELEVENLABS_VOICE_STYLE=0.66 |
| 115 | +ELEVENLABS_VOICE_USE_SPEAKER_BOOST=false |
| 116 | +ELEVENLABS_OPTIMIZE_STREAMING_LATENCY=4 |
| 117 | +ELEVENLABS_OUTPUT_FORMAT=pcm_16000 |
| 118 | +``` |
| 119 | + |
| 120 | +# Discord Bot |
| 121 | +For help with setting up your Discord Bot, check out here: https://discordjs.guide/preparations/setting-up-a-bot-application.html |
0 commit comments