You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> **RULE:** A Hugging Face Free VM is disposable by default. If you do not actively keep it warm and persist critical state, you are building on sand.
9
+
10
+
---
11
+
12
+
## 1. Why This Exists
13
+
14
+
HF Spaces on free tiers can sleep. Sleep means:
15
+
- memory is gone
16
+
- in-flight sessions die
17
+
- temporary files vanish
18
+
- browser/auth state may be lost
19
+
20
+
Therefore every meaningful HF-hosted agent must have:
21
+
1. a keep-alive strategy
22
+
2. a persistence strategy
23
+
3. a recovery strategy
24
+
25
+
---
26
+
27
+
## 2. Keep-Alive Strategy
28
+
29
+
### Canonical pattern
30
+
Use a centralized scheduler (n8n on OCI VM) that pings every active HF Space health endpoint on a fixed interval.
31
+
32
+
### Why centralized
33
+
A decentralized “each agent pings itself” model is fragile and harder to audit.
34
+
The OCI scheduler is stable, visible, and cheap.
35
+
36
+
### Recommended interval
37
+
Every ~45 minutes for free-tier sleep prevention, unless platform behavior changes.
38
+
39
+
---
40
+
41
+
## 3. Persistence Strategy
2
42
3
-
To ensure that our A2A agents and MCP servers hosted on Hugging Face (HF) Spaces remain active and do not fall into sleep mode (Free Tier), we implement a centralized **Keep-Alive Pinger** via n8n.
43
+
Never rely on the HF VM filesystem for important long-lived state.
44
+
Use one of:
45
+
- Hugging Face Dataset as persistence store
46
+
- Supabase / remote DB for structured state
47
+
- Git repository for durable text/config state
4
48
5
-
## Architecture
49
+
### Typical persisted items
50
+
- auth/session bundles
51
+
- queue checkpoints
52
+
- agent state snapshots
53
+
- generated artifacts requiring recovery
6
54
7
-
1.**n8n Workflow:** A scheduled workflow running on our OCI VM.
8
-
2.**Frequency:** Every **45 minutes**.
9
-
3.**Target:** Every HF Space URL in the OpenSIN-AI fleet.
0 commit comments