Skip to content

chethankotian2005/PromptGate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PromptGate

PromptGate is an AI + Algorand TestNet demo that combines prompt inference with on-chain escrow settlement, publisher payouts, and a lightweight consumer/publisher dashboard.

Major Features

  • On-chain escrow flow for prompt payments (lock -> release -> payout)
  • Auto and manual agent routing
  • Complexity-based auto model selection across Spark Lite, Balanced Core, and Thorough Pro
  • Publisher registration and pricing model support
  • Reputation and leaderboard tracking
  • 3-stage autonomous pipeline (Research -> Analysis -> Summary)
  • x402 payment challenge endpoints
  • QR verification entry point in dashboard for TestNet account checks

Tech Stack

  • Backend: FastAPI, Algorand Python SDK
  • Frontend: React
  • AI runtime: Ollama
  • Network: Algorand TestNet

Project Structure

  • promptgate-chain/ backend API, escrow logic, deploy metadata, agents
  • promptgate-dashboard/ React dashboard UI

Prerequisites

  • Python 3.11+ (or compatible with your local setup)
  • Poetry
  • Node.js + npm
  • AlgoKit CLI
  • Ollama running locally
  • Internet access to Algorand TestNet API/Indexer

Install Dependencies

1) Install AlgoKit CLI

Windows (recommended):

winget install --id AlgorandFoundation.AlgoKit

Alternative (if winget is unavailable):

pip install algokit

Verify:

algokit --version

2) Install Backend Dependencies

cd promptgate-chain
poetry install

3) Install Frontend Dependencies

cd promptgate-dashboard
npm install

Environment Setup

Backend .env

Create promptgate-chain/.env with your values:

PROMPTGATE_AGENT_ADDRESS=<your_algorand_address>
PROMPTGATE_AGENT_MNEMONIC=<your_25_word_mnemonic>
PROMPT_GATE_APP_ID=758619852
PROMPT_GATE_CONTRACT_ADDRESS=MUSEVZDHZJWQEJFTONPSYYV3S5IIBYPMA4CMN6IPJM6Q5MTDVDQTSBZ2SU

Optional overrides:

ALGOD_SERVER=https://testnet-api.algonode.cloud
INDEXER_SERVER=https://testnet-idx.algonode.cloud
OLLAMA_SERVER=http://localhost:11434
OLLAMA_MODEL=llama3.2

Frontend env

Set frontend env values if needed:

  • REACT_APP_API_BASE (default: http://localhost:8000)
  • REACT_APP_WALLET_ADDRESS
  • REACT_APP_WALLET_MNEMONIC

How to Run Locally

1) Start Backend

cd promptgate-chain
poetry run uvicorn promptgate_api.main:app --host 0.0.0.0 --port 8000 --reload

2) Start Frontend

Open a new terminal:

cd promptgate-dashboard
$env:PORT=3000
npm start

3) Open Dashboard

Go to http://localhost:3000

Health Checks

  • Backend status: GET http://localhost:8000/status
  • Publishers: GET http://localhost:8000/publishers
  • Leaderboard: GET http://localhost:8000/leaderboard

Demo Notes

  • Keep Ollama running before sending prompts.
  • If a prompt expires before release on-chain, backend now handles this safely and returns a clean retry message.
  • If UI looks stale, hard refresh (Ctrl+Shift+R).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors