Favicon of Fragments

Fragments

An open-source AI app builder template supports Ollama and cloud models, with generated code running in E2B sandboxes.

Alternative to:

Screenshot of Fragments website

Fragments is a Next.js template for developers building their own AI app generator, similar to Claude Artifacts or Vercel v0. It provides a starting point for an interface that generates and runs apps through chat.

  • App generation: Generate apps using Next.js, Vue.js, Streamlit or Gradio, or use the Python interpreter for code tasks.
  • Model choice: Connect to Ollama for local models or use providers including OpenAI, Anthropic, Google AI and Mistral. Developers can extend the supported models and providers.
  • Code execution: Run generated code in E2B sandboxes, with access to packages from npm and pip.
  • Streaming and editing: See responses as they arrive in the interface, and use the Morph Apply integration for AI code edits. Morph Apply requires its own external service key.
  • Custom app templates: Add app stacks with their own dependencies and instructions to guide the generated code.

The web app can run locally or on your own server, and a hosted demo is available at fragments.e2b.dev. It's open source under the Apache 2.0 license and uses Next.js, shadcn/ui, Tailwind CSS and the Vercel AI SDK.

Local hosting doesn't make the full workflow offline: code execution uses E2B's external sandbox service and requires an E2B API key. Ollama can keep model inference local; choosing a cloud model provider sends model requests to that provider and requires its API credentials.

Similar to Fragments