rivet-dev/dynamic-apps
Deploy an AI-generated backend for every user.
Rivet Dynamic Apps – What It Is
Rivet Dynamic Apps is a framework that lets you run user‑provided request‑handler code inside a secure, sandboxed virtual machine. Each handler’s code and its release state are stored in a Rivet actor (a lightweight, stateful service). When a request comes in, the system can serve it in two ways:
- Fast path – If the request can be answered from cache, a small, bounded V8 isolate (a lightweight JavaScript engine) handles it directly, avoiding any network hop to the actor.
- Execution path – For uncached requests, the request is routed to the appropriate Rivet actor, which runs the user‑generated handler in its sandboxed VM.
The design aims to combine security (isolated V8 sandboxes), low latency (local cache isolates), and stateful versioning (actors keep release metadata).
Key Concepts
| Concept | What It Means |
|---|---|
| Rivet actor | A small, stateful service that stores the current version of a user‑generated handler and can execute it when needed. |
| Sandboxed deployment VM | An isolated environment (built on V8) where arbitrary user code can run safely without affecting the host system. |
| Bounded local V8 isolates | Tiny, short‑lived JavaScript runtimes that handle cache‑hit requests directly on the edge, keeping latency low. |
| Release state | Metadata about which version of a handler is currently live; stored in the actor so updates are atomic and traceable. |
How It Works (High‑Level Flow)
- Developer uploads a JavaScript request handler.
- Rivet stores the code and its release metadata in an actor.
- When a request arrives:
- The system checks a cache.
- Cache hit → a local V8 isolate runs the handler instantly.
- Cache miss → the request is forwarded to the actor, which runs the handler inside its sandboxed VM and returns the result.
- Results can be cached for future fast‑path handling.
Why It Might Matter for AI / LLM Workloads
The README links to a RivetKit reference that mentions llms.txt, suggesting the platform is intended to host LLM‑driven request handlers (e.g., prompt‑processing functions, custom routing logic, or lightweight inference wrappers). By isolating each handler, developers can safely expose user‑generated AI logic without risking the stability of the underlying service.
Where to Find More Details
- Package guide –
packages/dynamic-apps/README.md– explains how to add the library to a project and configure actors. - API contract –
packages/dynamic-apps/API_CONTRACT.md– defines the JSON‑based request/response schema used between callers and handlers. - Benchmark report –
benchmarks/dynamic-apps/RESULTS.md– shows performance numbers for the cache‑hit path vs. full actor execution. - RivetKit reference – https://rivet.dev/llms.txt – provides context on how Rivet integrates with LLM‑centric workflows.
TL;DR
Rivet Dynamic Apps lets you safely run user‑supplied JavaScript request handlers in isolated V8 sandboxes, keeping their version state in lightweight actors. Cached requests are answered instantly by local isolates, while uncached ones are processed by the actors. The setup is geared toward AI/LLM use‑cases where you need fast, secure, and updatable custom logic.
Related
- Project
- Project
- Project
- Project
- Project