Repolode
e2b-dev

e2b-dev/fragments

Open-source Next.js template for AI-generated apps that run generated code in E2B sandboxes, similar to Claude Artifacts or v0.

Open-source alternative to:Claude Artifactsv0

Stars
6,409
Forks
864
Open issues
23
Last commit
2 days ago

What is it?

Fragments is a web app template that lets a user describe what they want, has an LLM generate the code, and then runs that code in an E2B sandbox so the result can be previewed in the browser. It is positioned as an open-source counterpart to Claude Artifacts, Vercel v0, and GPT Engineer.

The front end is built on Next.js 14 with the App Router and Server Actions, shadcn/ui, TailwindCSS, and the Vercel AI SDK, and the UI streams responses as they arrive. Generated code is executed through the E2B SDK, and the project can install packages from npm and pip inside the sandbox.

Out of the box it supports Python interpreter, Next.js, Vue.js, Streamlit, and Gradio stacks, and it works with OpenAI, Anthropic, Google AI, Mistral, Groq, Fireworks, Together AI, and Ollama models. New stacks and models can be added through sandbox templates and a model configuration file.

Key features

  • 01Generates and previews apps in the browser with streaming output.
  • 02Runs AI-generated code in isolated E2B sandboxes.
  • 03Supports Python, Next.js, Vue.js, Streamlit, and Gradio stacks.
  • 04Works with multiple LLM providers, including OpenAI, Anthropic, and Ollama.
  • 05Lets you add custom sandbox templates and LLM models.

Use cases

  • Prototyping small web apps or dashboards from a text prompt.
  • Building an in-house Claude Artifacts-style tool on your own infrastructure.
  • Experimenting with different LLM providers for code generation.
  • Learning how to combine LLM output with sandboxed code execution.

Quick start

  1. 1

    Clone the repository

    git clone https://github.com/e2b-dev/fragments.git
  2. 2

    Enter the repository and install dependencies

    cd fragments && npm i
  3. 3

    Create .env.local and set E2B_API_KEY and an LLM provider API key

  4. 4

    Start the development server

    npm run dev

Things to know

  • Requires an E2B API key and an LLM provider API key to run.
  • Built on Next.js 14, so it is a web app template rather than a standalone tool.

In collections

Topics

FAQ

What is fragments?
Open-source Next.js template for AI-generated apps that run generated code in E2B sandboxes, similar to Claude Artifacts or v0. Fragments is a web app template that lets a user describe what they want, has an LLM generate the code, and then runs that code in an E2B sandbox so the result can be previewed in the browser. It is positioned as an open-source counterpart to Claude Artifacts, Vercel v0, and GPT Engineer.
Is fragments free to use? What license does it have?
fragments is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
Is fragments still maintained?
Actively maintained. The last commit to fragments was on Nov 4, 2026.
What can I use fragments for?
Prototyping small web apps or dashboards from a text prompt. Building an in-house Claude Artifacts-style tool on your own infrastructure. Experimenting with different LLM providers for code generation. Learning how to combine LLM output with sandboxed code execution.
How do I install fragments?
Clone the repository: git clone https://github.com/e2b-dev/fragments.git Enter the repository and install dependencies: cd fragments && npm i Create .env.local and set E2B_API_KEY and an LLM provider API key Start the development server: npm run dev
Where can I get fragments?
The source code and installation instructions are on GitHub: https://github.com/e2b-dev/fragments

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects