-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmothership.py
More file actions
55 lines (44 loc) · 1.4 KB
/
mothership.py
File metadata and controls
55 lines (44 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
"""
Mothership Endpoint Configuration
The mothership endpoint serves your FastAPI application routes.
It is automatically deployed as a CPU-optimized load-balanced endpoint.
To customize this configuration:
- Modify worker scaling: change workersMin and workersMax values
- Use GPU load balancer: import LiveLoadBalancer instead of CpuLiveLoadBalancer
- Change endpoint name: update the 'name' parameter
To disable mothership deployment:
- Delete this file, or
- Comment out the 'mothership' variable below
Documentation: https://docs.runpod.io/flash/mothership
"""
from runpod_flash import CpuLiveLoadBalancer
# Mothership endpoint configuration
# This serves your FastAPI app routes from main.py
mothership = CpuLiveLoadBalancer(
name="mothership",
workersMin=1,
workersMax=3,
)
# Examples of customization:
# Increase scaling for high traffic
# mothership = CpuLiveLoadBalancer(
# name="mothership",
# workersMin=2,
# workersMax=10,
# )
# Use GPU-based load balancer instead of CPU
# (requires importing LiveLoadBalancer)
# from runpod_flash import LiveLoadBalancer
# mothership = LiveLoadBalancer(
# name="mothership",
# gpus=[GpuGroup.ANY],
# )
# Custom endpoint name
# mothership = CpuLiveLoadBalancer(
# name="my-api-gateway",
# workersMin=1,
# workersMax=3,
# )
# To disable mothership:
# - Delete this entire file, or
# - Comment out the 'mothership' variable above