For the complete documentation index, see llms.txt. This page is also available as Markdown.

Deploy Your Own DeFi AI Agent

Practical guide for Rujira community members who want to run their own always-on AI agent to do DeFi.

This guide uses Hermes Agent, an open-source, self-hosted autonomous AI agent built by Nous Research, as the agent runtime. Hermes runs on a VPS, connects to an external LLM provider, and exposes a Telegram bot so you can control it from your phone.

Hermes Agent is designed as a persistent personal assistant that runs continuously on a user's own infrastructure (such as a $5 VPS, local machine, or serverless environment) rather than being a session-based chatbot.

The setup below keeps costs low by running only the agent on the VPS and sending model calls to Codex/OpenAI, Claude/Anthropic, OpenCode, or another provider.

What You Will Build

Telegram app on your phone
        |
        | messages
        v
Telegram bot
        |
        | Hermes gateway
        v
VPS running Hermes Agent
        |
        +-- LLM provider: Codex, Claude, OpenCode, etc.
        +-- Skills: Rujira, Vultisig, coding workflows
        +-- Optional wallet tooling through Vultisig

The VPS is the always-on machine. The LLM provider is the brain. Telegram is the remote control. Skills are instruction packs that teach the agent how to do specific work.

Before You Start

You need:

  • A basic comfort level with SSH and terminal commands.

  • A VPS with Ubuntu 24.04 LTS.

  • One LLM provider account.

  • A Telegram account.

  • Optional: a Vultisig wallet if you want the agent to help with wallet operations.

Security rule: start with read-only tasks. Do not give an agent meaningful funds, production credentials, or broad server access on day one.

1. Rent A VPS

Hermes Agent itself does not need a large server when it uses external model APIs.

Recommended starting size:

You can usually run smaller, but 2 vCPU and 4 GB RAM leaves more room for browser tools, logs, skills, and package installs.

Provider
Best For
Suggested Plan Shape

Hetzner Cloud

Low-cost EU hosting

2 vCPU / 4 GB RAM Ubuntu server

DigitalOcean

Beginner-friendly dashboard

2 vCPU / 4 GB RAM Ubuntu Droplet

Choose Hetzner if you mostly care about price. Choose DigitalOcean if you want a simpler dashboard and more beginner-friendly docs.

2. Prepare The Server

Connect into the server as root with SSH:

Create a normal user for Hermes:

If you use SSH keys, copy your root SSH keys to the new user:

Switch to the Hermes user:

Install the small set of packages Hermes needs before its installer runs:

Enable a basic firewall:

Do not open random inbound ports yet. The Telegram polling setup works with outbound HTTPS only, so you do not need to expose a web server.

3. Install Hermes Agent

Install Hermes Agent with the official installer:

Reload your shell:

Check that the command is available:

If hermes is not found, add the user-local binary path:

Hermes stores its main files here:

Path
Purpose

~/.hermes/config.yaml

Non-secret config

~/.hermes/.env

API keys and secrets

~/.hermes/skills/

Local skills

~/.hermes/sessions/

Conversation/session state

~/.hermes/logs/

Runtime logs

Run the setup wizard:

If you use Nous Portal (a web UI), the shortest setup path is:

After setup, start a local test chat:

Ask something harmless:

Exit with Ctrl+C or /quit.

4. Connect An LLM Provider

Hermes needs at least one model provider. The easiest way is the interactive model setup:

This writes the model choice into Hermes config and stores secrets in ~/.hermes/.env or Hermes auth storage.

Option A: Codex / OpenAI

Use this if you already use ChatGPT/Codex or OpenAI API.

Hermes supports two useful OpenAI paths:

Path
Hermes Provider
When To Use

Codex OAuth

openai-codex

You want Hermes to authenticate with ChatGPT/Codex device login.

OpenAI API key

openai-api

You want direct API billing through an OpenAI API key.

Interactive setup:

Choose OpenAI Codex if you want the device-code login flow.

For direct OpenAI API usage, edit:

Add:

Then choose OpenAI API in:

Optional: if you also use the Codex CLI and want Hermes to call Codex as a tool through MCP, configure the Codex MCP preset:

This is separate from using OpenAI/Codex as the model provider.

Option B: Claude / Anthropic

Use this if you already use Anthropic API or Claude Code.

Edit the Hermes environment file:

Add:

Then run:

Choose Anthropic.

Hermes also supports Anthropic OAuth through hermes model, but current Hermes docs note that this path requires Claude Max plus extra usage credits. If that is confusing, use ANTHROPIC_API_KEY.

