GitRead 中文社区
首页趋势排行榜原创文章严选周刊
更多资源
新手训练营
精选专题热门话题GitHub 文档资源精选实战指南

fragments

Open-source Next.js template for building apps that are fully generated by AI. By E2B.

  • 语言TypeScript
  • 大小5.3 MB
  • 更新1 周前
  • Issues26
在 GitHub 打开
avatare2b-dev

项目介绍

e2b-dev/fragments 是一个托管在 GitHub 上的开源项目,主要使用 TypeScript 编写,采用 Apache License 2.0 许可证,目前获得 6.4k 个 Star、863 次 Fork。

仓库全名
e2b-dev/fragments

README 摘要

Fragments by E2B This is an open-source version of apps like Anthropic's Claude Artifacts, Vercel v0, or GPT Engineer. Powered by the E2B SDK. → Try on fragments.e2b.dev Features Based on Next.js 14 (App Router, Server Actions), shadcn/ui, TailwindCSS, Vercel AI SDK. Uses the E2B SDK by E2B to securely execute code generated by AI. Streaming in the UI. Can install and use any package from npm, pip. Supported stacks…

完整内容见 GitHub 原始 README 或本页 。

常见问题

fragments 用什么语言开发?

主要使用 TypeScript 编写,采用 Apache License 2.0 许可证,目前有 6.4k 个 Star。

fragments 可以免费商用吗?

仓库采用 Apache License 2.0 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 fragments 的源码?

可以直接克隆仓库:git clone https://github.com/e2b-dev/fragments.git;安装与运行步骤见仓库 README。

fragments 最近还在维护吗?

仓库最近一次更新为 1 周前,当前有 26 个未关闭 Issue;Star 数为 6.4k,可作为社区活跃度的参考。

本页面展示项目元数据与原始 README,GitRead 中文社区 编辑团队负责选题收录。

相关仓库

freeCodeCamp/freeCodeCamp avatar
freeCodeCampfreeCodeCamp
8 小时前
459.0k
47.5k
188

freeCodeCamp.org 的开源代码库和课程体系。免费学习数学、编程和计算机科学。

learn-to-codenonprofitsprogramming+7
TypeScript
571.3 MB
9
详情
morluto/rea avatar
reamorluto
4 小时前
452.3k
110.9k
921

借助智能体逆向分析任何内容,从应用行为直至原生二进制文件。

agent-skillsaiandroid+17
TypeScript
152.0 MB
0
详情
openclaw/openclaw avatar
openclawopenclaw
3 小时前
394.4k
82.9k
8.1k

真正做实事的 AI。任何 OS。任何平台。龙虾之道。🦞

aiassistantcrustacean+4
TypeScript
13.4 GB
18
详情
nilbuild/developer-roadmap avatar
developer-roadmapnilbuild
8 小时前
371.8k
43.2k
0

交互式路线图、指南及其他教育内容,帮助开发者在职业生涯中成长。

computer-scienceroadmapdeveloper-roadmap+7
TypeScript
356.2 MB
2
详情
deepseek-ai/deepseek-harness avatar
deepseek-harnessdeepseek-ai
11 小时前
278.9k
34.3k
0

DeepSeek Harness:一切皆插件。

ai-agentscordisdsh+1
TypeScript
374.1 MB
3
详情
anomalyco/opencode avatar
opencodeanomalyco
1 小时前
226.1k
30.6k
4.3k

开源编码代理。

TypeScript
675.8 MB
0
详情
vuejs/vue avatar
vuevuejs
2024年10月10日
212.5k
34.2k
645

这是 Vue 2 的仓库。如需 Vue 3,请前往 https://github.com/vuejs/core

frameworkfrontendjavascript+1
TypeScript
31.4 MB
0
详情
n8n-io/n8n avatar
n8nn8n-io
1 小时前
210.2k
61.5k
1.2k

具备原生 AI 能力的公平代码工作流自动化平台。将可视化构建与自定义代码相结合,支持自托管或云端部署,提供 400+ 种集成。

automationipaasn8n+7
TypeScript
789.1 MB
3
详情

关于

aiai-code-generationanthropicclaudeclaude-aicode-interpretere2bjavascriptllmnextjsreactsandboxtypescript
  • Apache License 2.0
  • 6.4k Stars
  • 863 Forks
  • 43 Watching

简要分析

热度分
8180
价值分
4108
活跃状态
活跃
GitHub

语言占比

CSS
JavaScript
Python
TypeScript

贡献者

mishushakovmishushakovmlejvamlejvarenovate[bot]renovate[bot]ben-fornefeldben-fornefelddependabot[bot]dependabot[bot]jakubnojakubnoValentaTomasValentaTomasdrankoudrankoudevin-ai-integration[bot]devin-ai-integration[bot]tizkovaterezatizkovaterezadavidmokosdavidmokosDhruvBhatia0DhruvBhatia0

E2B Fragments Preview Light E2B Fragments Preview Dark

Fragments by E2B

This is an open-source version of apps like Anthropic’s Claude Artifacts, Vercel v0, or GPT Engineer.

Powered by the E2B SDK.

→ Try on fragments.e2b.dev

Features

  • Based on Next.js 14 (App Router, Server Actions), shadcn/ui, TailwindCSS, Vercel AI SDK.
  • Uses the E2B SDK by E2B to securely execute code generated by AI.
  • Streaming in the UI.
  • Can install and use any package from npm, pip.
  • Supported stacks (add your own):
    • 🔸 Python interpreter
    • 🔸 Next.js
    • 🔸 Vue.js
    • 🔸 Streamlit
    • 🔸 Gradio
  • Supported LLM Providers (add your own):
    • 🔸 OpenAI
    • 🔸 Anthropic
    • 🔸 Google AI
    • 🔸 Mistral
    • 🔸 Groq
    • 🔸 Fireworks
    • 🔸 Together AI
    • 🔸 Ollama
  • Integrates with Morph Apply model for token efficient, accurate and faster code editing.

