Skip to content

Commit 1cdcc53

Browse files
authored
Create eliza.md
1 parent 74586c6 commit 1cdcc53

File tree

1 file changed

+105
-0
lines changed

1 file changed

+105
-0
lines changed

docs/tutorial/eliza.md

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
---
2+
sidebar_position: 4
3+
---
4+
5+
# Working with eliza
6+
7+
eliza is a simple, fast, and lightweight AI agent framework. Recently, eliza has integrated Gaia as one of the [model service provider](https://github.com/elizaOS/eliza/pull/762). This means you can now use Gaia as the LLM service backend for the Eliza framework.
8+
9+
### Build a Trump agent with eliza and Gaia
10+
11+
This guide demonstrates how to create an agent with Trump-like characteristics using [the Get Started guide from eliza](https://elizaos.github.io/eliza/docs/quickstart/).
12+
13+
#### Set up the environment
14+
15+
> Note: Ensure your Node.js version is above 0.23.0 before proceeding.
16+
17+
Firstly, clone the Eliza repository:
18+
19+
```
20+
git clone https://github.com/elizaos/eliza.git
21+
cd eliza
22+
```
23+
24+
Next, install the required dependencies.
25+
26+
```
27+
pnpm install
28+
```
29+
30+
Then, build the local libraries.
31+
32+
```
33+
pnpm build
34+
```
35+
36+
#### Choose Gaia as the model service provider
37+
38+
After that, we will need to configure the environment and use a Gaia node as model service provider.
39+
40+
```
41+
cp .env.example .env
42+
```
43+
44+
Then, edit the `.env` file to include Gaia-related configuration values:
45+
46+
```
47+
# Gaianet Configuration
48+
GAIANET_MODEL=llama3b
49+
GAIANET_SERVER_URL=https://llama3b.gaia.domains/v1
50+
51+
SMALL_GAIANET_MODEL= # Default: llama3b
52+
SMALL_GAIANET_SERVER_URL= # Default: https://llama3b.gaia.domains/v1
53+
MEDIUM_GAIANET_MODEL= # Default: llama
54+
MEDIUM_GAIANET_SERVER_URL= # Default: https://llama8b.gaia.domains/v1
55+
LARGE_GAIANET_MODEL= # Default: qwen72b
56+
LARGE_GAIANET_SERVER_URL= # Default: https://qwen72b.gaia.domains/v1
57+
58+
GAIANET_EMBEDDING_MODEL=nomic-embed
59+
USE_GAIANET_EMBEDDING=TRUE # Set to TRUE for GAIANET/768, leave blank for local
60+
```
61+
By using this configuration, the system will utilize the Llama 3b Gaia domain as the LLM backend. You can replace `GAIANET_SERVER_URL` with a URL for your custom node or domain.
62+
63+
#### Create the Trump agent
64+
65+
The default character templates are located in the `characters` folder.
66+
67+
Update the `modelProvider` for the desired character. For Gaia, the provider name is `gaianet`.
68+
69+
```
70+
"name": "trump",
71+
"clients": [],
72+
"modelProvider": "gaianet",
73+
"settings": {
74+
"secrets": {},
75+
"voice": {
76+
"model": "en_US-male-medium"
77+
}
78+
},
79+
"plugins": [],
80+
```
81+
82+
Then, we can use the following command line to start running the agent.
83+
84+
```
85+
pnpm run dev --character="characters/trump.character.json"
86+
```
87+
88+
After the service runs successfully, we can launch the client UI to interact with the agent:
89+
90+
```
91+
pnpm start:client
92+
```
93+
94+
Finally, open `http://localhost:5174/` on your browser to start chatting with the agent.
95+
<img width="1274" alt="image" src="https://github.com/user-attachments/assets/48474b35-1d40-4334-8ed0-c97f373c2b0b" />
96+
97+
98+
### Advanced use case
99+
100+
For more inspiration, refer to[Nader Fabit's example on building a Twitter AI bot](https://x.com/dabit3/status/1863772029565981144).
101+
102+
103+
104+
105+

0 commit comments

Comments
 (0)