Option C: OpenCode Go

Use this if you want a cost-efficient coding model provider.

OpenCode has two relevant provider paths in Hermes:

OpenCode Product
Hermes Provider
Env Var

OpenCode Go

opencode-go

OPENCODE_GO_API_KEY

OpenCode Zen

opencode-zen

OPENCODE_ZEN_API_KEY

OpenCode Go is the cheaper monthly option in current OpenCode docs. Prices can change, so check the official OpenCode page before relying on the number.

Edit:

Add:

Then run:

Choose OpenCode Go and pick the model offered by the wizard. Use the wizard instead of hardcoding model names, because provider catalogs change.

5. Connect Hermes To Telegram

Telegram lets you control the agent from anywhere. The simple VPS setup uses polling, so the VPS does not need an inbound public web server.

Create A Telegram Bot

  1. Open Telegram.

  2. Message @BotFather.

  3. Send:

  1. Pick a display name.

  2. Pick a username ending in bot.

  3. Copy the bot token.

Treat the bot token like a password. Anyone with the token can control the bot.

Find Your Telegram User ID

Hermes uses numeric Telegram user IDs, not usernames.

The Hermes docs suggest using:

  • @userinfobot

  • @get_id_bot

Save the numeric ID.

Configure Telegram In Hermes

Run:

Choose Telegram and enter:

  • Bot token from BotFather.

  • Your numeric Telegram user ID.

The wizard writes the config for you.

Manual config lives in:

The important values are:

Use comma-separated IDs for multiple allowed users:

Do not use:

That would let anyone who finds the bot talk to an agent that may have terminal and wallet tools.

Test Telegram

Run the gateway in the foreground:

Open Telegram and message your bot:

If it replies, the connection works.

Stop the foreground gateway with Ctrl+C.

Keep The Gateway Running After Logout

Install Hermes gateway as a user service:

Make sure it keeps running after you log out:

View logs:

For a VPS, this user-service plus linger setup is usually enough. If you prefer a boot-time system service, Hermes also supports:

Use one gateway service style, not both.

Useful Telegram Commands

Inside Telegram, try:

Command
Purpose

/help

Show available commands

/new

Start a fresh conversation

/status

Show current session status

/model

Show or switch model if configured

/stop

Stop a running task

/background <task>

Run a task in the background

/sethome

Set the current chat as the home channel

For group chats, keep Telegram privacy mode in mind. With privacy mode on, the bot mostly sees commands and direct replies. With privacy mode off, or if the bot is an admin, it can see more group messages. Use group access carefully.

6. Add Useful Skills

Skills are instruction files. They teach Hermes how to handle a specific kind of work, like Rujira contract interactions, Vultisig wallet actions, or code review. The easiest is to PASTE these instructions into hermes once setup and tell him to save these skills.

Hermes skills live under:

A typical skill looks like:

Do not copy third-party skill contents from this guide. Skill files can change. Always fetch or inspect the latest version from the source.

Rujira Skill

Use the latest Rujira skill file from the Rujira UI repository:

Suggested local path:

This skill gives the agent Rujira-specific context: secured assets, contract interaction patterns, FIN, Ghost, staking, bRUNE, deployment lookup, and safe transaction checks.

Vultisig Skill

Use the latest Vultisig skill file:

Suggested local path:

This skill teaches the agent how to reason about Vultisig, MPC wallets, CLI usage, SDK usage, supported chains, and wallet operations.

Hermes Built-In And Optional Skills

Hermes ships with bundled skills and optional skills. Check the official catalogs:

Useful categories for Rujira community agents:

Skill Type
Why It Helps

Coding workflow skills

Better code review, repo exploration, testing, and refactoring.

Git/GitHub/GitLab skills

Help with issues, PRs, commits, and release notes.

Docker/Linux skills

Help maintain the VPS and debug services.

Security review skills

Help catch risky shell commands, leaked secrets, and unsafe wallet workflows.

Research skills

Help summarize docs, contracts, and protocol changes.

Keep skills focused. A huge skill that tries to teach everything usually works worse than a small skill for one exact workflow.

7. Set Up A Vultisig Wallet For The Agent

Use a wallet only after the agent is stable, the Telegram allowlist is working, and you understand what commands it can run.

For AI agents, Vultisig is useful because it is an MPC wallet. In simple terms, the private key is split across parties, so the server does not need to hold one normal seed phrase that can drain everything if stolen.

