AI agents: fetch the documentation index at llms.txt. Markdown versions are available by appending .md to any page URL, including this page's markdown.
Load strategies
Control when and how model data is fetched from the server with instant, lazy, partial, and other strategies.
Set per model via @ClientModel. Controls bootstrap timing, transfer volume, and offline availability.
Decision tree
flowchart TD
A[Does this model need to sync with the server?]
A -->|No| B["local"]
A -->|Yes| C[Is the data needed on every page load?]
C -->|Yes| D[Is the total dataset small?]
D -->|Yes| E["instant"]
D -->|No| F["partial"]
C -->|No| G[Should it load automatically when accessed?]
G -->|Yes| H["lazy"]
G -->|No| I["explicitlyRequested"]Strategy reference
| Strategy | Behavior | Best for | Trade-off |
|---|---|---|---|
instant | Bootstrap includes all instances; data available from first render | Small, always-needed models (users, teams, labels) | Adds to bootstrap payload size |
lazy | Not included in bootstrap; fetched on first access via hooks or relationship traversal | Models needed only on some pages (attachments, activity feeds) | First access has network latency; only accessed instances available offline |
partial | Loads a relevant subset at bootstrap; fetches remaining instances on demand |