Make sure to give us a star!

Screenshot 2024-04-20 at 22 13 32

Get started

Prerequisites

  • git
  • Recent version of Node.js and npm package manager
  • E2B API Key
  • LLM Provider API Key

1. Clone the repository

In your terminal:

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

2. Install the dependencies

Enter the repository:

cd fragments

Run the following to install the required dependencies:

npm i

3. Set the environment variables

Create a .env.local file and set the following:

# Get your API key here - https://e2b.dev/?utm_source=github&utm_medium=referral&utm_campaign=readme&utm_content=fragments
E2B_API_KEY="your-e2b-api-key"

# OpenAI API Key
OPENAI_API_KEY=

# Other providers
ANTHROPIC_API_KEY=
GROQ_API_KEY=
FIREWORKS_API_KEY=
TOGETHER_API_KEY=
GOOGLE_AI_API_KEY=
GOOGLE_VERTEX_CREDENTIALS=
MISTRAL_API_KEY=
XAI_API_KEY=

# Ollama server address, enables Ollama models (e.g. http://localhost:11434/api)
OLLAMA_BASE_URL=

### Optional env vars

# (on by default) Get your MORPH key here - https://morphllm.com/dashboard/api-keys
MORPH_API_KEY=

# Domain of the site
NEXT_PUBLIC_SITE_URL=

# Rate limit
RATE_LIMIT_MAX_REQUESTS=
RATE_LIMIT_WINDOW=

# Vercel/Upstash KV (short URLs, rate limiting)
KV_REST_API_URL=
KV_REST_API_TOKEN=

# Supabase (auth)
SUPABASE_URL=
SUPABASE_ANON_KEY=

# PostHog (analytics)
NEXT_PUBLIC_POSTHOG_KEY=
NEXT_PUBLIC_POSTHOG_HOST=

### Disabling functionality (when uncommented)

# Disable API key input in the chat
# NEXT_PUBLIC_NO_API_KEY_INPUT=

# Hide local models from the list of available models
# NEXT_PUBLIC_HIDE_LOCAL_MODELS=

4. Start the development server

npm run dev

5. Build the web app

npm run build

Customize

Adding custom personas

  1. Make sure E2B CLI is installed and you’re logged in.

  2. Add a new folder under sandbox-templates/

  3. Initialize a new template using E2B CLI:

    e2b template init
    

    This will create a new file called e2b.Dockerfile.

  4. Adjust the e2b.Dockerfile

    Here’s an example streamlit template:

    # You can use most Debian-based base images
    FROM python:3.19-slim
    
    RUN pip3 install --no-cache-dir streamlit pandas numpy matplotlib requests seaborn plotly
    
    # Copy the code to the container
    WORKDIR /home/user
    COPY . /home/user
    
  5. Specify a custom start command in e2b.toml:

    start_cmd = "cd /home/user && streamlit run app.py"
    
  6. Deploy the template with the E2B CLI

    e2b template build --name <template-name>
    

    After the build has finished, you should get the following message:

    ✅ Building sandbox template <template-id> <template-name> finished.
    
  7. Open lib/templates.json in your code editor.

    Add your new template to the list. Here’s an example for Streamlit:

    "streamlit-developer": {
      "name": "Streamlit developer",
      "lib": [
        "streamlit",
        "pandas",
        "numpy",
        "matplotlib",
        "requests",
        "seaborn",
        "plotly"
      ],
      "file": "app.py",
      "instructions": "A streamlit app that reloads automatically.",
      "port": 8501 // can be null
    },
    

    Provide a template id (as key), name, list of dependencies, entrypoint and a port (optional). You can also add additional instructions that will be given to the LLM.

  8. Optionally, add a new logo under public/thirdparty/templates

Adding custom LLM models

  1. Open lib/models.json in your code editor.

  2. Add a new entry to the models list:

    {
      "id": "mistral-large",
      "name": "Mistral Large",
      "provider": "Ollama",
      "providerId": "ollama"
    }
    

    Where id is the model id, name is the model name (visible in the UI), provider is the provider name and providerId is the provider tag (see adding providers below).

Adding custom LLM providers

  1. Open lib/models.ts in your code editor.

  2. Add a new entry to the providerConfigs list:

    Example for fireworks:

    fireworks: () => createOpenAI({ apiKey: apiKey || process.env.FIREWORKS_API_KEY, baseURL: 'https://api.fireworks.ai/inference/v1' })(modelNameString),
    
  3. Optionally, adjust the default structured output mode in the getDefaultMode function:

    if (providerId === 'fireworks') {
      return 'json'
    }
    
  4. Optionally, add a new logo under public/thirdparty/logos

Contributing

As an open-source project, we welcome contributions from the community. If you are experiencing any bugs or want to add some improvements, please feel free to open an issue or pull request.

评论

登录 后发表评论
暂无评论
GitRead 中文社区
深度解读 · 趋势洞察 · 价值精选

关于

关于我们联系我们编辑准则收录标准赞赏人员

发现

技术趋势新手训练营资源精选实战指南精选专题热门话题GitHub 文档

条款

隐私政策服务条款网站地图
26.9万收录项目
6.4万中文话题
155精选专题
发现技术价值,连接开源智慧
© 2026 GitRead · GitHub 中文社区 本站与 GitHub, Inc. 无隶属关系;GitHub 是 GitHub, Inc. 的商标。