Wallet Safety Rules

  • Start with tiny amounts.

  • Keep a separate human wallet for large balances. You need to first gather experience with the agent.

  • Use allowlists for Telegram users.

  • Keep the VPS updated.

Install Vultisig CLI

Follow the latest Vultisig skill and docs. Current quick start:

Check the command:

Inspect the current create command before using it:

Follow the latest Vultisig skill for the exact command. Prefer interactive prompts if available, so secrets do not land in shell history.

Choose A Vault Type

Vault Type
Best For
Tradeoff

FastVault

Small agent wallet, bots, quick automation

Faster, more convenient

SecureVault

Higher-value funds, team custody

More coordination, safer for serious balances

For a first Rujira agent wallet, use FastVault only with limited funds. Move to SecureVault for meaningful treasury or protocol operations.

First Wallet Tasks

Start with read-only checks:

Only after that should you test a tiny transfer.

8. Rujira-Specific First Tasks

Once Hermes, Telegram, skills, and optional Vultisig are working, start with safe Rujira tasks:

When you start using the agent for real wallet operations, require the agent to show:

  • Contract address.

  • Exact execute message.

  • Exact funds array.

  • Expected denom.

  • Amount in base units and display units.

  • Risk notes.

  • A clear "ready to sign?" confirmation.

9. Maintenance

Update the server:

Update Hermes:

Restart the gateway if needed:

Check status:

Check logs:

Back up important config:

Do not blindly back up ~/.hermes/.env or wallet material to cloud storage. It contains secrets.

Troubleshooting

Problem
Likely Cause
Fix

hermes: command not found

~/.local/bin not in PATH

Reload shell or add export PATH="$HOME/.local/bin:$PATH"

Hermes says no model is configured

Provider setup not complete

Run hermes model

Telegram bot does not reply

Gateway not running or user not allowed

Run hermes gateway status and check TELEGRAM_ALLOWED_USERS

Telegram works in DM but not group

Privacy mode or group permissions

Configure privacy in BotFather or make bot admin

Gateway stops after SSH logout

User service not lingering

Run sudo loginctl enable-linger $USER

Agent can answer but not use tools

Tools not configured

Run hermes tools

Agent spends too much

Expensive model/provider

Switch provider/model with hermes model

Wallet actions feel risky

Too much permission too soon

Go back to read-only tasks and require manual signing

Security Checklist

Before using the agent for anything important:

  • TELEGRAM_ALLOWED_USERS is set.

  • GATEWAY_ALLOW_ALL_USERS is not set.

  • The bot token is not in a public repo.

  • API keys are only in ~/.hermes/.env or provider auth storage.

  • The VPS uses SSH keys.

  • The VPS firewall is enabled.

  • Wallet funds are limited.

  • The agent explains transaction details before signing.

  • You know how to stop the gateway:

References

  • Hermes Agent installation: https://hermes-agent.nousresearch.com/docs/getting-started/installation

  • Hermes Agent quickstart: https://hermes-agent.nousresearch.com/docs/getting-started/quickstart

  • Hermes AI providers: https://hermes-agent.nousresearch.com/docs/integrations/providers

  • Hermes MCP: https://hermes-agent.nousresearch.com/docs/user-guide/features/mcp

  • Hermes Telegram setup: https://hermes-agent.nousresearch.com/docs/user-guide/messaging/telegram

  • Hermes messaging gateway: https://hermes-agent.nousresearch.com/docs/user-guide/messaging

  • Hermes skills system: https://hermes-agent.nousresearch.com/docs/user-guide/features/skills

  • Hermes bundled skills catalog: https://hermes-agent.nousresearch.com/docs/reference/skills-catalog

  • Hermes optional skills catalog: https://hermes-agent.nousresearch.com/docs/reference/optional-skills-catalog

  • Rujira skill file: https://gitlab.com/thorchain/rujira-ui/-/blob/agentic-skills/packages/main/public/SKILL.md?ref_type=heads

  • Vultisig skill file: https://vultisig.com/skills/SKILL.md

  • Vultisig SDK repository: https://github.com/vultisig/vultisig-sdk

  • Hetzner Cloud: https://www.hetzner.com/cloud

  • DigitalOcean Droplets: https://www.digitalocean.com/products/droplets

  • OpenCode providers: https://opencode.ai/docs/providers

  • OpenCode Go: https://opencode.ai/docs/go

  • OpenAI Codex auth: https://developers.openai.com/codex/auth

  • Anthropic authentication: https://platform.claude.com/docs/en/manage-claude/authentication

Last updated