hackerbhai commited on
Commit
539e36d
·
verified ·
1 Parent(s): 274a923

Delete SERVER_REQUIREMENTS.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. SERVER_REQUIREMENTS.md +0 -577
SERVER_REQUIREMENTS.md DELETED
@@ -1,577 +0,0 @@
1
- # 🖥️ Ekalavya Mythos - Server Requirements
2
-
3
- **Complete hardware and software requirements for deployment**
4
-
5
- ---
6
-
7
- ## 📊 Minimum Requirements
8
-
9
- ### For Text Only (Language Model)
10
-
11
- | Component | Minimum | Recommended | Production |
12
- |-----------|---------|-------------|------------|
13
- | **GPU** | 8GB VRAM (RTX 3060) | 16GB VRAM (RTX 4080) | 24GB+ VRAM (RTX 4090/A100) |
14
- | **RAM** | 16GB | 32GB | 64GB+ |
15
- | **CPU** | 4 cores | 8 cores | 16+ cores |
16
- | **Storage** | 50GB SSD | 100GB SSD | 500GB+ NVMe SSD |
17
- | **OS** | Ubuntu 20.04+ | Ubuntu 22.04 | Ubuntu 22.04 LTS |
18
-
19
- ### For Multi-Modal (Image + Video + Audio)
20
-
21
- | Component | Minimum | Recommended | Production |
22
- |-----------|---------|-------------|------------|
23
- | **GPU** | 16GB VRAM (RTX 4080) | 24GB VRAM (RTX 4090) | 40GB+ VRAM (A100/H100) |
24
- | **RAM** | 32GB | 64GB | 128GB+ |
25
- | **CPU** | 8 cores | 16 cores | 32+ cores |
26
- | **Storage** | 100GB SSD | 200GB SSD | 1TB+ NVMe SSD |
27
- | **OS** | Ubuntu 20.04+ | Ubuntu 22.04 | Ubuntu 22.04 LTS |
28
-
29
- ---
30
-
31
- ## 🚀 Recommended Configurations
32
-
33
- ### Configuration 1: Personal Use (Single User)
34
-
35
- **Hardware:**
36
- - GPU: NVIDIA RTX 4070 (12GB VRAM) - $550
37
- - RAM: 32GB DDR4 - $100
38
- - CPU: AMD Ryzen 7 5800X (8 cores) - $300
39
- - Storage: 500GB NVMe SSD - $60
40
- - **Total Cost: ~$1,010**
41
-
42
- **Performance:**
43
- - Text generation: ~50 tokens/sec
44
- - Image analysis: ~200ms per image
45
- - Audio processing: ~500ms per second
46
- - Can handle all 3 modalities with small models
47
-
48
- **Best for:** Personal projects, learning, small applications
49
-
50
- ---
51
-
52
- ### Configuration 2: Small Business (5-10 users)
53
-
54
- **Hardware:**
55
- - GPU: NVIDIA RTX 4090 (24GB VRAM) - $1,600
56
- - RAM: 64GB DDR4 - $200
57
- - CPU: AMD Ryzen 9 7950X (16 cores) - $600
58
- - Storage: 1TB NVMe SSD - $120
59
- - **Total Cost: ~$2,520**
60
-
61
- **Performance:**
62
- - Text generation: ~100 tokens/sec
63
- - Image analysis: ~100ms per image
64
- - Video analysis: ~1s per 8 frames
65
- - Can handle all modalities with large models
66
- - Supports 5-10 concurrent users
67
-
68
- **Best for:** Small teams, startups, educational institutions
69
-
70
- ---
71
-
72
- ### Configuration 3: Enterprise (50-100 users)
73
-
74
- **Hardware:**
75
- - GPU: NVIDIA A100 (80GB VRAM) - $10,000+
76
- - RAM: 256GB DDR4 ECC - $2,000
77
- - CPU: AMD EPYC 7763 (64 cores) - $3,000
78
- - Storage: 4TB NVMe SSD RAID - $1,000
79
- - **Total Cost: ~$16,000+**
80
-
81
- **Performance:**
82
- - Text generation: ~200 tokens/sec
83
- - Image analysis: ~50ms per image
84
- - Video analysis: ~500ms per 8 frames
85
- - Can handle all modalities with largest models
86
- - Supports 50-100 concurrent users
87
-
88
- **Best for:** Large organizations, production deployments
89
-
90
- ---
91
-
92
- ### Configuration 4: Cloud Deployment
93
-
94
- **AWS:**
95
- - Instance: g5.2xlarge (1x A10G 24GB)
96
- - RAM: 32GB
97
- - vCPUs: 8
98
- - Storage: 500GB GP3
99
- - **Cost: ~$1.00/hour (~$720/month)**
100
-
101
- **Google Cloud:**
102
- - Instance: a2-highgpu-1g (1x A100 40GB)
103
- - RAM: 85GB
104
- - vCPUs: 12
105
- - Storage: 500GB SSD
106
- - **Cost: ~$2.00/hour (~$1,440/month)**
107
-
108
- **Azure:**
109
- - Instance: Standard_NC24ads_A100_v4 (1x A100 80GB)
110
- - RAM: 220GB
111
- - vCPUs: 24
112
- - Storage: 1TB Premium SSD
113
- - **Cost: ~$3.00/hour (~$2,160/month)**
114
-
115
- **Best for:** Scalable deployments, global access
116
-
117
- ---
118
-
119
- ## 💻 Software Requirements
120
-
121
- ### Operating System
122
-
123
- **Recommended:**
124
- - Ubuntu 22.04 LTS (64-bit)
125
- - Ubuntu 20.04 LTS (64-bit)
126
- - Windows 10/11 (with WSL2)
127
- - macOS 12+ (for development only)
128
-
129
- ### Python Environment
130
-
131
- **Python Version:** 3.10+ (3.11 recommended)
132
-
133
- **Required Packages:**
134
- ```bash
135
- # Core dependencies
136
- torch>=2.0.0
137
- fastapi>=0.100.0
138
- uvicorn>=0.23.0
139
- pydantic>=2.0.0
140
-
141
- # Multi-modal dependencies
142
- pillow>=9.0.0 # Image processing
143
- opencv-python>=4.7.0 # Video processing
144
- torchaudio>=2.0.0 # Audio processing
145
- torchvision>=0.15.0 # Vision models
146
-
147
- # Additional utilities
148
- numpy>=1.24.0
149
- huggingface-hub>=0.16.0
150
- python-multipart>=0.0.6
151
- ```
152
-
153
- ### CUDA Requirements
154
-
155
- **For GPU Acceleration:**
156
- - CUDA 11.8+ (for PyTorch 2.0+)
157
- - cuDNN 8.6+
158
- - NVIDIA Driver 525.60+
159
-
160
- **Installation:**
161
- ```bash
162
- # Install CUDA Toolkit
163
- wget https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run
164
- sudo sh cuda_11.8.0_520.61.05_linux.run
165
-
166
- # Verify installation
167
- nvcc --version
168
- nvidia-smi
169
- ```
170
-
171
- ---
172
-
173
- ## 📦 Installation Guide
174
-
175
- ### Step 1: System Setup (Ubuntu)
176
-
177
- ```bash
178
- # Update system
179
- sudo apt update && sudo apt upgrade -y
180
-
181
- # Install Python 3.11
182
- sudo apt install -y python3.11 python3.11-venv python3-pip
183
-
184
- # Install system dependencies
185
- sudo apt install -y \
186
- build-essential \
187
- git \
188
- curl \
189
- wget \
190
- ffmpeg \
191
- libsm6 \
192
- libxext6
193
- ```
194
-
195
- ### Step 2: Clone Repository
196
-
197
- ```bash
198
- # Clone from HuggingFace
199
- git lfs install
200
- git clone https://huggingface.co/hackerbhai/vinaymodel
201
- cd vinaymodel
202
- ```
203
-
204
- ### Step 3: Create Virtual Environment
205
-
206
- ```bash
207
- # Create and activate virtual environment
208
- python3.11 -m venv venv
209
- source venv/bin/activate
210
-
211
- # Upgrade pip
212
- pip install --upgrade pip
213
- ```
214
-
215
- ### Step 4: Install Dependencies
216
-
217
- ```bash
218
- # Install Python packages
219
- pip install -r requirements.txt
220
-
221
- # Install multi-modal dependencies
222
- pip install pillow opencv-python torchaudio torchvision
223
- ```
224
-
225
- ### Step 5: Download Model
226
-
227
- ```bash
228
- # Model will auto-download on first run
229
- # Or manually download:
230
- huggingface-cli download hackerbhai/vinaymodel --local-dir ./model
231
- ```
232
-
233
- ### Step 6: Start Server
234
-
235
- ```bash
236
- # Start API server
237
- python api.py
238
-
239
- # Server will be available at http://localhost:8000
240
- ```
241
-
242
- ---
243
-
244
- ## 🔧 Configuration
245
-
246
- ### Environment Variables
247
-
248
- Create `.env` file:
249
- ```bash
250
- # Server configuration
251
- PORT=8000
252
- HOST=0.0.0.0
253
- WORKERS=4
254
-
255
- # Model configuration
256
- MODEL_PATH=./saved/ekalavya_mythos.pt
257
- MULTIMODAL_PATH=./saved/ekalavya_multimodal.pt
258
- TOKENIZER_PATH=./saved/tokenizer.json
259
-
260
- # Performance settings
261
- MAX_BATCH_SIZE=8
262
- MAX_SEQUENCE_LENGTH=1000000
263
- USE_GPU=true
264
-
265
- # Logging
266
- LOG_LEVEL=INFO
267
- LOG_FILE=./logs/ekalavya.log
268
- ```
269
-
270
- ### API Configuration
271
-
272
- Edit `api.py`:
273
- ```python
274
- # Server settings
275
- app = FastAPI(
276
- title="Ekalavya Mythos",
277
- version="2.0.0",
278
- docs_url="/docs",
279
- redoc_url="/redoc"
280
- )
281
-
282
- # CORS settings (adjust for production)
283
- app.add_middleware(
284
- CORSMiddleware,
285
- allow_origins=["*"], # Change to specific domains in production
286
- allow_credentials=True,
287
- allow_methods=["*"],
288
- allow_headers=["*"],
289
- )
290
- ```
291
-
292
- ---
293
-
294
- ## 📊 Performance Benchmarks
295
-
296
- ### Text Generation
297
-
298
- | Model Size | Tokens/sec (RTX 4090) | Tokens/sec (A100) |
299
- |------------|----------------------|-------------------|
300
- | 8B (mythos-small) | 100 | 200 |
301
- | 20B (mythos-base) | 50 | 100 |
302
- | 40B (mythos-large) | 25 | 50 |
303
- | 68B (mythos-xlarge) | 12 | 25 |
304
-
305
- ### Image Processing
306
-
307
- | Task | Time (RTX 4090) | Time (A100) |
308
- |------|----------------|-------------|
309
- | Single image (224x224) | 50ms | 30ms |
310
- | Image description | 200ms | 100ms |
311
- | Batch of 8 images | 150ms | 80ms |
312
-
313
- ### Video Processing
314
-
315
- | Frames | Time (RTX 4090) | Time (A100) |
316
- |--------|----------------|-------------|
317
- | 1 frame | 50ms | 30ms |
318
- | 4 frames | 120ms | 60ms |
319
- | 8 frames | 250ms | 120ms |
320
- | 16 frames | 500ms | 240ms |
321
-
322
- ### Audio Processing
323
-
324
- | Duration | Time (RTX 4090) | Time (A100) |
325
- |----------|----------------|-------------|
326
- | 1 second | 100ms | 50ms |
327
- | 10 seconds | 500ms | 250ms |
328
- | 1 minute | 2s | 1s |
329
-
330
- ---
331
-
332
- ## 🌐 Production Deployment
333
-
334
- ### Using Docker
335
-
336
- ```dockerfile
337
- FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04
338
-
339
- WORKDIR /app
340
-
341
- # Install Python
342
- RUN apt update && apt install -y python3.11 python3-pip
343
-
344
- # Copy requirements
345
- COPY requirements.txt .
346
- RUN pip install -r requirements.txt
347
-
348
- # Copy application
349
- COPY . .
350
-
351
- # Expose port
352
- EXPOSE 8000
353
-
354
- # Start server
355
- CMD ["python", "api.py"]
356
- ```
357
-
358
- ```bash
359
- # Build and run
360
- docker build -t ekalavya-mythos .
361
- docker run --gpus all -p 8000:8000 ekalavya-mythos
362
- ```
363
-
364
- ### Using Docker Compose
365
-
366
- ```yaml
367
- version: '3.8'
368
-
369
- services:
370
- ekalavya:
371
- build: .
372
- ports:
373
- - "8000:8000"
374
- volumes:
375
- - ./saved:/app/saved
376
- - ./logs:/app/logs
377
- environment:
378
- - PORT=8000
379
- - USE_GPU=true
380
- deploy:
381
- resources:
382
- reservations:
383
- devices:
384
- - driver: nvidia
385
- count: 1
386
- capabilities: [gpu]
387
- ```
388
-
389
- ```bash
390
- docker-compose up -d
391
- ```
392
-
393
- ### Using Kubernetes
394
-
395
- ```yaml
396
- apiVersion: apps/v1
397
- kind: Deployment
398
- metadata:
399
- name: ekalavya-mythos
400
- spec:
401
- replicas: 3
402
- selector:
403
- matchLabels:
404
- app: ekalavya
405
- template:
406
- metadata:
407
- labels:
408
- app: ekalavya
409
- spec:
410
- containers:
411
- - name: ekalavya
412
- image: your-registry/ekalavya-mythos:latest
413
- ports:
414
- - containerPort: 8000
415
- resources:
416
- limits:
417
- nvidia.com/gpu: 1
418
- memory: 32Gi
419
- cpu: 8
420
- requests:
421
- memory: 16Gi
422
- cpu: 4
423
- volumeMounts:
424
- - name: model-storage
425
- mountPath: /app/saved
426
- volumes:
427
- - name: model-storage
428
- persistentVolumeClaim:
429
- claimName: ekalavya-pvc
430
- ---
431
- apiVersion: v1
432
- kind: Service
433
- metadata:
434
- name: ekalavya-service
435
- spec:
436
- type: LoadBalancer
437
- ports:
438
- - port: 80
439
- targetPort: 8000
440
- selector:
441
- app: ekalavya
442
- ```
443
-
444
- ---
445
-
446
- ## 🔒 Security Recommendations
447
-
448
- ### Production Checklist
449
-
450
- - [ ] Change default CORS settings (restrict origins)
451
- - [ ] Enable HTTPS (use nginx reverse proxy)
452
- - [ ] Set up authentication (API keys or OAuth)
453
- - [ ] Implement rate limiting
454
- - [ ] Enable logging and monitoring
455
- - [ ] Set up firewall rules
456
- - [ ] Regular security updates
457
- - [ ] Backup model weights regularly
458
- - [ ] Monitor GPU temperature and usage
459
- - [ ] Set up alerts for failures
460
-
461
- ### Nginx Reverse Proxy
462
-
463
- ```nginx
464
- server {
465
- listen 80;
466
- server_name api.yourdomain.com;
467
-
468
- location / {
469
- proxy_pass http://localhost:8000;
470
- proxy_set_header Host $host;
471
- proxy_set_header X-Real-IP $remote_addr;
472
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
473
- }
474
-
475
- # Rate limiting
476
- limit_req_zone $binary_remote_addr zone=api:10m rate=10r/s;
477
- location /api/ {
478
- limit_req zone=api burst=20;
479
- proxy_pass http://localhost:8000;
480
- }
481
- }
482
- ```
483
-
484
- ---
485
-
486
- ## 📈 Monitoring
487
-
488
- ### Using Prometheus + Grafana
489
-
490
- ```yaml
491
- # docker-compose.monitoring.yml
492
- version: '3.8'
493
-
494
- services:
495
- prometheus:
496
- image: prom/prometheus
497
- ports:
498
- - "9090:9090"
499
- volumes:
500
- - ./prometheus.yml:/etc/prometheus/prometheus.yml
501
-
502
- grafana:
503
- image: grafana/grafana
504
- ports:
505
- - "3000:3000"
506
- environment:
507
- - GF_SECURITY_ADMIN_PASSWORD=admin
508
- ```
509
-
510
- ### Metrics to Monitor
511
-
512
- - Request count and latency
513
- - GPU utilization and memory
514
- - Error rates
515
- - Response times per endpoint
516
- - Model inference time
517
- - Queue depth
518
-
519
- ---
520
-
521
- ## 💰 Cost Analysis
522
-
523
- ### Self-Hosted vs Cloud
524
-
525
- **Scenario: 1M requests/month**
526
-
527
- | Deployment | Monthly Cost | Annual Cost |
528
- |------------|--------------|-------------|
529
- | **Self-Hosted (RTX 4090)** | $50 (electricity) | $600 |
530
- | **Self-Hosted (A100)** | $100 (electricity) | $1,200 |
531
- | **AWS g5.2xlarge** | $720 | $8,640 |
532
- | **GCP A100** | $1,440 | $17,280 |
533
- | **Azure A100** | $2,160 | $25,920 |
534
-
535
- **Savings: 90%+ with self-hosted!**
536
-
537
- ---
538
-
539
- ## 🎯 Quick Start Commands
540
-
541
- ```bash
542
- # 1. Clone repository
543
- git clone https://huggingface.co/hackerbhai/vinaymodel
544
- cd vinaymodel
545
-
546
- # 2. Create virtual environment
547
- python3 -m venv venv
548
- source venv/bin/activate
549
-
550
- # 3. Install dependencies
551
- pip install -r requirements.txt
552
-
553
- # 4. Start server
554
- python api.py
555
-
556
- # 5. Test API
557
- curl http://localhost:8000/health
558
- ```
559
-
560
- ---
561
-
562
- ## 📞 Support
563
-
564
- **Documentation:**
565
- - README.md - Complete guide
566
- - MULTIMODAL_GUIDE.md - Multi-modal features
567
- - SERVER_REQUIREMENTS.md - This file
568
-
569
- **Links:**
570
- - HuggingFace: https://huggingface.co/hackerbhai/vinaymodel
571
- - API Docs: http://localhost:8000/docs
572
-
573
- ---
574
-
575
- **Built with 🎯 by hackerbhai**
576
-
577
- *Ekalavya Mythos - Complete Multi-Modal AI*