Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
@@ -1,12 +1,105 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Inference Provider Dashboard
|
2 |
+
|
3 |
+
A modern web dashboard built with FastAPI that compares monthly requests between different AI inference providers by scraping data from their HuggingFace profiles.
|
4 |
+
|
5 |
+
## Features
|
6 |
+
|
7 |
+
- **Real-time Data**: Scrapes monthly request statistics from HuggingFace profiles
|
8 |
+
- **Beautiful UI**: Modern, responsive dashboard with charts and tables
|
9 |
+
- **API Endpoints**: RESTful API for accessing provider data programmatically
|
10 |
+
- **Auto-refresh**: Dashboard automatically updates every 5 minutes
|
11 |
+
- **Async Performance**: Uses async/await for efficient concurrent data fetching
|
12 |
+
|
13 |
+
## Screenshots
|
14 |
+
|
15 |
+
The dashboard includes:
|
16 |
+
- Statistics cards showing total providers, total requests, and top provider
|
17 |
+
- Interactive bar chart comparing monthly requests
|
18 |
+
- Detailed table with provider information and links to HuggingFace profiles
|
19 |
+
|
20 |
+
## Installation
|
21 |
+
|
22 |
+
1. **Clone or navigate to the project directory**
|
23 |
+
|
24 |
+
2. **Install dependencies**:
|
25 |
+
```bash
|
26 |
+
pip install -r requirements.txt
|
27 |
+
```
|
28 |
+
|
29 |
+
## Usage
|
30 |
+
|
31 |
+
1. **Start the FastAPI server**:
|
32 |
+
```bash
|
33 |
+
python app.py
|
34 |
+
```
|
35 |
+
|
36 |
+
Or using uvicorn directly:
|
37 |
+
```bash
|
38 |
+
uvicorn app:app --host 0.0.0.0 --port 8000 --reload
|
39 |
+
```
|
40 |
+
|
41 |
+
2. **Open your browser and navigate to**:
|
42 |
+
```
|
43 |
+
http://localhost:8000
|
44 |
+
```
|
45 |
+
|
46 |
+
3. **API Endpoints**:
|
47 |
+
- `GET /` - Dashboard web interface
|
48 |
+
- `GET /api/providers` - Get all providers data
|
49 |
+
- `GET /api/providers/{provider}` - Get specific provider data
|
50 |
+
|
51 |
+
## API Examples
|
52 |
+
|
53 |
+
**Get all providers data**:
|
54 |
+
```bash
|
55 |
+
curl http://localhost:8000/api/providers
|
56 |
+
```
|
57 |
+
|
58 |
+
**Get specific provider data**:
|
59 |
+
```bash
|
60 |
+
curl http://localhost:8000/api/providers/togethercomputer
|
61 |
+
```
|
62 |
+
|
63 |
+
## Configuration
|
64 |
+
|
65 |
+
To add more providers, edit the `PROVIDERS` list in `app.py`:
|
66 |
+
|
67 |
+
```python
|
68 |
+
PROVIDERS = [
|
69 |
+
"togethercomputer",
|
70 |
+
"fireworks-ai",
|
71 |
+
"your-new-provider",
|
72 |
+
]
|
73 |
+
```
|
74 |
+
|
75 |
+
## Project Structure
|
76 |
+
|
77 |
+
```
|
78 |
+
inference_provider_dashboard/
|
79 |
+
βββ app.py # FastAPI application
|
80 |
+
βββ templates/
|
81 |
+
β βββ dashboard.html # Web dashboard template
|
82 |
+
βββ requirements.txt # Python dependencies
|
83 |
+
βββ README.md # This file
|
84 |
+
```
|
85 |
+
|
86 |
+
## Dependencies
|
87 |
+
|
88 |
+
- **FastAPI**: Modern web framework for building APIs
|
89 |
+
- **Uvicorn**: ASGI server for running FastAPI
|
90 |
+
- **Jinja2**: Template engine for HTML rendering
|
91 |
+
- **aiohttp**: Async HTTP client for concurrent requests
|
92 |
+
- **BeautifulSoup4**: HTML parsing for web scraping
|
93 |
+
- **Requests**: HTTP library (fallback)
|
94 |
+
|
95 |
+
## Development
|
96 |
+
|
97 |
+
The application uses:
|
98 |
+
- Async/await for concurrent HTTP requests
|
99 |
+
- Chart.js for interactive visualizations
|
100 |
+
- Modern CSS with gradients and animations
|
101 |
+
- Responsive design for mobile devices
|
102 |
+
|
103 |
+
## License
|
104 |
+
|
105 |
+
MIT License
|