Vibe coding tools let users describe an app in plain language and get back running code instantly. Your app handles the LLM interaction and UI, then uses E2B sandboxes to prepare and serve the generated app. Since the generated code never runs on your infrastructure, it can’t cause damage even if it’s buggy or malicious. For a complete working implementation, see Fragments — an open-source vibe coding platform you can try via the live demo.Documentation Index
Fetch the complete documentation index at: https://e2b-fragments-use-case.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Why E2B
- Secure execution — AI-generated code runs in isolated sandboxes, not on your servers
- Live preview URLs — each sandbox exposes a public URL you can embed in an iframe
- Custom templates — pre-install frameworks like Next.js, Streamlit, or Gradio so sandboxes start instantly via templates
- Multi-framework support — same API whether the generated app is React, Vue, Python, or anything else
Install the SDK
Fragments uses the E2B Code Interpreter SDK.Core Implementation
Your app orchestrates the flow from its own server — the sandbox is used purely to prepare and serve the generated code.Create a sandbox from a template
Each sandbox starts from a template with the target framework pre-installed and a dev server already running. See the Next.js template example.Install dependencies and write code
Install any extra packages the LLM requested, then write the generated code to the sandbox filesystem.Get the preview URL
The dev server picks up changes automatically. Retrieve the sandbox’s public URL and embed it in your frontend.Full example
A complete flow: LLM generates code, sandbox prepares and serves it. Simplified from Fragments.Related Guides
Custom Templates
Pre-install frameworks and tools so sandboxes start instantly
Connect LLMs
Integrate AI models with sandboxes using tool calling
Internet Access
Access sandbox apps via public URLs and control network policies