Spaces:
Sleeping
Sleeping
Upload models.py
Browse files
models.py
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from pydantic import BaseModel
|
| 2 |
+
|
| 3 |
+
# This model defines what the AI sees (The "State")
|
| 4 |
+
class State(BaseModel):
|
| 5 |
+
cpu_usage: float # 0.0 to 100.0
|
| 6 |
+
active_servers: int # Count of running VMs
|
| 7 |
+
hourly_burn_rate: float # Cost in USD
|
| 8 |
+
response_latency: float # In milliseconds (ms)
|
| 9 |
+
incoming_load: int # Number of requests/users
|
| 10 |
+
|
| 11 |
+
# This model defines what the AI can do (The "Action")
|
| 12 |
+
class Action(BaseModel):
|
| 13 |
+
# 0: Stay (Do nothing)
|
| 14 |
+
# 1: Provision (Add server)
|
| 15 |
+
# 2: Terminate (Remove server)
|
| 16 |
+
# 3: Switch to Spot (Toggle cheap mode)
|
| 17 |
+
action_type: int
|