Skip to content

Floyd11/opengradient-helper-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenGradient Helper Bot 🤖

Open-source Telegram bot for OpenGradient ecosystem developers. Built by the community. Every AI response is TEE-verified via og.LLM and includes a payment_hash as on-chain proof.

Architecture

User (Telegram)
      │
      ▼
 aiogram 3.x (polling)
      │
 ┌────┴──────────────────────────────┐
 │              bot.py               │
 │                                   │
 │  /start /about /faucet            │ ← static, no LLM
 │  /snippets  /models               │ ← inline buttons, no LLM
 │                                   │
 │  free-form question               │
 │    → detect_intent()              │ ← keyword match
 │    → fetch_snippet() (httpx)      │ ← raw GitHub file
 │    → og.LLM.chat()               │ ← TEE-verified answer
 │    → reply + 🔐 payment_hash      │
 └───────────────────────────────────┘
      │
      ▼
 og.LLM → x402 Gateway → TEE (Intel TDX) → Base Sepolia

Quick Start

# 1. Clone
git clone https://github.com/Floyd11/opengradient-helper-bot
cd opengradient-helper-bot

# 2. Virtual environment
python3.10 -m venv venv
source venv/bin/activate

# 3. Install dependencies
pip install -r requirements.txt

# 4. Configure
cp .env.example .env
nano .env   # add bot token, OG private key, GitHub repo

# 5. Run
python bot.py

Deploy on VPS (systemd)

sudo cp og-helper.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable og-helper
sudo systemctl start og-helper

# View logs
sudo journalctl -u og-helper -f

Configuration (.env)

Variable Description
TELEGRAM_BOT_TOKEN From @BotFather
OG_PRIVATE_KEY Testnet wallet key — get $OPG at faucet.opengradient.ai
GITHUB_REPO Your cookbook fork, e.g. username/OpenGradient-Cookbook

Commands

Command Description Uses LLM?
/start Welcome message No
/about OpenGradient overview No
/snippets Cookbook snippet catalog On button tap
/models Model Hub links No
/faucet Get testnet $OPG No
(any text) Free-form Q&A Yes

How the proof works

Every response generated by og.LLM contains a payment_hash — a transaction hash on Base Sepolia proving the inference ran inside a TEE (Trusted Execution Environment). The bot appends a Basescan link to every AI answer:

🔐 Generated in TEE | Proof: 0xabc123... → basescan link

License

MIT

About

OpenGradient Helper Bot - A Telegram bot for OpenGradient interactions.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages