← all repositories
e2b-dev/fragments

Open-source clone of Claude Artifacts you can actually host

A Next.js template that lets LLMs generate and run full apps inside sandboxes, not just spit out code.

6.3k stars TypeScript App BuildersCoding Assistants
fragments
Velocity · 7d
+9.0
★ / day
Trend
steady
star history

What it does

Fragments is a Next.js 14 starter that wires up a chat UI to an LLM, then runs the generated code in E2B sandboxes. Think Claude Artifacts or v0, but as a repo you clone and deploy yourself. The AI writes Python, Next.js, Vue, Streamlit, or Gradio apps; the E2B SDK executes them securely and streams results back to the browser.

The interesting bit

The sandboxing is the real workhorse. Generated code installs arbitrary npm or pip packages inside an isolated container, so the LLM can actually build runnable tools rather than static snippets. The project also integrates Morph’s Apply model for faster, token-efficient code edits — a nice touch for iterative generation.

Key highlights

  • Supports 8+ LLM providers out of the box (OpenAI, Anthropic, Google, Mistral, Groq, Fireworks, Together AI, Ollama)
  • Custom “personas” via Docker-based sandbox templates; add new stacks by writing an e2b.Dockerfile and a JSON entry
  • UI streaming, rate limiting, short URLs, auth (Supabase), and analytics (PostHog) all wired in
  • Morph integration for structured code patching

Caveats

  • Requires both an E2B API key and your chosen LLM provider keys; the .env.local is lengthy
  • The README’s “add your own” sections have numbering typos (steps 1-2-3-4-5-6-7-4) that suggest docs are a bit rough
  • No mention of deployment costs or E2B sandbox limits for self-hosters

Verdict

Worth a spin if you want a self-hosted AI code generator with real execution, not just text completion. Skip it if you’re looking for a managed, zero-config alternative to Claude Artifacts — this is a template, not a product.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.