web3-copilot / README.md
Priyanshi Saxena
fix: shorten short_description to meet HF 60-char limit
85cb7be
metadata
title: Web3 Research Co-Pilot
emoji: πŸš€
colorFrom: blue
colorTo: green
sdk: docker
app_file: app.py
dockerfile: Dockerfile
license: mit
tags:
  - cryptocurrency
  - blockchain
  - defi
  - ai-research
  - ollama
  - llama3
pinned: false
header: default
short_description: AI-powered crypto research with real-time blockchain data
suggested_hardware: t4-medium

Web3 Research Co-Pilot πŸš€

An AI-powered cryptocurrency research assistant that provides real-time blockchain analytics, DeFi insights, and market intelligence using Llama 8B and comprehensive API integrations.

✨ Features

  • πŸ€– AI-Powered Analysis: Uses Llama 8B model via Ollama for intelligent responses
  • πŸ”— Real-Time Data: Integrates with CryptoCompare, DeFiLlama, Etherscan APIs
  • πŸ›‘οΈ AI Safety: Built-in content filtering and safety guardrails
  • πŸ“Š Interactive UI: Modern web interface with dark/light themes
  • ⚑ Streaming Responses: Real-time progress updates during analysis
  • πŸ”„ Comprehensive Tools: 5+ specialized cryptocurrency research tools

πŸ› οΈ Technical Stack

  • Backend: FastAPI with Python 3.11
  • AI Model: Llama 3 8B via Ollama (local inference)
  • Frontend: Vanilla JavaScript with modern CSS
  • APIs: CryptoCompare, DeFiLlama, Etherscan, CoinGecko
  • Safety: Custom AI safety module with content filtering
  • Deployment: Docker for HuggingFace Spaces

πŸš€ Usage

Ask questions like:

  • "Analyze Bitcoin price trends and institutional adoption patterns"
  • "Compare top DeFi protocols by TVL and yield metrics"
  • "What are the current Ethereum gas fees?"
  • "Track whale movements in Bitcoin today"

πŸ”§ Development

Local Setup

# Clone the repository
git clone https://huggingface.co/spaces/your-username/web3-research-copilot
cd web3-research-copilot

# Install dependencies
pip install -r requirements.txt

# Start Ollama (in separate terminal)
ollama serve
ollama pull llama3:8b

# Run the application
python app.py

Docker Deployment

# Build and run with Docker
docker build -f Dockerfile.hf -t web3-copilot .
docker run -p 7860:7860 -p 11434:11434 web3-copilot

πŸ“ Project Structure

β”œβ”€β”€ app.py                 # Main FastAPI application
β”œβ”€β”€ templates/             # HTML templates
β”œβ”€β”€ static/               # CSS and JavaScript files
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ agent/            # AI research agent
β”‚   β”œβ”€β”€ tools/            # API integration tools
β”‚   └── utils/            # Configuration and safety
β”œβ”€β”€ Dockerfile.hf         # HuggingFace Spaces Docker config
└── requirements.txt      # Python dependencies

πŸ›‘οΈ AI Safety Features

  • Input sanitization and validation
  • Rate limiting protection
  • Content filtering for harmful requests
  • Response safety validation
  • Comprehensive logging for monitoring

πŸ“Š Supported APIs

  • CryptoCompare: Price data and market statistics
  • DeFiLlama: Protocol TVL and DeFi analytics
  • Etherscan: Ethereum network data and gas prices
  • CoinGecko: Cryptocurrency market data
  • Custom Chart Data: Historical price analysis

🀝 Contributing

This project implements responsible AI practices and focuses on legitimate cryptocurrency research and education.

πŸ“„ License

MIT License - see LICENSE file for details


Built with ❀️ for the crypto research community