Skip to content
Open
Show file tree
Hide file tree
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
15 changes: 14 additions & 1 deletion agent-tee-phala/image/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,17 @@ yarn-error.log*

# OS
.DS_Store
Thumbs.db
Thumbs.db

# Eliza Agent
*.ts
dist
!index.ts
!character.ts
.env
node_modules
dist/

db.sqlite
.idea
.tee-cloud
2 changes: 2 additions & 0 deletions agent-tee-phala/image/agent/eliza-starter/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.env
.tee-cloud
101 changes: 101 additions & 0 deletions agent-tee-phala/image/agent/eliza-starter/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# Required environment variables
DISCORD_APPLICATION_ID=
DISCORD_API_TOKEN= # Bot token
OPENAI_API_KEY=sk-* # OpenAI API key, starting with sk-
REDPILL_API_KEY= # REDPILL API Key
GROK_API_KEY= # GROK API Key
GROQ_API_KEY=gsk_*
OPENROUTER_API_KEY=
GOOGLE_GENERATIVE_AI_API_KEY= # Gemini API key

ELEVENLABS_XI_API_KEY= # API key from elevenlabs

# ELEVENLABS SETTINGS
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

TWITTER_DRY_RUN=false
TWITTER_USERNAME= # Account username
TWITTER_PASSWORD= # Account password
TWITTER_EMAIL= # Account email
TWITTER_COOKIES= # Account cookies

X_SERVER_URL=
XAI_API_KEY=
XAI_MODEL=

#POST INTERVAL RANDOM MIN-MAX MINUTES
POST_INTERVAL_MIN= #90 #Default
POST_INTERVAL_MAX= #180 #Default


#USE IMAGE GEN
IMAGE_GEN= #TRUE

#Leave blank to use local embeddings
USE_OPENAI_EMBEDDING= #TRUE

#OpenRouter (Use one model for everything or set individual for small, medium, large tasks)
#leave blank to use defaults hermes 70b for small tasks & 405b for medium/large tasks
OPENROUTER_MODEL=
SMALL_OPENROUTER_MODEL=
MEDIUM_OPENROUTER_MODEL=
LARGE_OPENROUTER_MODEL=


#Set to Use for New OLLAMA provider
OLLAMA_SERVER_URL= #Leave blank for default localhost:11434
OLLAMA_MODEL=
OLLAMA_EMBEDDING_MODEL= #default mxbai-embed-large
#To use custom model types for different tasks set these
SMALL_OLLAMA_MODEL= #default llama3.2
MEDIUM_OLLAMA_MODEL= #default herems3
LARGE_OLLAMA_MODEL= #default hermes3:70b

# For asking Claude stuff
ANTHROPIC_API_KEY=

# Heurist API (Get API Key at https://heurist.ai/dev-access)
HEURIST_API_KEY=
SMALL_HEURIST_MODEL=
MEDIUM_HEURIST_MODEL=
LARGE_HEURIST_MODEL=
HEURIST_IMAGE_MODEL=

# DeepSeek Configuration
DEEPSEEK_API_KEY=
DEEPSEEK_API_URL= # Default: https://api.deepseek.com
SMALL_DEEPSEEK_MODEL= # Default: deepseek-chat
MEDIUM_DEEPSEEK_MODEL= # Default: deepseek-chat
LARGE_DEEPSEEK_MODEL= # Default: deepseek-chat

WALLET_PRIVATE_KEY=EXAMPLE_WALLET_PRIVATE_KEY
WALLET_PUBLIC_KEY=EXAMPLE_WALLET_PUBLIC_KEY

BIRDEYE_API_KEY=

SOL_ADDRESS=So11111111111111111111111111111111111111112
SLIPPAGE=1
BASE_MINT=So11111111111111111111111111111111111111112
RPC_URL=https://api.mainnet-beta.solana.com
HELIUS_API_KEY=


## Telegram
TELEGRAM_BOT_TOKEN=

TOGETHER_API_KEY=
SERVER_PORT=3000

