π Quick Start Guide - Crypto API Monitor with HuggingFace Integration
β Server is Running!
Your application is now live at: http://localhost:7860
π± Access Points
1. Main Dashboard (Full Features)
URL: http://localhost:7860/index.html
Features:
- Real-time API monitoring
- Provider inventory
- Rate limit tracking
- Connection logs
- Schedule management
- Data freshness monitoring
- Failure analysis
- π€ HuggingFace Tab (NEW!)
2. HuggingFace Console (Standalone)
URL: http://localhost:7860/hf_console.html
Features:
- HF Health Status
- Models Registry Browser
- Datasets Registry Browser
- Local Search (snapshot)
- Sentiment Analysis (local pipeline)
3. API Documentation
URL: http://localhost:7860/docs
Interactive API documentation with all endpoints
π€ HuggingFace Features
Available Endpoints:
Health Check
GET /api/hf/healthReturns: Registry health, last refresh time, model/dataset counts
Force Refresh Registry
POST /api/hf/refreshManually trigger registry update from HuggingFace Hub
Get Models Registry
GET /api/hf/registry?kind=modelsReturns: List of all cached crypto-related models
Get Datasets Registry
GET /api/hf/registry?kind=datasetsReturns: List of all cached crypto-related datasets
Search Registry
GET /api/hf/search?q=crypto&kind=modelsSearch local snapshot for models or datasets
Run Sentiment Analysis
POST /api/hf/run-sentiment Body: {"texts": ["BTC strong", "ETH weak"]}Analyze crypto sentiment using local transformers
π― How to Use
Option 1: Main Dashboard
- Open http://localhost:7860/index.html in your browser
- Click on the "π€ HuggingFace" tab at the top
- Explore:
- Health status
- Models and datasets registries
- Search functionality
- Sentiment analysis
Option 2: Standalone HF Console
- Open http://localhost:7860/hf_console.html
- All HF features in a clean, focused interface
- Perfect for testing and development
π§ͺ Test the Integration
Test 1: Check Health
Invoke-WebRequest -Uri "http://localhost:7860/api/hf/health" -UseBasicParsing | Select-Object -ExpandProperty Content
Test 2: Refresh Registry
Invoke-WebRequest -Uri "http://localhost:7860/api/hf/refresh" -Method POST -UseBasicParsing | Select-Object -ExpandProperty Content
Test 3: Get Models
Invoke-WebRequest -Uri "http://localhost:7860/api/hf/registry?kind=models" -UseBasicParsing | Select-Object -ExpandProperty Content
Test 4: Run Sentiment Analysis
$body = @{texts = @("BTC strong breakout", "ETH looks weak")} | ConvertTo-Json
Invoke-WebRequest -Uri "http://localhost:7860/api/hf/run-sentiment" -Method POST -Body $body -ContentType "application/json" -UseBasicParsing | Select-Object -ExpandProperty Content
π What's Included
Seed Models (Always Available):
- ElKulako/cryptobert
- kk08/CryptoBERT
Seed Datasets (Always Available):
- linxy/CryptoCoin
- WinkingFace/CryptoLM-Bitcoin-BTC-USDT
- WinkingFace/CryptoLM-Ethereum-ETH-USDT
- WinkingFace/CryptoLM-Solana-SOL-USDT
- WinkingFace/CryptoLM-Ripple-XRP-USDT
Auto-Discovery:
- Searches HuggingFace Hub for crypto-related models
- Searches for sentiment-analysis models
- Auto-refreshes every 6 hours (configurable)
βοΈ Configuration
Edit .env file to customize:
# HuggingFace Token (optional, for higher rate limits)
HUGGINGFACE_TOKEN=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
# Enable/disable local sentiment analysis
ENABLE_SENTIMENT=true
# Model selection
SENTIMENT_SOCIAL_MODEL=ElKulako/cryptobert
SENTIMENT_NEWS_MODEL=kk08/CryptoBERT
# Refresh interval (seconds)
HF_REGISTRY_REFRESH_SEC=21600
# HTTP timeout (seconds)
HF_HTTP_TIMEOUT=8.0
π Stop the Server
Press CTRL+C in the terminal where the server is running
Or use the process manager to stop process ID 6
π Restart the Server
python simple_server.py
π Notes
- First Load: The first sentiment analysis may take 30-60 seconds as models download
- Registry: Auto-refreshes every 6 hours, or manually via the UI
- Free Resources: All endpoints use free HuggingFace APIs
- No API Key Required: Works without authentication (with rate limits)
- Local Inference: Sentiment analysis runs locally using transformers
π You're All Set!
The application is running and ready to use. Open your browser and explore!
Main Dashboard: http://localhost:7860/index.html HF Console: http://localhost:7860/hf_console.html