|
2 | 2 | sidebar_position: 2
|
3 | 3 | ---
|
4 | 4 |
|
5 |
| -# Quickstart |
| 5 | +# Quickstart Guide |
6 | 6 |
|
7 |
| -## Install Node.js |
| 7 | +## Prerequisites |
8 | 8 |
|
9 |
| -https://docs.npmjs.com/downloading-and-installing-node-js-and-npm |
| 9 | +Before getting started with Eliza, ensure you have: |
10 | 10 |
|
11 |
| -## Using pnpm |
| 11 | +- [Node.js 22+](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) |
| 12 | +- [pnpm](https://pnpm.io/installation) |
| 13 | +- Git for version control |
| 14 | +- A code editor (VS Code recommended) |
| 15 | +- CUDA Toolkit (optional, for GPU acceleration) |
12 | 16 |
|
13 |
| -We use pnpm to manage our dependencies. It is faster and more efficient than npm, and it supports workspaces. |
14 |
| -https://pnpm.io/installation |
| 17 | +## Installation |
15 | 18 |
|
16 |
| -## Edit the .env file |
| 19 | +1. **Clone and Install** |
| 20 | +```bash |
| 21 | +# Clone the repository |
| 22 | +git clone https://github.com/ai16z/eliza.git |
| 23 | +cd eliza |
17 | 24 |
|
18 |
| -- Copy .env.example to .env and fill in the appropriate values |
19 |
| -- Edit the TWITTER environment variables to add your bot's username and password |
20 |
| - |
21 |
| -## Edit the character file |
| 25 | +# Install dependencies |
| 26 | +pnpm install |
22 | 27 |
|
23 |
| -- Check out the file `src/core/defaultCharacter.ts` - you can modify this |
24 |
| -- 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. |
| 28 | +# Install optional Sharp package if needed |
| 29 | +pnpm install --include=optional sharp |
| 30 | +``` |
25 | 31 |
|
26 |
| -### Run with Llama |
| 32 | +2. **Configure Environment** |
| 33 | +```bash |
| 34 | +# Copy example environment file |
| 35 | +cp .env.example .env |
| 36 | +``` |
27 | 37 |
|
28 |
| -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` |
| 38 | +Edit `.env` and add your values: |
| 39 | +```bash |
| 40 | +# Required environment variables |
| 41 | +DISCORD_APPLICATION_ID= # For Discord integration |
| 42 | +DISCORD_API_TOKEN= # Bot token |
| 43 | +OPENAI_API_KEY= # OpenAI API key (starting with sk-*) |
| 44 | +ELEVENLABS_XI_API_KEY= # API key from elevenlabs (for voice) |
| 45 | +``` |
29 | 46 |
|
30 |
| -### Run with Grok |
| 47 | +## Choose Your Model |
31 | 48 |
|
32 |
| -You can run Grok models by setting the `XAI_MODEL` environment variable to `grok-beta` |
| 49 | +Eliza supports multiple AI models: |
33 | 50 |
|
34 |
| -### Run with OpenAI |
| 51 | +- **Llama**: Set `XAI_MODEL=meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo` |
| 52 | +- **Grok**: Set `XAI_MODEL=grok-beta` |
| 53 | +- **OpenAI**: Set `XAI_MODEL=gpt-4o-mini` or `gpt-4o` |
35 | 54 |
|
36 |
| -You can run OpenAI models by setting the `XAI_MODEL` environment variable to `gpt-4o-mini` or `gpt-4o` |
| 55 | +For local inference: |
| 56 | +1. Set `XAI_MODEL` to your chosen model |
| 57 | +2. Leave `X_SERVER_URL` and `XAI_API_KEY` blank |
| 58 | +3. The system will automatically download the model from Hugging Face |
37 | 59 |
|
38 |
| -# Requires Node 20+ |
| 60 | +## Create Your First Agent |
39 | 61 |
|
40 |
| -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). |
| 62 | +1. **Edit the Character File** |
| 63 | +Check out `src/core/defaultCharacter.ts` to customize your agent's personality and behavior. |
41 | 64 |
|
42 |
| -## Additional Requirements |
| 65 | +You can also load custom characters: |
| 66 | +```bash |
| 67 | +pnpm start --characters="path/to/your/character.json" |
| 68 | +``` |
43 | 69 |
|
44 |
| -You may need to install Sharp. If you see an error when starting up, try installing it with the following command: |
| 70 | +2. **Start the Agent** |
| 71 | +```bash |
| 72 | +pnpm start |
| 73 | +``` |
45 | 74 |
|
| 75 | +## Platform Integration |
| 76 | + |
| 77 | +### Discord Bot Setup |
| 78 | +1. Create a new application at [Discord Developer Portal](https://discord.com/developers/applications) |
| 79 | +2. Create a bot and get your token |
| 80 | +3. Add bot to your server using OAuth2 URL generator |
| 81 | +4. Set `DISCORD_API_TOKEN` and `DISCORD_APPLICATION_ID` in your `.env` |
| 82 | + |
| 83 | +### Twitter Integration |
| 84 | +Add to your `.env`: |
| 85 | +```bash |
| 86 | +TWITTER_USERNAME= # Account username |
| 87 | +TWITTER_PASSWORD= # Account password |
| 88 | +TWITTER_EMAIL= # Account email |
| 89 | +TWITTER_COOKIES= # Account cookies |
46 | 90 | ```
|
47 |
| -pnpm install --include=optional sharp |
| 91 | + |
| 92 | +### Telegram Bot |
| 93 | +1. Create a bot through [@BotFather](https://t.me/botfather) |
| 94 | +2. Add your bot token to `.env`: |
| 95 | +```bash |
| 96 | +TELEGRAM_BOT_TOKEN=your_token_here |
48 | 97 | ```
|
49 | 98 |
|
50 |
| -# Environment Setup |
| 99 | +## Optional: GPU Acceleration |
51 | 100 |
|
52 |
| -You will need to add environment variables to your .env file to connect to various platforms: |
| 101 | +If you have an NVIDIA GPU: |
53 | 102 |
|
54 |
| -``` |
55 |
| -# Required environment variables |
56 |
| -# Start Discord |
57 |
| -DISCORD_APPLICATION_ID= |
58 |
| -DISCORD_API_TOKEN= # Bot token |
59 |
| -
|
60 |
| -# Start Twitter |
61 |
| -TWITTER_USERNAME= # Account username |
62 |
| -TWITTER_PASSWORD= # Account password |
63 |
| -TWITTER_EMAIL= # Account email |
64 |
| -TWITTER_COOKIES= # Account cookies |
65 |
| -``` |
66 |
| - |
67 |
| -# Local Setup |
| 103 | +```bash |
| 104 | +# Install CUDA support |
| 105 | +npx --no node-llama-cpp source download --gpu cuda |
68 | 106 |
|
69 |
| -## CUDA Setup |
| 107 | +# Ensure CUDA Toolkit, cuDNN, and cuBLAS are installed |
| 108 | +``` |
70 | 109 |
|
71 |
| -If you have an NVIDIA GPU, you can install CUDA to speed up local inference dramatically. |
| 110 | +## Basic Usage Examples |
72 | 111 |
|
| 112 | +### Chat with Your Agent |
| 113 | +```bash |
| 114 | +# Start chat interface |
| 115 | +pnpm run shell |
73 | 116 | ```
|
74 |
| -pnpm install |
75 |
| -npx --no node-llama-cpp source download --gpu cuda |
| 117 | + |
| 118 | +### Run Multiple Agents |
| 119 | +```bash |
| 120 | +pnpm start --characters="agent1.json,agent2.json" |
76 | 121 | ```
|
77 | 122 |
|
78 |
| -Make sure that you've installed the CUDA Toolkit, including cuDNN and cuBLAS. |
| 123 | +## Common Issues & Solutions |
79 | 124 |
|
80 |
| -## Running locally |
| 125 | +1. **Node.js Version** |
| 126 | + - Ensure Node.js 22+ is installed |
| 127 | + - Use `node -v` to check version |
| 128 | + - Consider using [nvm](https://github.com/nvm-sh/nvm) to manage Node versions |
81 | 129 |
|
82 |
| -Add XAI_MODEL and set it to one of the above options from [Run with |
83 |
| -Llama](#run-with-llama) - you can leave X_SERVER_URL and XAI_API_KEY blank, it |
84 |
| -downloads the model from huggingface and queries it locally |
| 130 | +2. **Sharp Installation** |
| 131 | + If you see Sharp-related errors: |
| 132 | + ```bash |
| 133 | + pnpm install --include=optional sharp |
| 134 | + ``` |
85 | 135 |
|
86 |
| -# Cloud Setup (with OpenAI) |
| 136 | +3. **CUDA Setup** |
| 137 | + - Verify CUDA Toolkit installation |
| 138 | + - Check GPU compatibility |
| 139 | + - Ensure proper environment variables are set |
87 | 140 |
|
88 |
| -In addition to the environment variables above, you will need to add the following: |
| 141 | +## Next Steps |
89 | 142 |
|
90 |
| -``` |
91 |
| -# OpenAI handles the bulk of the work with chat, TTS, image recognition, etc. |
92 |
| -OPENAI_API_KEY=sk-* # OpenAI API key, starting with sk- |
93 |
| -
|
94 |
| -# The agent can also ask Claude for help if you have an API key |
95 |
| -ANTHROPIC_API_KEY= |
96 |
| -
|
97 |
| -# For Elevenlabs voice generation on Discord voice |
98 |
| -ELEVENLABS_XI_API_KEY= # API key from elevenlabs |
99 |
| -
|
100 |
| -# ELEVENLABS SETTINGS |
101 |
| -ELEVENLABS_MODEL_ID=eleven_multilingual_v2 |
102 |
| -ELEVENLABS_VOICE_ID=21m00Tcm4TlvDq8ikWAM |
103 |
| -ELEVENLABS_VOICE_STABILITY=0.5 |
104 |
| -ELEVENLABS_VOICE_SIMILARITY_BOOST=0.9 |
105 |
| -ELEVENLABS_VOICE_STYLE=0.66 |
106 |
| -ELEVENLABS_VOICE_USE_SPEAKER_BOOST=false |
107 |
| -ELEVENLABS_OPTIMIZE_STREAMING_LATENCY=4 |
108 |
| -ELEVENLABS_OUTPUT_FORMAT=pcm_16000 |
109 |
| -``` |
| 143 | +Once you have your agent running, explore: |
| 144 | + |
| 145 | +1. 🤖 [Understand Agents](./core/agents.md) |
| 146 | +2. 📝 [Create Custom Characters](./core/characterfile.md) |
| 147 | +3. ⚡ [Add Custom Actions](./core/actions.md) |
| 148 | +4. 🔧 [Advanced Configuration](./guides/configuration.md) |
110 | 149 |
|
111 |
| -# Discord Bot |
| 150 | +For detailed API documentation, troubleshooting, and advanced features, check out our [full documentation](https://ai16z.github.io/eliza/). |
112 | 151 |
|
113 |
| -For help with setting up your Discord Bot, check out here: https://discordjs.guide/preparations/setting-up-a-bot-application.html |
| 152 | +Join our [Discord community](https://discord.gg/ai16z) for support and updates! |
0 commit comments