Skip to content

Create eliza.md #95

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 105 additions & 0 deletions docs/tutorial/eliza.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
---
sidebar_position: 4
---

# Working with eliza

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.

### Build a Trump agent with eliza and Gaia

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/).

#### Set up the environment

> Note: Ensure your Node.js version is above 0.23.0 before proceeding.

Firstly, clone the Eliza repository:

```
git clone https://github.com/elizaos/eliza.git
cd eliza
```

Next, install the required dependencies.

```
pnpm install
```

Then, build the local libraries.

```
pnpm build
```

#### Choose Gaia as the model service provider

After that, we will need to configure the environment and use a Gaia node as model service provider.

```
cp .env.example .env
```

Then, edit the `.env` file to include Gaia-related configuration values:

```
# Gaianet Configuration
GAIANET_MODEL=llama3b
GAIANET_SERVER_URL=https://llama3b.gaia.domains/v1

SMALL_GAIANET_MODEL= # Default: llama3b
SMALL_GAIANET_SERVER_URL= # Default: https://llama3b.gaia.domains/v1
MEDIUM_GAIANET_MODEL= # Default: llama
MEDIUM_GAIANET_SERVER_URL= # Default: https://llama8b.gaia.domains/v1
LARGE_GAIANET_MODEL= # Default: qwen72b
LARGE_GAIANET_SERVER_URL= # Default: https://qwen72b.gaia.domains/v1

GAIANET_EMBEDDING_MODEL=nomic-embed
USE_GAIANET_EMBEDDING=TRUE # Set to TRUE for GAIANET/768, leave blank for local
```
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.

#### Create the Trump agent

The default character templates are located in the `characters` folder.

Update the `modelProvider` for the desired character. For Gaia, the provider name is `gaianet`.

```
"name": "trump",
"clients": [],
"modelProvider": "gaianet",
"settings": {
"secrets": {},
"voice": {
"model": "en_US-male-medium"
}
},
"plugins": [],
```

Then, we can use the following command line to start running the agent.

```
pnpm run dev --character="characters/trump.character.json"
```

After the service runs successfully, we can launch the client UI to interact with the agent:

```
pnpm start:client
```

Finally, open `http://localhost:5174/` on your browser to start chatting with the agent.
<img width="1274" alt="image" src="https://github.com/user-attachments/assets/48474b35-1d40-4334-8ed0-c97f373c2b0b" />


### Advanced use case

For more inspiration, refer to[Nader Fabit's example on building a Twitter AI bot](https://x.com/dabit3/status/1863772029565981144).