# Starknet
STARKNET_ADDRESS=
STARKNET_PRIVATE_KEY=

# When true, disables interactive chat mode for background process operation
DAEMON_PROCESS=false
61 changes: 61 additions & 0 deletions agent-tee-phala/image/agent/eliza-starter/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Use a specific Node.js version for better reproducibility
FROM node:23.3.0-slim AS builder

# Install pnpm globally and install necessary build tools
RUN npm install -g pnpm@9.15.1 && \
apt-get update && \
apt-get install -y git python3 make g++ && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Set Python 3 as the default python
RUN ln -s /usr/bin/python3 /usr/bin/python

# Set the working directory
WORKDIR /app

# Copy package.json and other configuration files
COPY package.json ./
COPY pnpm-lock.yaml ./
COPY tsconfig.json ./

# Copy the rest of the application code
COPY ./src ./src
COPY ./characters ./characters

# Install dependencies and build the project
RUN pnpm install
RUN pnpm build

# Create dist directory and set permissions
RUN mkdir -p /app/dist && \
chown -R node:node /app && \
chmod -R 755 /app

# Switch to node user
USER node

# Create a new stage for the final image
FROM node:23.3.0-slim

# Install runtime dependencies if needed
RUN npm install -g pnpm@9.15.1
RUN apt-get update && \
apt-get install -y git python3 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

WORKDIR /app

# Copy built artifacts and production dependencies from the builder stage
COPY --from=builder /app/package.json /app/
COPY --from=builder /app/node_modules /app/node_modules
COPY --from=builder /app/src /app/src
COPY --from=builder /app/characters /app/characters
COPY --from=builder /app/dist /app/dist
COPY --from=builder /app/tsconfig.json /app/
COPY --from=builder /app/pnpm-lock.yaml /app/

EXPOSE 3000
# Set the command to run the application
CMD ["pnpm", "start", "--non-interactive"]
21 changes: 21 additions & 0 deletions agent-tee-phala/image/agent/eliza-starter/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2025 ai16z

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
94 changes: 94 additions & 0 deletions agent-tee-phala/image/agent/eliza-starter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# Eliza

## Edit the character files

Open `src/character.ts` to modify the default character. Uncomment and edit.

### Custom characters

To load custom characters instead:
- Use `pnpm start --characters="path/to/your/character.json"`
- Multiple character files can be loaded simultaneously

### Add clients
```
# in character.ts
clients: [Clients.TWITTER, Clients.DISCORD],

# in character.json
clients: ["twitter", "discord"]
```

## Duplicate the .env.example template

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

\* Fill out the .env file with your own values.

### Add login credentials and keys to .env
```
DISCORD_APPLICATION_ID="discord-application-id"
DISCORD_API_TOKEN="discord-api-token"
...
OPENROUTER_API_KEY="sk-xx-xx-xxx"
...
TWITTER_USERNAME="username"
TWITTER_PASSWORD="password"
TWITTER_EMAIL="your@email.com"
```

## Install dependencies and start your agent

```bash
pnpm i && pnpm start
```
Note: this requires node to be at least version 22 when you install packages and run the agent.

## Run with Docker

### Build and run Docker Compose (For x86_64 architecture)

#### Edit the docker-compose.yaml file with your environment variables

```yaml
services:
eliza:
environment:
- OPENROUTER_API_KEY=blahdeeblahblahblah
```

#### Run the image

```bash
docker compose up
```

### Build the image with Mac M-Series or aarch64

Make sure docker is running.

```bash
# The --load flag ensures the built image is available locally
docker buildx build --platform linux/amd64 -t eliza-starter:v1 --load .
```

#### Edit the docker-compose-image.yaml file with your environment variables

```yaml
services:
eliza:
environment:
- OPENROUTER_API_KEY=blahdeeblahblahblah
```

#### Run the image

```bash
docker compose -f docker-compose-image.yaml up
```

# Deploy with Railway

[![Deploy on Railway](https://railway.com/button.svg)](https://railway.com/template/aW47_j)
Loading