Eduards commited on
Commit
1b76d3c
·
2 Parent(s): 225b553 960f532
.env.example CHANGED
@@ -70,6 +70,11 @@ LMSTUDIO_API_BASE_URL=
70
  # You only need this environment variable set if you want to use xAI models
71
  XAI_API_KEY=
72
 
 
 
 
 
 
73
  # Include this environment variable if you want more logging for debugging locally
74
  VITE_LOG_LEVEL=debug
75
 
 
70
  # You only need this environment variable set if you want to use xAI models
71
  XAI_API_KEY=
72
 
73
+ # Get your Perplexity API Key here -
74
+ # https://www.perplexity.ai/settings/api
75
+ # You only need this environment variable set if you want to use Perplexity models
76
+ PERPLEXITY_API_KEY=
77
+
78
  # Include this environment variable if you want more logging for debugging locally
79
  VITE_LOG_LEVEL=debug
80
 
CONTRIBUTING.md CHANGED
@@ -1,6 +1,6 @@
1
- # Contributing to oTToDev
2
 
3
- First off, thank you for considering contributing to Bolt.diy! This fork aims to expand the capabilities of the original project by integrating multiple LLM providers and enhancing functionality. Every contribution helps make Bolt.diy a better tool for developers worldwide.
4
 
5
  ## 📋 Table of Contents
6
  - [Code of Conduct](#code-of-conduct)
 
1
+ # Contributing to bolt.diy
2
 
3
+ First off, thank you for considering contributing to bolt.diy! This fork aims to expand the capabilities of the original project by integrating multiple LLM providers and enhancing functionality. Every contribution helps make bolt.diy a better tool for developers worldwide.
4
 
5
  ## 📋 Table of Contents
6
  - [Code of Conduct](#code-of-conduct)
FAQ.md CHANGED
@@ -1,12 +1,12 @@
1
- [![Bolt.new: AI-Powered Full-Stack Web Development in the Browser](./public/social_preview_index.jpg)](https://bolt.new)
2
 
3
- # Bolt.new Fork by Cole Medin - Bolt.diy
4
 
5
  ## FAQ
6
 
7
- ### How do I get the best results with Bolt.diy?
8
 
9
- - **Be specific about your stack**: If you want to use specific frameworks or libraries (like Astro, Tailwind, ShadCN, or any other popular JavaScript framework), mention them in your initial prompt to ensure Bolt scaffolds the project accordingly.
10
 
11
  - **Use the enhance prompt icon**: Before sending your prompt, try clicking the 'enhance' icon to have the AI model help you refine your prompt, then edit the results before submitting.
12
 
@@ -14,36 +14,29 @@
14
 
15
  - **Batch simple instructions**: Save time by combining simple instructions into one message. For example, you can ask Bolt.diy to change the color scheme, add mobile responsiveness, and restart the dev server, all in one go saving you time and reducing API credit consumption significantly.
16
 
17
- ### Do you plan on merging Bolt.diy back into the official Bolt.new repo?
18
-
19
- More news coming on this coming early next month - stay tuned!
20
-
21
  ### Why are there so many open issues/pull requests?
22
 
23
- Bolt.diy was started simply to showcase how to edit an open source project and to do something cool with local LLMs on my (@ColeMedin) YouTube channel! However, it quickly
24
- grew into a massive community project that I am working hard to keep up with the demand of by forming a team of maintainers and getting as many people involved as I can.
25
- That effort is going well and all of our maintainers are ABSOLUTE rockstars, but it still takes time to organize everything so we can efficiently get through all
26
- the issues and PRs. But rest assured, we are working hard and even working on some partnerships behind the scenes to really help this project take off!
27
 
28
- ### How do local LLMs fair compared to larger models like Claude 3.5 Sonnet for Bolt.diy/Bolt.new?
29
 
30
  As much as the gap is quickly closing between open source and massive close source models, you’re still going to get the best results with the very large models like GPT-4o, Claude 3.5 Sonnet, and DeepSeek Coder V2 236b. This is one of the big tasks we have at hand - figuring out how to prompt better, use agents, and improve the platform as a whole to make it work better for even the smaller local LLMs!
31
 
32
  ### I'm getting the error: "There was an error processing this request"
33
 
34
- If you see this error within Bolt.diy, that is just the application telling you there is a problem at a high level, and this could mean a number of different things. To find the actual error, please check BOTH the terminal where you started the application (with Docker or pnpm) and the developer console in the browser. For most browsers, you can access the developer console by pressing F12 or right clicking anywhere in the browser and selecting “Inspect”. Then go to the “console” tab in the top right.
35
 
36
  ### I'm getting the error: "x-api-key header missing"
37
 
38
- We have seen this error a couple times and for some reason just restarting the Docker container has fixed it. This seems to be Ollama specific. Another thing to try is try to run Bolt.diy with Docker or pnpm, whichever you didn’t run first. We are still on the hunt for why this happens once and a while!
39
 
40
- ### I'm getting a blank preview when Bolt.diy runs my app!
41
 
42
- We promise you that we are constantly testing new PRs coming into Bolt.diy and the preview is core functionality, so the application is not broken! When you get a blank preview or don’t get a preview, this is generally because the LLM hallucinated bad code or incorrect commands. We are working on making this more transparent so it is obvious. Sometimes the error will appear in developer console too so check that as well.
43
 
44
  ### How to add a LLM:
45
 
46
- To make new LLMs available to use in this version of Bolt.new, head on over to `app/utils/constants.ts` and find the constant MODEL_LIST. Each element in this array is an object that has the model ID for the name (get this from the provider's API documentation), a label for the frontend model dropdown, and the provider.
47
 
48
  By default, Anthropic, OpenAI, Groq, and Ollama are implemented as providers, but the YouTube video for this repo covers how to extend this to work with more providers if you wish!
49
 
 
1
+ [![bolt.diy: AI-Powered Full-Stack Web Development in the Browser](./public/social_preview_index.jpg)](https://bolt.diy)
2
 
3
+ # bolt.diy
4
 
5
  ## FAQ
6
 
7
+ ### How do I get the best results with bolt.diy?
8
 
9
+ - **Be specific about your stack**: If you want to use specific frameworks or libraries (like Astro, Tailwind, ShadCN, or any other popular JavaScript framework), mention them in your initial prompt to ensure bolt scaffolds the project accordingly.
10
 
11
  - **Use the enhance prompt icon**: Before sending your prompt, try clicking the 'enhance' icon to have the AI model help you refine your prompt, then edit the results before submitting.
12
 
 
14
 
15
  - **Batch simple instructions**: Save time by combining simple instructions into one message. For example, you can ask Bolt.diy to change the color scheme, add mobile responsiveness, and restart the dev server, all in one go saving you time and reducing API credit consumption significantly.
16
 
 
 
 
 
17
  ### Why are there so many open issues/pull requests?
18
 
19
+ bolt.diy was started simply to showcase how to edit an open source project and to do something cool with local LLMs on my (@ColeMedin) YouTube channel! However, it quickly grew into a massive community project that I am working hard to keep up with the demand of by forming a team of maintainers and getting as many people involved as I can. That effort is going well and all of our maintainers are ABSOLUTE rockstars, but it still takes time to organize everything so we can efficiently get through all the issues and PRs. But rest assured, we are working hard and even working on some partnerships behind the scenes to really help this project take off!
 
 
 
20
 
21
+ ### How do local LLMs fair compared to larger models like Claude 3.5 Sonnet for bolt.diy/bolt.new?
22
 
23
  As much as the gap is quickly closing between open source and massive close source models, you’re still going to get the best results with the very large models like GPT-4o, Claude 3.5 Sonnet, and DeepSeek Coder V2 236b. This is one of the big tasks we have at hand - figuring out how to prompt better, use agents, and improve the platform as a whole to make it work better for even the smaller local LLMs!
24
 
25
  ### I'm getting the error: "There was an error processing this request"
26
 
27
+ If you see this error within bolt.diy, that is just the application telling you there is a problem at a high level, and this could mean a number of different things. To find the actual error, please check BOTH the terminal where you started the application (with Docker or pnpm) and the developer console in the browser. For most browsers, you can access the developer console by pressing F12 or right clicking anywhere in the browser and selecting “Inspect”. Then go to the “console” tab in the top right.
28
 
29
  ### I'm getting the error: "x-api-key header missing"
30
 
31
+ We have seen this error a couple times and for some reason just restarting the Docker container has fixed it. This seems to be Ollama specific. Another thing to try is try to run bolt.diy with Docker or pnpm, whichever you didn’t run first. We are still on the hunt for why this happens once and a while!
32
 
33
+ ### I'm getting a blank preview when bolt.diy runs my app!
34
 
35
+ We promise you that we are constantly testing new PRs coming into bolt.diy and the preview is core functionality, so the application is not broken! When you get a blank preview or don’t get a preview, this is generally because the LLM hallucinated bad code or incorrect commands. We are working on making this more transparent so it is obvious. Sometimes the error will appear in developer console too so check that as well.
36
 
37
  ### How to add a LLM:
38
 
39
+ To make new LLMs available to use in this version of bolt.new, head on over to `app/utils/constants.ts` and find the constant MODEL_LIST. Each element in this array is an object that has the model ID for the name (get this from the provider's API documentation), a label for the frontend model dropdown, and the provider.
40
 
41
  By default, Anthropic, OpenAI, Groq, and Ollama are implemented as providers, but the YouTube video for this repo covers how to extend this to work with more providers if you wish!
42
 
README.md CHANGED
@@ -1,14 +1,14 @@
1
- [![Bolt.diy: AI-Powered Full-Stack Web Development in the Browser](./public/social_preview_index.jpg)](https://bolt.diy)
2
 
3
- # Bolt.diy (Previously oTToDev)
4
 
5
- Welcome to Bolt.diy, the official open source version of Bolt.new (previously known as oTToDev and Bolt.new ANY LLM), which allows you to choose the LLM that you use for each prompt! Currently, you can use OpenAI, Anthropic, Ollama, OpenRouter, Gemini, LMStudio, Mistral, xAI, HuggingFace, DeepSeek, or Groq models - and it is easily extended to use any other model supported by the Vercel AI SDK! See the instructions below for running this locally and extending it to include more models.
6
 
7
- Check the [Bolt.diy Docs](https://stackblitz-labs.github.io/bolt.diy/) for more information. This documentation is still being updated after the transfer.
8
 
9
- Bolt.diy was originally started by [Cole Medin](https://www.youtube.com/@ColeMedin) but has quickly grown into a massive community effort to build the BEST open source AI coding assistant!
10
 
11
- ## Join the community for Bolt.diy!
12
 
13
  https://thinktank.ottomator.ai
14
 
@@ -20,7 +20,7 @@ https://thinktank.ottomator.ai
20
  - ✅ Autogenerate Ollama models from what is downloaded (@yunatamos)
21
  - ✅ Filter models by provider (@jasonm23)
22
  - ✅ Download project as ZIP (@fabwaseem)
23
- - ✅ Improvements to the main Bolt.new prompt in `app\lib\.server\llm\prompts.ts` (@kofi-bhr)
24
  - ✅ DeepSeek API Integration (@zenith110)
25
  - ✅ Mistral API Integration (@ArulGandhi)
26
  - ✅ "Open AI Like" API Integration (@ZerxZ)
@@ -43,9 +43,9 @@ https://thinktank.ottomator.ai
43
  - ✅ Mobile friendly (@qwikode)
44
  - ✅ Better prompt enhancing (@SujalXplores)
45
  - ✅ Attach images to prompts (@atrokhym)
46
- - ✅ Detect package.json and commands to auto install and run preview for folder and git import (@wonderwhy-er)
47
  - ✅ Selection tool to target changes visually (@emcconnell)
48
- - ⬜ **HIGH PRIORITY** - Prevent Bolt from rewriting files as often (file locking and diffs)
49
  - ⬜ **HIGH PRIORITY** - Better prompting for smaller LLMs (code window sometimes doesn't start)
50
  - ⬜ **HIGH PRIORITY** - Run agents in the backend as opposed to a single model call
51
  - ⬜ Deploy directly to Vercel/Netlify/other similar platforms
@@ -57,7 +57,7 @@ https://thinktank.ottomator.ai
57
  - ⬜ Perplexity Integration
58
  - ⬜ Vertex AI Integration
59
 
60
- ## Bolt.diy Features
61
 
62
  - **AI-powered full-stack web development** directly in your browser.
63
  - **Support for multiple LLMs** with an extensible architecture to integrate additional models.
@@ -67,7 +67,7 @@ https://thinktank.ottomator.ai
67
  - **Download projects as ZIP** for easy portability.
68
  - **Integration-ready Docker support** for a hassle-free setup.
69
 
70
- ## Setup Bolt.diy
71
 
72
  If you're new to installing software from GitHub, don't worry! If you encounter any issues, feel free to submit an "issue" using the provided links or improve this documentation by forking the repository, editing the instructions, and submitting a pull request. The following instruction will help you get the stable branch up and running on your local machine in no time.
73
 
@@ -175,7 +175,7 @@ DEFAULT_NUM_CTX=8192
175
 
176
  ### Update Your Local Version to the Latest
177
 
178
- To keep your local version of Bolt.diy up to date with the latest changes, follow these steps for your operating system:
179
 
180
  #### 1. **Navigate to your project folder**
181
  Navigate to the directory where you cloned the repository and open a terminal:
@@ -201,34 +201,36 @@ To keep your local version of Bolt.diy up to date with the latest changes, follo
201
  pnpm run dev
202
  ```
203
 
204
- This ensures that you're running the latest version of Bolt.diy and can take advantage of all the newest features and bug fixes.
205
 
206
  ---
207
 
208
- ## Available Scripts
209
 
210
- Here are the available commands for managing the application:
 
 
 
 
 
 
 
 
211
 
212
- - `pnpm run dev`: Start the development server.
213
- - `pnpm run build`: Build the project.
214
- - `pnpm run start`: Run the built application locally (uses Wrangler Pages).
215
- - `pnpm run preview`: Build and start the application locally for production testing.
216
- - `pnpm test`: Run the test suite using Vitest.
217
- - `pnpm run typecheck`: Perform TypeScript type checking.
218
- - `pnpm run typegen`: Generate TypeScript types using Wrangler.
219
- - `pnpm run deploy`: Build and deploy the project to Cloudflare Pages.
220
- - `pnpm lint:fix`: Run the linter and automatically fix issues.
221
 
222
- ## How do I contribute to Bolt.diy?
223
 
224
- [Please check out our dedicated page for contributing to Bolt.diy here!](CONTRIBUTING.md)
225
 
226
- ## What are the future plans for Bolt.diy?
227
 
228
- [Check out our Roadmap here!](https://roadmap.sh/r/ottodev-roadmap-2ovzo)
229
 
230
- Lot more updates to this roadmap coming soon!
231
 
232
  ## FAQ
233
 
234
- [Please check out our dedicated page for FAQ's related to Bolt.diy here!](FAQ.md)
 
1
+ [![bolt.diy: AI-Powered Full-Stack Web Development in the Browser](./public/social_preview_index.jpg)](https://bolt.diy)
2
 
3
+ # bolt.diy (Previously oTToDev)
4
 
5
+ Welcome to bolt.diy, the official open source version of Bolt.new (previously known as oTToDev and bolt.new ANY LLM), which allows you to choose the LLM that you use for each prompt! Currently, you can use OpenAI, Anthropic, Ollama, OpenRouter, Gemini, LMStudio, Mistral, xAI, HuggingFace, DeepSeek, or Groq models - and it is easily extended to use any other model supported by the Vercel AI SDK! See the instructions below for running this locally and extending it to include more models.
6
 
7
+ Check the [bolt.diy Docs](https://stackblitz-labs.github.io/bolt.diy/) for more information. This documentation is still being updated after the transfer.
8
 
9
+ bolt.diy was originally started by [Cole Medin](https://www.youtube.com/@ColeMedin) but has quickly grown into a massive community effort to build the BEST open source AI coding assistant!
10
 
11
+ ## Join the community for bolt.diy!
12
 
13
  https://thinktank.ottomator.ai
14
 
 
20
  - ✅ Autogenerate Ollama models from what is downloaded (@yunatamos)
21
  - ✅ Filter models by provider (@jasonm23)
22
  - ✅ Download project as ZIP (@fabwaseem)
23
+ - ✅ Improvements to the main bolt.new prompt in `app\lib\.server\llm\prompts.ts` (@kofi-bhr)
24
  - ✅ DeepSeek API Integration (@zenith110)
25
  - ✅ Mistral API Integration (@ArulGandhi)
26
  - ✅ "Open AI Like" API Integration (@ZerxZ)
 
43
  - ✅ Mobile friendly (@qwikode)
44
  - ✅ Better prompt enhancing (@SujalXplores)
45
  - ✅ Attach images to prompts (@atrokhym)
46
+ - ✅ Detect package.json and commands to auto install & run preview for folder and git import (@wonderwhy-er)
47
  - ✅ Selection tool to target changes visually (@emcconnell)
48
+ - ⬜ **HIGH PRIORITY** - Prevent bolt from rewriting files as often (file locking and diffs)
49
  - ⬜ **HIGH PRIORITY** - Better prompting for smaller LLMs (code window sometimes doesn't start)
50
  - ⬜ **HIGH PRIORITY** - Run agents in the backend as opposed to a single model call
51
  - ⬜ Deploy directly to Vercel/Netlify/other similar platforms
 
57
  - ⬜ Perplexity Integration
58
  - ⬜ Vertex AI Integration
59
 
60
+ ## bolt.diy Features
61
 
62
  - **AI-powered full-stack web development** directly in your browser.
63
  - **Support for multiple LLMs** with an extensible architecture to integrate additional models.
 
67
  - **Download projects as ZIP** for easy portability.
68
  - **Integration-ready Docker support** for a hassle-free setup.
69
 
70
+ ## Setup bolt.diy
71
 
72
  If you're new to installing software from GitHub, don't worry! If you encounter any issues, feel free to submit an "issue" using the provided links or improve this documentation by forking the repository, editing the instructions, and submitting a pull request. The following instruction will help you get the stable branch up and running on your local machine in no time.
73
 
 
175
 
176
  ### Update Your Local Version to the Latest
177
 
178
+ To keep your local version of bolt.diy up to date with the latest changes, follow these steps for your operating system:
179
 
180
  #### 1. **Navigate to your project folder**
181
  Navigate to the directory where you cloned the repository and open a terminal:
 
201
  pnpm run dev
202
  ```
203
 
204
+ This ensures that you're running the latest version of bolt.diy and can take advantage of all the newest features and bug fixes.
205
 
206
  ---
207
 
208
+ ## Available Scripts
209
 
210
+ - **`pnpm run dev`**: Starts the development server.
211
+ - **`pnpm run build`**: Builds the project.
212
+ - **`pnpm run start`**: Runs the built application locally using Wrangler Pages.
213
+ - **`pnpm run preview`**: Builds and runs the production build locally.
214
+ - **`pnpm test`**: Runs the test suite using Vitest.
215
+ - **`pnpm run typecheck`**: Runs TypeScript type checking.
216
+ - **`pnpm run typegen`**: Generates TypeScript types using Wrangler.
217
+ - **`pnpm run deploy`**: Deploys the project to Cloudflare Pages.
218
+ - **`pnpm run lint:fix`**: Automatically fixes linting issues.
219
 
220
+ ---
221
+
222
+ ## Contributing
 
 
 
 
 
 
223
 
224
+ We welcome contributions! Check out our [Contributing Guide](CONTRIBUTING.md) to get started.
225
 
226
+ ---
227
 
228
+ ## Roadmap
229
 
230
+ Explore upcoming features and priorities on our [Roadmap](https://roadmap.sh/r/ottodev-roadmap-2ovzo).
231
 
232
+ ---
233
 
234
  ## FAQ
235
 
236
+ For answers to common questions, visit our [FAQ Page](FAQ.md).
app/commit.json CHANGED
@@ -1 +1 @@
1
- { "commit": "2e05270bab264d7ee83d7a1dd5408c969f648a68" }
 
1
+ { "commit": "6ba93974a02a98c83badf2f0002ff4812b8f75a9" }
app/components/chat/BaseChat.tsx CHANGED
@@ -27,6 +27,7 @@ import { ModelSelector } from '~/components/chat/ModelSelector';
27
  import { SpeechRecognitionButton } from '~/components/chat/SpeechRecognition';
28
  import type { IProviderSetting, ProviderInfo } from '~/types/model';
29
  import { ScreenshotStateManager } from './ScreenshotStateManager';
 
30
 
31
  const TEXTAREA_MIN_HEIGHT = 76;
32
 
@@ -492,22 +493,16 @@ export const BaseChat = React.forwardRef<HTMLDivElement, BaseChatProps>(
492
  className={classNames(
493
  'transition-all',
494
  enhancingPrompt ? 'opacity-100' : '',
495
- promptEnhanced ? 'text-bolt-elements-item-contentAccent' : '',
496
- promptEnhanced ? 'pr-1.5' : '',
497
- promptEnhanced ? 'enabled:hover:bg-bolt-elements-item-backgroundAccent' : '',
498
  )}
499
- onClick={() => enhancePrompt?.()}
 
 
 
500
  >
501
  {enhancingPrompt ? (
502
- <>
503
- <div className="i-svg-spinners:90-ring-with-bg text-bolt-elements-loader-progress text-xl animate-spin"></div>
504
- <div className="ml-1.5">Enhancing prompt...</div>
505
- </>
506
  ) : (
507
- <>
508
- <div className="i-bolt:stars text-xl"></div>
509
- {promptEnhanced && <div className="ml-1.5">Prompt enhanced</div>}
510
- </>
511
  )}
512
  </IconButton>
513
 
 
27
  import { SpeechRecognitionButton } from '~/components/chat/SpeechRecognition';
28
  import type { IProviderSetting, ProviderInfo } from '~/types/model';
29
  import { ScreenshotStateManager } from './ScreenshotStateManager';
30
+ import { toast } from 'react-toastify';
31
 
32
  const TEXTAREA_MIN_HEIGHT = 76;
33
 
 
493
  className={classNames(
494
  'transition-all',
495
  enhancingPrompt ? 'opacity-100' : '',
 
 
 
496
  )}
497
+ onClick={() => {
498
+ enhancePrompt?.();
499
+ toast.success('Prompt enhanced!');
500
+ }}
501
  >
502
  {enhancingPrompt ? (
503
+ <div className="i-svg-spinners:90-ring-with-bg text-bolt-elements-loader-progress text-xl animate-spin"></div>
 
 
 
504
  ) : (
505
+ <div className="i-bolt:stars text-xl"></div>
 
 
 
506
  )}
507
  </IconButton>
508
 
app/components/settings/SettingsWindow.tsx CHANGED
@@ -27,8 +27,8 @@ export const SettingsWindow = ({ open, onClose }: SettingsProps) => {
27
  const tabs: { id: TabType; label: string; icon: string; component?: ReactElement }[] = [
28
  { id: 'chat-history', label: 'Chat History', icon: 'i-ph:book', component: <ChatHistoryTab /> },
29
  { id: 'providers', label: 'Providers', icon: 'i-ph:key', component: <ProvidersTab /> },
30
- { id: 'features', label: 'Features', icon: 'i-ph:star', component: <FeaturesTab /> },
31
  { id: 'connection', label: 'Connection', icon: 'i-ph:link', component: <ConnectionsTab /> },
 
32
  ...(debug
33
  ? [
34
  {
 
27
  const tabs: { id: TabType; label: string; icon: string; component?: ReactElement }[] = [
28
  { id: 'chat-history', label: 'Chat History', icon: 'i-ph:book', component: <ChatHistoryTab /> },
29
  { id: 'providers', label: 'Providers', icon: 'i-ph:key', component: <ProvidersTab /> },
 
30
  { id: 'connection', label: 'Connection', icon: 'i-ph:link', component: <ConnectionsTab /> },
31
+ { id: 'features', label: 'Features', icon: 'i-ph:star', component: <FeaturesTab /> },
32
  ...(debug
33
  ? [
34
  {
app/components/settings/chat-history/ChatHistoryTab.tsx CHANGED
@@ -22,17 +22,20 @@ export default function ChatHistoryTab() {
22
  };
23
 
24
  const handleDeleteAllChats = async () => {
 
 
 
 
 
25
  if (!db) {
26
  const error = new Error('Database is not available');
27
  logStore.logError('Failed to delete chats - DB unavailable', error);
28
  toast.error('Database is not available');
29
-
30
  return;
31
  }
32
 
33
  try {
34
  setIsDeleting(true);
35
-
36
  const allChats = await getAll(db);
37
  await Promise.all(allChats.map((chat) => deleteById(db!, chat.id)));
38
  logStore.logSystem('All chats deleted successfully', { count: allChats.length });
@@ -52,7 +55,6 @@ export default function ChatHistoryTab() {
52
  const error = new Error('Database is not available');
53
  logStore.logError('Failed to export chats - DB unavailable', error);
54
  toast.error('Database is not available');
55
-
56
  return;
57
  }
58
 
 
22
  };
23
 
24
  const handleDeleteAllChats = async () => {
25
+ const confirmDelete = window.confirm("Are you sure you want to delete all chats? This action cannot be undone.");
26
+ if (!confirmDelete) {
27
+ return; // Exit if the user cancels
28
+ }
29
+
30
  if (!db) {
31
  const error = new Error('Database is not available');
32
  logStore.logError('Failed to delete chats - DB unavailable', error);
33
  toast.error('Database is not available');
 
34
  return;
35
  }
36
 
37
  try {
38
  setIsDeleting(true);
 
39
  const allChats = await getAll(db);
40
  await Promise.all(allChats.map((chat) => deleteById(db!, chat.id)));
41
  logStore.logSystem('All chats deleted successfully', { count: allChats.length });
 
55
  const error = new Error('Database is not available');
56
  logStore.logError('Failed to export chats - DB unavailable', error);
57
  toast.error('Database is not available');
 
58
  return;
59
  }
60
 
app/components/settings/debug/DebugTab.tsx CHANGED
@@ -1,6 +1,7 @@
1
  import React, { useCallback, useEffect, useState } from 'react';
2
  import { useSettings } from '~/lib/hooks/useSettings';
3
  import commit from '~/commit.json';
 
4
 
5
  interface ProviderStatus {
6
  name: string;
@@ -27,14 +28,20 @@ interface IProviderConfig {
27
  name: string;
28
  settings: {
29
  enabled: boolean;
 
30
  };
31
  }
32
 
 
 
 
 
33
  const LOCAL_PROVIDERS = ['Ollama', 'LMStudio', 'OpenAILike'];
34
  const versionHash = commit.commit;
35
  const GITHUB_URLS = {
36
  original: 'https://api.github.com/repos/stackblitz-labs/bolt.diy/commits/main',
37
  fork: 'https://api.github.com/repos/Stijnus/bolt.new-any-llm/commits/main',
 
38
  };
39
 
40
  function getSystemInfo(): SystemInfo {
@@ -199,7 +206,7 @@ const checkProviderStatus = async (url: string | null, providerName: string): Pr
199
  };
200
 
201
  export default function DebugTab() {
202
- const { providers } = useSettings();
203
  const [activeProviders, setActiveProviders] = useState<ProviderStatus[]>([]);
204
  const [updateMessage, setUpdateMessage] = useState<string>('');
205
  const [systemInfo] = useState<SystemInfo>(getSystemInfo());
@@ -212,29 +219,30 @@ export default function DebugTab() {
212
 
213
  try {
214
  const entries = Object.entries(providers) as [string, IProviderConfig][];
215
- const statuses = entries
216
- .filter(([, provider]) => LOCAL_PROVIDERS.includes(provider.name))
217
- .map(async ([, provider]) => {
218
- const envVarName =
219
- provider.name.toLowerCase() === 'ollama'
220
- ? 'OLLAMA_API_BASE_URL'
221
- : provider.name.toLowerCase() === 'lmstudio'
 
222
  ? 'LMSTUDIO_API_BASE_URL'
223
  : `REACT_APP_${provider.name.toUpperCase()}_URL`;
224
 
225
- // Access environment variables through import.meta.env
226
- const url = import.meta.env[envVarName] || null;
227
- console.log(`[Debug] Using URL for ${provider.name}:`, url, `(from ${envVarName})`);
228
 
229
- const status = await checkProviderStatus(url, provider.name);
230
-
231
- return {
232
- ...status,
233
- enabled: provider.settings.enabled ?? false,
234
- };
235
- });
236
 
237
- Promise.all(statuses).then(setActiveProviders);
238
  } catch (error) {
239
  console.error('[Debug] Failed to update provider statuses:', error);
240
  }
@@ -257,32 +265,26 @@ export default function DebugTab() {
257
  setIsCheckingUpdate(true);
258
  setUpdateMessage('Checking for updates...');
259
 
260
- const [originalResponse, forkResponse] = await Promise.all([
261
- fetch(GITHUB_URLS.original),
262
- fetch(GITHUB_URLS.fork),
263
- ]);
264
 
265
- if (!originalResponse.ok || !forkResponse.ok) {
266
- throw new Error('Failed to fetch repository information');
 
267
  }
268
 
269
- const [originalData, forkData] = await Promise.all([
270
- originalResponse.json() as Promise<{ sha: string }>,
271
- forkResponse.json() as Promise<{ sha: string }>,
272
- ]);
273
 
274
- const originalCommitHash = originalData.sha;
275
- const forkCommitHash = forkData.sha;
276
- const isForked = versionHash === forkCommitHash && forkCommitHash !== originalCommitHash;
277
-
278
- if (originalCommitHash !== versionHash) {
279
  setUpdateMessage(
280
- `Update available from original repository!\n` +
281
- `Current: ${versionHash.slice(0, 7)}${isForked ? ' (forked)' : ''}\n` +
282
- `Latest: ${originalCommitHash.slice(0, 7)}`,
283
  );
284
  } else {
285
- setUpdateMessage('You are on the latest version from the original repository');
286
  }
287
  } catch (error) {
288
  setUpdateMessage('Failed to check for updates');
@@ -290,7 +292,7 @@ export default function DebugTab() {
290
  } finally {
291
  setIsCheckingUpdate(false);
292
  }
293
- }, [isCheckingUpdate]);
294
 
295
  const handleCopyToClipboard = useCallback(() => {
296
  const debugInfo = {
@@ -305,13 +307,17 @@ export default function DebugTab() {
305
  responseTime: provider.responseTime,
306
  url: provider.url,
307
  })),
308
- Version: versionHash,
 
 
 
309
  Timestamp: new Date().toISOString(),
310
  };
 
311
  navigator.clipboard.writeText(JSON.stringify(debugInfo, null, 2)).then(() => {
312
- alert('Debug information copied to clipboard!');
313
  });
314
- }, [activeProviders, systemInfo]);
315
 
316
  return (
317
  <div className="p-4 space-y-6">
 
1
  import React, { useCallback, useEffect, useState } from 'react';
2
  import { useSettings } from '~/lib/hooks/useSettings';
3
  import commit from '~/commit.json';
4
+ import { toast } from 'react-toastify';
5
 
6
  interface ProviderStatus {
7
  name: string;
 
28
  name: string;
29
  settings: {
30
  enabled: boolean;
31
+ baseUrl?: string;
32
  };
33
  }
34
 
35
+ interface CommitData {
36
+ commit: string;
37
+ }
38
+
39
  const LOCAL_PROVIDERS = ['Ollama', 'LMStudio', 'OpenAILike'];
40
  const versionHash = commit.commit;
41
  const GITHUB_URLS = {
42
  original: 'https://api.github.com/repos/stackblitz-labs/bolt.diy/commits/main',
43
  fork: 'https://api.github.com/repos/Stijnus/bolt.new-any-llm/commits/main',
44
+ commitJson: (branch: string) => `https://raw.githubusercontent.com/stackblitz-labs/bolt.diy/${branch}/app/commit.json`,
45
  };
46
 
47
  function getSystemInfo(): SystemInfo {
 
206
  };
207
 
208
  export default function DebugTab() {
209
+ const { providers, useLatestBranch } = useSettings();
210
  const [activeProviders, setActiveProviders] = useState<ProviderStatus[]>([]);
211
  const [updateMessage, setUpdateMessage] = useState<string>('');
212
  const [systemInfo] = useState<SystemInfo>(getSystemInfo());
 
219
 
220
  try {
221
  const entries = Object.entries(providers) as [string, IProviderConfig][];
222
+ const statuses = await Promise.all(
223
+ entries
224
+ .filter(([, provider]) => LOCAL_PROVIDERS.includes(provider.name))
225
+ .map(async ([, provider]) => {
226
+ const envVarName =
227
+ provider.name.toLowerCase() === 'ollama'
228
+ ? 'OLLAMA_API_BASE_URL'
229
+ : provider.name.toLowerCase() === 'lmstudio'
230
  ? 'LMSTUDIO_API_BASE_URL'
231
  : `REACT_APP_${provider.name.toUpperCase()}_URL`;
232
 
233
+ // Access environment variables through import.meta.env
234
+ const url = import.meta.env[envVarName] || provider.settings.baseUrl || null; // Ensure baseUrl is used
235
+ console.log(`[Debug] Using URL for ${provider.name}:`, url, `(from ${envVarName})`);
236
 
237
+ const status = await checkProviderStatus(url, provider.name);
238
+ return {
239
+ ...status,
240
+ enabled: provider.settings.enabled ?? false,
241
+ };
242
+ })
243
+ );
244
 
245
+ setActiveProviders(statuses);
246
  } catch (error) {
247
  console.error('[Debug] Failed to update provider statuses:', error);
248
  }
 
265
  setIsCheckingUpdate(true);
266
  setUpdateMessage('Checking for updates...');
267
 
268
+ const branchToCheck = useLatestBranch ? 'main' : 'stable';
269
+ console.log(`[Debug] Checking for updates against ${branchToCheck} branch`);
 
 
270
 
271
+ const localCommitResponse = await fetch(GITHUB_URLS.commitJson(branchToCheck));
272
+ if (!localCommitResponse.ok) {
273
+ throw new Error('Failed to fetch local commit info');
274
  }
275
 
276
+ const localCommitData = await localCommitResponse.json() as CommitData;
277
+ const remoteCommitHash = localCommitData.commit;
278
+ const currentCommitHash = versionHash;
 
279
 
280
+ if (remoteCommitHash !== currentCommitHash) {
 
 
 
 
281
  setUpdateMessage(
282
+ `Update available from ${branchToCheck} branch!\n` +
283
+ `Current: ${currentCommitHash.slice(0, 7)}\n` +
284
+ `Latest: ${remoteCommitHash.slice(0, 7)}`
285
  );
286
  } else {
287
+ setUpdateMessage(`You are on the latest version from the ${branchToCheck} branch`);
288
  }
289
  } catch (error) {
290
  setUpdateMessage('Failed to check for updates');
 
292
  } finally {
293
  setIsCheckingUpdate(false);
294
  }
295
+ }, [isCheckingUpdate, useLatestBranch]);
296
 
297
  const handleCopyToClipboard = useCallback(() => {
298
  const debugInfo = {
 
307
  responseTime: provider.responseTime,
308
  url: provider.url,
309
  })),
310
+ Version: {
311
+ hash: versionHash.slice(0, 7),
312
+ branch: useLatestBranch ? 'main' : 'stable'
313
+ },
314
  Timestamp: new Date().toISOString(),
315
  };
316
+
317
  navigator.clipboard.writeText(JSON.stringify(debugInfo, null, 2)).then(() => {
318
+ toast.success('Debug information copied to clipboard!');
319
  });
320
+ }, [activeProviders, systemInfo, useLatestBranch]);
321
 
322
  return (
323
  <div className="p-4 space-y-6">
app/components/settings/features/FeaturesTab.tsx CHANGED
@@ -3,18 +3,29 @@ import { Switch } from '~/components/ui/Switch';
3
  import { useSettings } from '~/lib/hooks/useSettings';
4
 
5
  export default function FeaturesTab() {
6
- const { debug, enableDebugMode, isLocalModel, enableLocalModels, eventLogs, enableEventLogs } = useSettings();
 
 
 
 
 
 
7
  return (
8
  <div className="p-4 bg-bolt-elements-bg-depth-2 border border-bolt-elements-borderColor rounded-lg mb-4">
9
  <div className="mb-6">
10
  <h3 className="text-lg font-medium text-bolt-elements-textPrimary mb-4">Optional Features</h3>
11
- <div className="flex items-center justify-between mb-2">
12
- <span className="text-bolt-elements-textPrimary">Debug Info</span>
13
- <Switch className="ml-auto" checked={debug} onCheckedChange={enableDebugMode} />
14
- </div>
15
- <div className="flex items-center justify-between mb-2">
16
- <span className="text-bolt-elements-textPrimary">Event Logs</span>
17
- <Switch className="ml-auto" checked={eventLogs} onCheckedChange={enableEventLogs} />
 
 
 
 
 
18
  </div>
19
  </div>
20
 
@@ -24,7 +35,7 @@ export default function FeaturesTab() {
24
  Disclaimer: Experimental features may be unstable and are subject to change.
25
  </p>
26
  <div className="flex items-center justify-between mb-2">
27
- <span className="text-bolt-elements-textPrimary">Enable Local Models</span>
28
  <Switch className="ml-auto" checked={isLocalModel} onCheckedChange={enableLocalModels} />
29
  </div>
30
  </div>
 
3
  import { useSettings } from '~/lib/hooks/useSettings';
4
 
5
  export default function FeaturesTab() {
6
+ const { debug, enableDebugMode, isLocalModel, enableLocalModels, eventLogs, enableEventLogs, useLatestBranch, enableLatestBranch } = useSettings();
7
+
8
+ const handleToggle = (enabled: boolean) => {
9
+ enableDebugMode(enabled);
10
+ enableEventLogs(enabled);
11
+ };
12
+
13
  return (
14
  <div className="p-4 bg-bolt-elements-bg-depth-2 border border-bolt-elements-borderColor rounded-lg mb-4">
15
  <div className="mb-6">
16
  <h3 className="text-lg font-medium text-bolt-elements-textPrimary mb-4">Optional Features</h3>
17
+ <div className="space-y-4">
18
+ <div className="flex items-center justify-between">
19
+ <span className="text-bolt-elements-textPrimary">Debug Features</span>
20
+ <Switch className="ml-auto" checked={debug} onCheckedChange={handleToggle} />
21
+ </div>
22
+ <div className="flex items-center justify-between">
23
+ <div>
24
+ <span className="text-bolt-elements-textPrimary">Use Main Branch</span>
25
+ <p className="text-sm text-bolt-elements-textSecondary">Check for updates against the main branch instead of stable</p>
26
+ </div>
27
+ <Switch className="ml-auto" checked={useLatestBranch} onCheckedChange={enableLatestBranch} />
28
+ </div>
29
  </div>
30
  </div>
31
 
 
35
  Disclaimer: Experimental features may be unstable and are subject to change.
36
  </p>
37
  <div className="flex items-center justify-between mb-2">
38
+ <span className="text-bolt-elements-textPrimary">Experimental Providers</span>
39
  <Switch className="ml-auto" checked={isLocalModel} onCheckedChange={enableLocalModels} />
40
  </div>
41
  </div>
app/components/settings/providers/ProvidersTab.tsx CHANGED
@@ -5,6 +5,9 @@ import { LOCAL_PROVIDERS, URL_CONFIGURABLE_PROVIDERS } from '~/lib/stores/settin
5
  import type { IProviderConfig } from '~/types/model';
6
  import { logStore } from '~/lib/stores/logs';
7
 
 
 
 
8
  export default function ProvidersTab() {
9
  const { providers, updateProviderSettings, isLocalModel } = useSettings();
10
  const [filteredProviders, setFilteredProviders] = useState<IProviderConfig[]>([]);
@@ -51,7 +54,14 @@ export default function ProvidersTab() {
51
  >
52
  <div className="flex items-center justify-between mb-2">
53
  <div className="flex items-center gap-2">
54
- <img src={`/icons/${provider.name}.svg`} alt={`${provider.name} icon`} className="w-6 h-6 dark:invert" />
 
 
 
 
 
 
 
55
  <span className="text-bolt-elements-textPrimary">{provider.name}</span>
56
  </div>
57
  <Switch
 
5
  import type { IProviderConfig } from '~/types/model';
6
  import { logStore } from '~/lib/stores/logs';
7
 
8
+ // Import a default fallback icon
9
+ import DefaultIcon from '/icons/Default.svg'; // Adjust the path as necessary
10
+
11
  export default function ProvidersTab() {
12
  const { providers, updateProviderSettings, isLocalModel } = useSettings();
13
  const [filteredProviders, setFilteredProviders] = useState<IProviderConfig[]>([]);
 
54
  >
55
  <div className="flex items-center justify-between mb-2">
56
  <div className="flex items-center gap-2">
57
+ <img
58
+ src={`/icons/${provider.name}.svg`} // Attempt to load the specific icon
59
+ onError={(e) => { // Fallback to default icon on error
60
+ e.currentTarget.src = DefaultIcon;
61
+ }}
62
+ alt={`${provider.name} icon`}
63
+ className="w-6 h-6 dark:invert"
64
+ />
65
  <span className="text-bolt-elements-textPrimary">{provider.name}</span>
66
  </div>
67
  <Switch
app/components/workbench/FileTree.tsx CHANGED
@@ -2,6 +2,7 @@ import { memo, useEffect, useMemo, useState, type ReactNode } from 'react';
2
  import type { FileMap } from '~/lib/stores/files';
3
  import { classNames } from '~/utils/classNames';
4
  import { createScopedLogger, renderLogger } from '~/utils/logger';
 
5
 
6
  const logger = createScopedLogger('FileTree');
7
 
@@ -110,6 +111,22 @@ export const FileTree = memo(
110
  });
111
  };
112
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
113
  return (
114
  <div className={classNames('text-sm', className, 'overflow-y-auto')}>
115
  {filteredFileList.map((fileOrFolder) => {
@@ -121,6 +138,12 @@ export const FileTree = memo(
121
  selected={selectedFile === fileOrFolder.fullPath}
122
  file={fileOrFolder}
123
  unsavedChanges={unsavedFiles?.has(fileOrFolder.fullPath)}
 
 
 
 
 
 
124
  onClick={() => {
125
  onFileSelect?.(fileOrFolder.fullPath);
126
  }}
@@ -134,6 +157,12 @@ export const FileTree = memo(
134
  folder={fileOrFolder}
135
  selected={allowFolderSelection && selectedFile === fileOrFolder.fullPath}
136
  collapsed={collapsedFolders.has(fileOrFolder.fullPath)}
 
 
 
 
 
 
137
  onClick={() => {
138
  toggleCollapseState(fileOrFolder.fullPath);
139
  }}
@@ -156,26 +185,67 @@ interface FolderProps {
156
  folder: FolderNode;
157
  collapsed: boolean;
158
  selected?: boolean;
 
 
159
  onClick: () => void;
160
  }
161
 
162
- function Folder({ folder: { depth, name }, collapsed, selected = false, onClick }: FolderProps) {
 
 
 
 
 
 
163
  return (
164
- <NodeButton
165
- className={classNames('group', {
166
- 'bg-transparent text-bolt-elements-item-contentDefault hover:text-bolt-elements-item-contentActive hover:bg-bolt-elements-item-backgroundActive':
167
- !selected,
168
- 'bg-bolt-elements-item-backgroundAccent text-bolt-elements-item-contentAccent': selected,
169
- })}
170
- depth={depth}
171
- iconClasses={classNames({
172
- 'i-ph:caret-right scale-98': collapsed,
173
- 'i-ph:caret-down scale-98': !collapsed,
174
- })}
175
- onClick={onClick}
176
  >
177
- {name}
178
- </NodeButton>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
179
  );
180
  }
181
 
@@ -183,31 +253,43 @@ interface FileProps {
183
  file: FileNode;
184
  selected: boolean;
185
  unsavedChanges?: boolean;
 
 
186
  onClick: () => void;
187
  }
188
 
189
- function File({ file: { depth, name }, onClick, selected, unsavedChanges = false }: FileProps) {
 
 
 
 
 
 
 
190
  return (
191
- <NodeButton
192
- className={classNames('group', {
193
- 'bg-transparent hover:bg-bolt-elements-item-backgroundActive text-bolt-elements-item-contentDefault': !selected,
194
- 'bg-bolt-elements-item-backgroundAccent text-bolt-elements-item-contentAccent': selected,
195
- })}
196
- depth={depth}
197
- iconClasses={classNames('i-ph:file-duotone scale-98', {
198
- 'group-hover:text-bolt-elements-item-contentActive': !selected,
199
- })}
200
- onClick={onClick}
201
- >
202
- <div
203
- className={classNames('flex items-center', {
204
  'group-hover:text-bolt-elements-item-contentActive': !selected,
205
  })}
 
206
  >
207
- <div className="flex-1 truncate pr-2">{name}</div>
208
- {unsavedChanges && <span className="i-ph:circle-fill scale-68 shrink-0 text-orange-500" />}
209
- </div>
210
- </NodeButton>
 
 
 
 
 
 
211
  );
212
  }
213
 
 
2
  import type { FileMap } from '~/lib/stores/files';
3
  import { classNames } from '~/utils/classNames';
4
  import { createScopedLogger, renderLogger } from '~/utils/logger';
5
+ import * as ContextMenu from '@radix-ui/react-context-menu';
6
 
7
  const logger = createScopedLogger('FileTree');
8
 
 
111
  });
112
  };
113
 
114
+ const onCopyPath = (fileOrFolder: FileNode | FolderNode) => {
115
+ try {
116
+ navigator.clipboard.writeText(fileOrFolder.fullPath);
117
+ } catch (error) {
118
+ logger.error(error);
119
+ }
120
+ };
121
+
122
+ const onCopyRelativePath = (fileOrFolder: FileNode | FolderNode) => {
123
+ try {
124
+ navigator.clipboard.writeText(fileOrFolder.fullPath.substring((rootFolder || '').length));
125
+ } catch (error) {
126
+ logger.error(error);
127
+ }
128
+ };
129
+
130
  return (
131
  <div className={classNames('text-sm', className, 'overflow-y-auto')}>
132
  {filteredFileList.map((fileOrFolder) => {
 
138
  selected={selectedFile === fileOrFolder.fullPath}
139
  file={fileOrFolder}
140
  unsavedChanges={unsavedFiles?.has(fileOrFolder.fullPath)}
141
+ onCopyPath={() => {
142
+ onCopyPath(fileOrFolder);
143
+ }}
144
+ onCopyRelativePath={() => {
145
+ onCopyRelativePath(fileOrFolder);
146
+ }}
147
  onClick={() => {
148
  onFileSelect?.(fileOrFolder.fullPath);
149
  }}
 
157
  folder={fileOrFolder}
158
  selected={allowFolderSelection && selectedFile === fileOrFolder.fullPath}
159
  collapsed={collapsedFolders.has(fileOrFolder.fullPath)}
160
+ onCopyPath={() => {
161
+ onCopyPath(fileOrFolder);
162
+ }}
163
+ onCopyRelativePath={() => {
164
+ onCopyRelativePath(fileOrFolder);
165
+ }}
166
  onClick={() => {
167
  toggleCollapseState(fileOrFolder.fullPath);
168
  }}
 
185
  folder: FolderNode;
186
  collapsed: boolean;
187
  selected?: boolean;
188
+ onCopyPath: () => void;
189
+ onCopyRelativePath: () => void;
190
  onClick: () => void;
191
  }
192
 
193
+ interface FolderContextMenuProps {
194
+ onCopyPath?: () => void;
195
+ onCopyRelativePath?: () => void;
196
+ children: ReactNode;
197
+ }
198
+
199
+ function ContextMenuItem({ onSelect, children }: { onSelect?: () => void; children: ReactNode }) {
200
  return (
201
+ <ContextMenu.Item
202
+ onSelect={onSelect}
203
+ className="flex items-center gap-2 px-2 py-1.5 outline-0 text-sm text-bolt-elements-textPrimary cursor-pointer ws-nowrap text-bolt-elements-item-contentDefault hover:text-bolt-elements-item-contentActive hover:bg-bolt-elements-item-backgroundActive rounded-md"
 
 
 
 
 
 
 
 
 
204
  >
205
+ <span className="size-4 shrink-0"></span>
206
+ <span>{children}</span>
207
+ </ContextMenu.Item>
208
+ );
209
+ }
210
+
211
+ function FileContextMenu({ onCopyPath, onCopyRelativePath, children }: FolderContextMenuProps) {
212
+ return (
213
+ <ContextMenu.Root>
214
+ <ContextMenu.Trigger>{children}</ContextMenu.Trigger>
215
+ <ContextMenu.Portal>
216
+ <ContextMenu.Content
217
+ style={{ zIndex: 998 }}
218
+ className="border border-bolt-elements-borderColor rounded-md z-context-menu bg-bolt-elements-background-depth-1 dark:bg-bolt-elements-background-depth-2 data-[state=open]:animate-in animate-duration-100 data-[state=open]:fade-in-0 data-[state=open]:zoom-in-98 w-56"
219
+ >
220
+ <ContextMenu.Group className="p-1 border-b-px border-solid border-bolt-elements-borderColor">
221
+ <ContextMenuItem onSelect={onCopyPath}>Copy path</ContextMenuItem>
222
+ <ContextMenuItem onSelect={onCopyRelativePath}>Copy relative path</ContextMenuItem>
223
+ </ContextMenu.Group>
224
+ </ContextMenu.Content>
225
+ </ContextMenu.Portal>
226
+ </ContextMenu.Root>
227
+ );
228
+ }
229
+
230
+ function Folder({ folder, collapsed, selected = false, onCopyPath, onCopyRelativePath, onClick }: FolderProps) {
231
+ return (
232
+ <FileContextMenu onCopyPath={onCopyPath} onCopyRelativePath={onCopyRelativePath}>
233
+ <NodeButton
234
+ className={classNames('group', {
235
+ 'bg-transparent text-bolt-elements-item-contentDefault hover:text-bolt-elements-item-contentActive hover:bg-bolt-elements-item-backgroundActive':
236
+ !selected,
237
+ 'bg-bolt-elements-item-backgroundAccent text-bolt-elements-item-contentAccent': selected,
238
+ })}
239
+ depth={folder.depth}
240
+ iconClasses={classNames({
241
+ 'i-ph:caret-right scale-98': collapsed,
242
+ 'i-ph:caret-down scale-98': !collapsed,
243
+ })}
244
+ onClick={onClick}
245
+ >
246
+ {folder.name}
247
+ </NodeButton>
248
+ </FileContextMenu>
249
  );
250
  }
251
 
 
253
  file: FileNode;
254
  selected: boolean;
255
  unsavedChanges?: boolean;
256
+ onCopyPath: () => void;
257
+ onCopyRelativePath: () => void;
258
  onClick: () => void;
259
  }
260
 
261
+ function File({
262
+ file: { depth, name },
263
+ onClick,
264
+ onCopyPath,
265
+ onCopyRelativePath,
266
+ selected,
267
+ unsavedChanges = false,
268
+ }: FileProps) {
269
  return (
270
+ <FileContextMenu onCopyPath={onCopyPath} onCopyRelativePath={onCopyRelativePath}>
271
+ <NodeButton
272
+ className={classNames('group', {
273
+ 'bg-transparent hover:bg-bolt-elements-item-backgroundActive text-bolt-elements-item-contentDefault':
274
+ !selected,
275
+ 'bg-bolt-elements-item-backgroundAccent text-bolt-elements-item-contentAccent': selected,
276
+ })}
277
+ depth={depth}
278
+ iconClasses={classNames('i-ph:file-duotone scale-98', {
 
 
 
 
279
  'group-hover:text-bolt-elements-item-contentActive': !selected,
280
  })}
281
+ onClick={onClick}
282
  >
283
+ <div
284
+ className={classNames('flex items-center', {
285
+ 'group-hover:text-bolt-elements-item-contentActive': !selected,
286
+ })}
287
+ >
288
+ <div className="flex-1 truncate pr-2">{name}</div>
289
+ {unsavedChanges && <span className="i-ph:circle-fill scale-68 shrink-0 text-orange-500" />}
290
+ </div>
291
+ </NodeButton>
292
+ </FileContextMenu>
293
  );
294
  }
295
 
app/lib/.server/llm/api-key.ts CHANGED
@@ -39,6 +39,8 @@ export function getAPIKey(cloudflareEnv: Env, provider: string, userApiKeys?: Re
39
  return env.TOGETHER_API_KEY || cloudflareEnv.TOGETHER_API_KEY;
40
  case 'xAI':
41
  return env.XAI_API_KEY || cloudflareEnv.XAI_API_KEY;
 
 
42
  case 'Cohere':
43
  return env.COHERE_API_KEY;
44
  case 'AzureOpenAI':
 
39
  return env.TOGETHER_API_KEY || cloudflareEnv.TOGETHER_API_KEY;
40
  case 'xAI':
41
  return env.XAI_API_KEY || cloudflareEnv.XAI_API_KEY;
42
+ case 'Perplexity':
43
+ return env.PERPLEXITY_API_KEY || cloudflareEnv.PERPLEXITY_API_KEY;
44
  case 'Cohere':
45
  return env.COHERE_API_KEY;
46
  case 'AzureOpenAI':
app/lib/.server/llm/model.ts CHANGED
@@ -128,6 +128,15 @@ export function getXAIModel(apiKey: OptionalApiKey, model: string) {
128
  return openai(model);
129
  }
130
 
 
 
 
 
 
 
 
 
 
131
  export function getModel(
132
  provider: string,
133
  model: string,
@@ -170,6 +179,8 @@ export function getModel(
170
  return getXAIModel(apiKey, model);
171
  case 'Cohere':
172
  return getCohereAIModel(apiKey, model);
 
 
173
  default:
174
  return getOllamaModel(baseURL, model);
175
  }
 
128
  return openai(model);
129
  }
130
 
131
+ export function getPerplexityModel(apiKey: OptionalApiKey, model: string) {
132
+ const perplexity = createOpenAI({
133
+ baseURL: 'https://api.perplexity.ai/',
134
+ apiKey,
135
+ });
136
+
137
+ return perplexity(model);
138
+ }
139
+
140
  export function getModel(
141
  provider: string,
142
  model: string,
 
179
  return getXAIModel(apiKey, model);
180
  case 'Cohere':
181
  return getCohereAIModel(apiKey, model);
182
+ case 'Perplexity':
183
+ return getPerplexityModel(apiKey, model);
184
  default:
185
  return getOllamaModel(baseURL, model);
186
  }
app/lib/hooks/useSettings.tsx CHANGED
@@ -5,19 +5,42 @@ import {
5
  isLocalModelsEnabled,
6
  LOCAL_PROVIDERS,
7
  providersStore,
 
8
  } from '~/lib/stores/settings';
9
  import { useCallback, useEffect, useState } from 'react';
10
  import Cookies from 'js-cookie';
11
  import type { IProviderSetting, ProviderInfo } from '~/types/model';
12
  import { logStore } from '~/lib/stores/logs'; // assuming logStore is imported from this location
 
 
 
 
 
13
 
14
  export function useSettings() {
15
  const providers = useStore(providersStore);
16
  const debug = useStore(isDebugMode);
17
  const eventLogs = useStore(isEventLogsEnabled);
18
  const isLocalModel = useStore(isLocalModelsEnabled);
 
19
  const [activeProviders, setActiveProviders] = useState<ProviderInfo[]>([]);
20
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  // reading values from cookies on mount
22
  useEffect(() => {
23
  const savedProviders = Cookies.get('providers');
@@ -60,6 +83,19 @@ export function useSettings() {
60
  if (savedLocalModels) {
61
  isLocalModelsEnabled.set(savedLocalModels === 'true');
62
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  }, []);
64
 
65
  // writing values to cookies on change
@@ -111,6 +147,12 @@ export function useSettings() {
111
  Cookies.set('isLocalModelsEnabled', String(enabled));
112
  }, []);
113
 
 
 
 
 
 
 
114
  return {
115
  providers,
116
  activeProviders,
@@ -121,5 +163,7 @@ export function useSettings() {
121
  enableEventLogs,
122
  isLocalModel,
123
  enableLocalModels,
 
 
124
  };
125
  }
 
5
  isLocalModelsEnabled,
6
  LOCAL_PROVIDERS,
7
  providersStore,
8
+ latestBranch,
9
  } from '~/lib/stores/settings';
10
  import { useCallback, useEffect, useState } from 'react';
11
  import Cookies from 'js-cookie';
12
  import type { IProviderSetting, ProviderInfo } from '~/types/model';
13
  import { logStore } from '~/lib/stores/logs'; // assuming logStore is imported from this location
14
+ import commit from '~/commit.json';
15
+
16
+ interface CommitData {
17
+ commit: string;
18
+ }
19
 
20
  export function useSettings() {
21
  const providers = useStore(providersStore);
22
  const debug = useStore(isDebugMode);
23
  const eventLogs = useStore(isEventLogsEnabled);
24
  const isLocalModel = useStore(isLocalModelsEnabled);
25
+ const useLatest = useStore(latestBranch);
26
  const [activeProviders, setActiveProviders] = useState<ProviderInfo[]>([]);
27
 
28
+ // Function to check if we're on stable version
29
+ const checkIsStableVersion = async () => {
30
+ try {
31
+ const stableResponse = await fetch('https://raw.githubusercontent.com/stackblitz-labs/bolt.diy/stable/app/commit.json');
32
+ if (!stableResponse.ok) {
33
+ console.warn('Failed to fetch stable commit info');
34
+ return false;
35
+ }
36
+ const stableData = await stableResponse.json() as CommitData;
37
+ return commit.commit === stableData.commit;
38
+ } catch (error) {
39
+ console.warn('Error checking stable version:', error);
40
+ return false;
41
+ }
42
+ };
43
+
44
  // reading values from cookies on mount
45
  useEffect(() => {
46
  const savedProviders = Cookies.get('providers');
 
83
  if (savedLocalModels) {
84
  isLocalModelsEnabled.set(savedLocalModels === 'true');
85
  }
86
+
87
+ // load latest branch setting from cookies or determine based on version
88
+ const savedLatestBranch = Cookies.get('useLatestBranch');
89
+ if (savedLatestBranch === undefined) {
90
+ // If setting hasn't been set by user, check version
91
+ checkIsStableVersion().then(isStable => {
92
+ const shouldUseLatest = !isStable;
93
+ latestBranch.set(shouldUseLatest);
94
+ Cookies.set('useLatestBranch', String(shouldUseLatest));
95
+ });
96
+ } else {
97
+ latestBranch.set(savedLatestBranch === 'true');
98
+ }
99
  }, []);
100
 
101
  // writing values to cookies on change
 
147
  Cookies.set('isLocalModelsEnabled', String(enabled));
148
  }, []);
149
 
150
+ const enableLatestBranch = useCallback((enabled: boolean) => {
151
+ latestBranch.set(enabled);
152
+ logStore.logSystem(`Main branch updates ${enabled ? 'enabled' : 'disabled'}`);
153
+ Cookies.set('useLatestBranch', String(enabled));
154
+ }, []);
155
+
156
  return {
157
  providers,
158
  activeProviders,
 
163
  enableEventLogs,
164
  isLocalModel,
165
  enableLocalModels,
166
+ useLatestBranch: useLatest,
167
+ enableLatestBranch,
168
  };
169
  }
app/lib/stores/settings.ts CHANGED
@@ -46,3 +46,5 @@ export const isDebugMode = atom(false);
46
  export const isEventLogsEnabled = atom(false);
47
 
48
  export const isLocalModelsEnabled = atom(true);
 
 
 
46
  export const isEventLogsEnabled = atom(false);
47
 
48
  export const isLocalModelsEnabled = atom(true);
49
+
50
+ export const latestBranch = atom(false);
app/utils/constants.ts CHANGED
@@ -294,6 +294,30 @@ const PROVIDER_LIST: ProviderInfo[] = [
294
  ],
295
  getApiKeyLink: 'https://api.together.xyz/settings/api-keys',
296
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
297
  ];
298
 
299
  export const DEFAULT_PROVIDER = PROVIDER_LIST[0];
@@ -476,8 +500,6 @@ async function getLMStudioModels(_apiKeys?: Record<string, string>, settings?: I
476
  }));
477
  } catch (e: any) {
478
  logStore.logError('Failed to get LMStudio models', e, { baseUrl: settings?.baseUrl });
479
- logger.warn('Failed to get LMStudio models: ', e.message || '');
480
-
481
  return [];
482
  }
483
  }
 
294
  ],
295
  getApiKeyLink: 'https://api.together.xyz/settings/api-keys',
296
  },
297
+ {
298
+ name: 'Perplexity',
299
+ staticModels: [
300
+ {
301
+ name: 'llama-3.1-sonar-small-128k-online',
302
+ label: 'Sonar Small Online',
303
+ provider: 'Perplexity',
304
+ maxTokenAllowed: 8192,
305
+ },
306
+ {
307
+ name: 'llama-3.1-sonar-large-128k-online',
308
+ label: 'Sonar Large Online',
309
+ provider: 'Perplexity',
310
+ maxTokenAllowed: 8192,
311
+ },
312
+ {
313
+ name: 'llama-3.1-sonar-huge-128k-online',
314
+ label: 'Sonar Huge Online',
315
+ provider: 'Perplexity',
316
+ maxTokenAllowed: 8192,
317
+ },
318
+ ],
319
+ getApiKeyLink: 'https://www.perplexity.ai/settings/api',
320
+ },
321
  ];
322
 
323
  export const DEFAULT_PROVIDER = PROVIDER_LIST[0];
 
500
  }));
501
  } catch (e: any) {
502
  logStore.logError('Failed to get LMStudio models', e, { baseUrl: settings?.baseUrl });
 
 
503
  return [];
504
  }
505
  }
docs/docs/CONTRIBUTING.md CHANGED
@@ -1,11 +1,5 @@
1
  # Contribution Guidelines
2
 
3
- ## DEFAULT_NUM_CTX
4
-
5
- The `DEFAULT_NUM_CTX` environment variable can be used to limit the maximum number of context values used by the qwen2.5-coder model. For example, to limit the context to 24576 values (which uses 32GB of VRAM), set `DEFAULT_NUM_CTX=24576` in your `.env.local` file.
6
-
7
- First off, thank you for considering contributing to Bolt.diy! This fork aims to expand the capabilities of the original project by integrating multiple LLM providers and enhancing functionality. Every contribution helps make Bolt.diy a better tool for developers worldwide.
8
-
9
  ## 📋 Table of Contents
10
  - [Code of Conduct](#code-of-conduct)
11
  - [How Can I Contribute?](#how-can-i-contribute)
@@ -14,10 +8,14 @@ First off, thank you for considering contributing to Bolt.diy! This fork aims to
14
  - [Development Setup](#development-setup)
15
  - [Deploymnt with Docker](#docker-deployment-documentation)
16
 
 
 
17
  ## Code of Conduct
18
 
19
  This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to the project maintainers.
20
 
 
 
21
  ## How Can I Contribute?
22
 
23
  ### 🐞 Reporting Bugs and Feature Requests
@@ -35,6 +33,8 @@ This project and everyone participating in it is governed by our Code of Conduct
35
  ### ✨ Becoming a Core Contributor
36
  We're looking for dedicated contributors to help maintain and grow this project. If you're interested in becoming a core contributor, please fill out our [Contributor Application Form](https://forms.gle/TBSteXSDCtBDwr5m7).
37
 
 
 
38
  ## Pull Request Guidelines
39
 
40
  ### 📝 PR Checklist
@@ -49,6 +49,8 @@ We're looking for dedicated contributors to help maintain and grow this project.
49
  3. Address all review comments
50
  4. Maintain clean commit history
51
 
 
 
52
  ## Coding Standards
53
 
54
  ### 💻 General Guidelines
@@ -57,6 +59,8 @@ We're looking for dedicated contributors to help maintain and grow this project.
57
  - Keep functions focused and small
58
  - Use meaningful variable names
59
 
 
 
60
  ## Development Setup
61
 
62
  ### 🔄 Initial Setup
@@ -106,6 +110,8 @@ pnpm run dev
106
 
107
  **Note**: You will need Google Chrome Canary to run this locally if you use Chrome! It's an easy install and a good browser for web development anyway.
108
 
 
 
109
  ## Testing
110
 
111
  Run the test suite with:
@@ -114,6 +120,8 @@ Run the test suite with:
114
  pnpm test
115
  ```
116
 
 
 
117
  ## Deployment
118
 
119
  To deploy the application to Cloudflare Pages:
@@ -124,6 +132,8 @@ pnpm run deploy
124
 
125
  Make sure you have the necessary permissions and Wrangler is correctly configured for your Cloudflare account.
126
 
 
 
127
  # Docker Deployment Documentation
128
 
129
  This guide outlines various methods for building and deploying the application using Docker.
@@ -166,6 +176,8 @@ docker-compose --profile development up
166
  docker-compose --profile production up
167
  ```
168
 
 
 
169
  ## Running the Application
170
 
171
  After building using any of the methods above, run the container with:
@@ -178,6 +190,8 @@ docker run -p 5173:5173 --env-file .env.local bolt-ai:development
178
  docker run -p 5173:5173 --env-file .env.local bolt-ai:production
179
  ```
180
 
 
 
181
  ## Deployment with Coolify
182
 
183
  [Coolify](https://github.com/coollabsio/coolify) provides a straightforward deployment process:
@@ -195,6 +209,8 @@ docker run -p 5173:5173 --env-file .env.local bolt-ai:production
195
  - Adjust other environment variables as needed
196
  7. Deploy the application
197
 
 
 
198
  ## VS Code Integration
199
 
200
  The `docker-compose.yaml` configuration is compatible with VS Code dev containers:
@@ -203,6 +219,8 @@ The `docker-compose.yaml` configuration is compatible with VS Code dev container
203
  2. Select the dev container configuration
204
  3. Choose the "development" profile from the context menu
205
 
 
 
206
  ## Environment Files
207
 
208
  Ensure you have the appropriate `.env.local` file configured before running the containers. This file should contain:
@@ -210,6 +228,16 @@ Ensure you have the appropriate `.env.local` file configured before running the
210
  - Environment-specific configurations
211
  - Other required environment variables
212
 
 
 
 
 
 
 
 
 
 
 
213
  ## Notes
214
 
215
  - Port 5173 is exposed and mapped for both development and production environments
 
1
  # Contribution Guidelines
2
 
 
 
 
 
 
 
3
  ## 📋 Table of Contents
4
  - [Code of Conduct](#code-of-conduct)
5
  - [How Can I Contribute?](#how-can-i-contribute)
 
8
  - [Development Setup](#development-setup)
9
  - [Deploymnt with Docker](#docker-deployment-documentation)
10
 
11
+ ---
12
+
13
  ## Code of Conduct
14
 
15
  This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to the project maintainers.
16
 
17
+ ---
18
+
19
  ## How Can I Contribute?
20
 
21
  ### 🐞 Reporting Bugs and Feature Requests
 
33
  ### ✨ Becoming a Core Contributor
34
  We're looking for dedicated contributors to help maintain and grow this project. If you're interested in becoming a core contributor, please fill out our [Contributor Application Form](https://forms.gle/TBSteXSDCtBDwr5m7).
35
 
36
+ ---
37
+
38
  ## Pull Request Guidelines
39
 
40
  ### 📝 PR Checklist
 
49
  3. Address all review comments
50
  4. Maintain clean commit history
51
 
52
+ ---
53
+
54
  ## Coding Standards
55
 
56
  ### 💻 General Guidelines
 
59
  - Keep functions focused and small
60
  - Use meaningful variable names
61
 
62
+ ---
63
+
64
  ## Development Setup
65
 
66
  ### 🔄 Initial Setup
 
110
 
111
  **Note**: You will need Google Chrome Canary to run this locally if you use Chrome! It's an easy install and a good browser for web development anyway.
112
 
113
+ ---
114
+
115
  ## Testing
116
 
117
  Run the test suite with:
 
120
  pnpm test
121
  ```
122
 
123
+ ---
124
+
125
  ## Deployment
126
 
127
  To deploy the application to Cloudflare Pages:
 
132
 
133
  Make sure you have the necessary permissions and Wrangler is correctly configured for your Cloudflare account.
134
 
135
+ ---
136
+
137
  # Docker Deployment Documentation
138
 
139
  This guide outlines various methods for building and deploying the application using Docker.
 
176
  docker-compose --profile production up
177
  ```
178
 
179
+ ---
180
+
181
  ## Running the Application
182
 
183
  After building using any of the methods above, run the container with:
 
190
  docker run -p 5173:5173 --env-file .env.local bolt-ai:production
191
  ```
192
 
193
+ ---
194
+
195
  ## Deployment with Coolify
196
 
197
  [Coolify](https://github.com/coollabsio/coolify) provides a straightforward deployment process:
 
209
  - Adjust other environment variables as needed
210
  7. Deploy the application
211
 
212
+ ---
213
+
214
  ## VS Code Integration
215
 
216
  The `docker-compose.yaml` configuration is compatible with VS Code dev containers:
 
219
  2. Select the dev container configuration
220
  3. Choose the "development" profile from the context menu
221
 
222
+ ---
223
+
224
  ## Environment Files
225
 
226
  Ensure you have the appropriate `.env.local` file configured before running the containers. This file should contain:
 
228
  - Environment-specific configurations
229
  - Other required environment variables
230
 
231
+ ---
232
+
233
+ ## DEFAULT_NUM_CTX
234
+
235
+ The `DEFAULT_NUM_CTX` environment variable can be used to limit the maximum number of context values used by the qwen2.5-coder model. For example, to limit the context to 24576 values (which uses 32GB of VRAM), set `DEFAULT_NUM_CTX=24576` in your `.env.local` file.
236
+
237
+ First off, thank you for considering contributing to bolt.diy! This fork aims to expand the capabilities of the original project by integrating multiple LLM providers and enhancing functionality. Every contribution helps make bolt.diy a better tool for developers worldwide.
238
+
239
+ ---
240
+
241
  ## Notes
242
 
243
  - Port 5173 is exposed and mapped for both development and production environments
docs/docs/FAQ.md CHANGED
@@ -1,15 +1,15 @@
1
  # Frequently Asked Questions (FAQ)
2
 
3
- ## How do I get the best results with Bolt.diy?
4
 
5
  - **Be specific about your stack**:
6
- Mention the frameworks or libraries you want to use (e.g., Astro, Tailwind, ShadCN) in your initial prompt. This ensures that Bolt.diy scaffolds the project according to your preferences.
7
 
8
  - **Use the enhance prompt icon**:
9
  Before sending your prompt, click the *enhance* icon to let the AI refine your prompt. You can edit the suggested improvements before submitting.
10
 
11
  - **Scaffold the basics first, then add features**:
12
- Ensure the foundational structure of your application is in place before introducing advanced functionality. This helps Bolt.diy establish a solid base to build on.
13
 
14
  - **Batch simple instructions**:
15
  Combine simple tasks into a single prompt to save time and reduce API credit consumption. For example:
@@ -17,14 +17,13 @@
17
 
18
  ---
19
 
20
- ## How do I contribute to Bolt.diy?
21
 
22
  Check out our [Contribution Guide](CONTRIBUTING.md) for more details on how to get involved!
23
 
24
  ---
25
 
26
-
27
- ## What are the future plans for Bolt.diy?
28
 
29
  Visit our [Roadmap](https://roadmap.sh/r/ottodev-roadmap-2ovzo) for the latest updates.
30
  New features and improvements are on the way!
@@ -33,13 +32,13 @@ New features and improvements are on the way!
33
 
34
  ## Why are there so many open issues/pull requests?
35
 
36
- Bolt.diy began as a small showcase project on @ColeMedin's YouTube channel to explore editing open-source projects with local LLMs. However, it quickly grew into a massive community effort!
37
 
38
  We’re forming a team of maintainers to manage demand and streamline issue resolution. The maintainers are rockstars, and we’re also exploring partnerships to help the project thrive.
39
 
40
  ---
41
 
42
- ## How do local LLMs compare to larger models like Claude 3.5 Sonnet for Bolt.diy?
43
 
44
  While local LLMs are improving rapidly, larger models like GPT-4o, Claude 3.5 Sonnet, and DeepSeek Coder V2 236b still offer the best results for complex applications. Our ongoing focus is to improve prompts, agents, and the platform to better support smaller local LLMs.
45
 
@@ -73,4 +72,4 @@ Local LLMs like Qwen-2.5-Coder are powerful for small applications but still exp
73
 
74
  ---
75
 
76
- Got more questions? Feel free to reach out or open an issue in our GitHub repo!
 
1
  # Frequently Asked Questions (FAQ)
2
 
3
+ ## How do I get the best results with bolt.diy?
4
 
5
  - **Be specific about your stack**:
6
+ Mention the frameworks or libraries you want to use (e.g., Astro, Tailwind, ShadCN) in your initial prompt. This ensures that bolt.diy scaffolds the project according to your preferences.
7
 
8
  - **Use the enhance prompt icon**:
9
  Before sending your prompt, click the *enhance* icon to let the AI refine your prompt. You can edit the suggested improvements before submitting.
10
 
11
  - **Scaffold the basics first, then add features**:
12
+ Ensure the foundational structure of your application is in place before introducing advanced functionality. This helps bolt.diy establish a solid base to build on.
13
 
14
  - **Batch simple instructions**:
15
  Combine simple tasks into a single prompt to save time and reduce API credit consumption. For example:
 
17
 
18
  ---
19
 
20
+ ## How do I contribute to bolt.diy?
21
 
22
  Check out our [Contribution Guide](CONTRIBUTING.md) for more details on how to get involved!
23
 
24
  ---
25
 
26
+ ## What are the future plans for bolt.diy?
 
27
 
28
  Visit our [Roadmap](https://roadmap.sh/r/ottodev-roadmap-2ovzo) for the latest updates.
29
  New features and improvements are on the way!
 
32
 
33
  ## Why are there so many open issues/pull requests?
34
 
35
+ bolt.diy began as a small showcase project on @ColeMedin's YouTube channel to explore editing open-source projects with local LLMs. However, it quickly grew into a massive community effort!
36
 
37
  We’re forming a team of maintainers to manage demand and streamline issue resolution. The maintainers are rockstars, and we’re also exploring partnerships to help the project thrive.
38
 
39
  ---
40
 
41
+ ## How do local LLMs compare to larger models like Claude 3.5 Sonnet for bolt.diy?
42
 
43
  While local LLMs are improving rapidly, larger models like GPT-4o, Claude 3.5 Sonnet, and DeepSeek Coder V2 236b still offer the best results for complex applications. Our ongoing focus is to improve prompts, agents, and the platform to better support smaller local LLMs.
44
 
 
72
 
73
  ---
74
 
75
+ Got more questions? Feel free to reach out or open an issue in our GitHub repo!
docs/docs/index.md CHANGED
@@ -1,38 +1,46 @@
1
- # Welcome to Bolt DIY
2
- Bolt.diy allows you to choose the LLM that you use for each prompt! Currently, you can use OpenAI, Anthropic, Ollama, OpenRouter, Gemini, LMStudio, Mistral, xAI, HuggingFace, DeepSeek, or Groq models - and it is easily extended to use any other model supported by the Vercel AI SDK! See the instructions below for running this locally and extending it to include more models.
3
 
4
- Join the community!
5
 
6
- https://thinktank.ottomator.ai
7
 
8
- ## Whats Bolt.diy
9
 
10
- Bolt.diy is an AI-powered web development agent that allows you to prompt, run, edit, and deploy full-stack applications directly from your browser—no local setup required. If you're here to build your own AI-powered web dev agent using the Bolt open source codebase, [click here to get started!](./CONTRIBUTING.md)
11
 
12
- ## What Makes Bolt.diy Different
13
 
14
- Claude, v0, etc are incredible- but you can't install packages, run backends, or edit code. That’s where Bolt.diy stands out:
15
 
16
- - **Full-Stack in the Browser**: Bolt.diy integrates cutting-edge AI models with an in-browser development environment powered by **StackBlitz’s WebContainers**. This allows you to:
 
 
 
 
 
 
17
  - Install and run npm tools and libraries (like Vite, Next.js, and more)
18
  - Run Node.js servers
19
  - Interact with third-party APIs
20
  - Deploy to production from chat
21
  - Share your work via a URL
22
 
23
- - **AI with Environment Control**: Unlike traditional dev environments where the AI can only assist in code generation, Bolt.diy gives AI models **complete control** over the entire environment including the filesystem, node server, package manager, terminal, and browser console. This empowers AI agents to handle the whole app lifecycle—from creation to deployment.
24
 
25
- Whether you’re an experienced developer, a PM, or a designer, Bolt.diy allows you to easily build production-grade full-stack applications.
26
 
27
  For developers interested in building their own AI-powered development tools with WebContainers, check out the open-source Bolt codebase in this repo!
28
 
 
 
29
  ## Setup
30
 
31
  Many of you are new users to installing software from Github. If you have any installation troubles reach out and submit an "issue" using the links above, or feel free to enhance this documentation by forking, editing the instructions, and doing a pull request.
32
 
33
- 1. Install Git from https://git-scm.com/downloads
34
 
35
- 2. Install Node.js from https://nodejs.org/en/download/
36
 
37
  Pay attention to the installer notes after completion.
38
 
@@ -62,11 +70,11 @@ defaults write com.apple.finder AppleShowAllFiles YES
62
 
63
  **NOTE**: you only have to set the ones you want to use and Ollama doesn't need an API key because it runs locally on your computer:
64
 
65
- Get your GROQ API Key here: https://console.groq.com/keys
66
 
67
- Get your Open AI API Key by following these instructions: https://help.openai.com/en/articles/4936850-where-do-i-find-my-openai-api-key
68
 
69
- Get your Anthropic API Key in your account settings: https://console.anthropic.com/settings/keys
70
 
71
  ```
72
  GROQ_API_KEY=XXX
@@ -128,6 +136,8 @@ When you run the Docker Compose command with the development profile, any change
128
  make on your machine to the code will automatically be reflected in the site running
129
  on the container (i.e. hot reloading still applies!).
130
 
 
 
131
  ## Run Without Docker
132
 
133
  1. Install dependencies using Terminal (or CMD in Windows with admin permissions):
@@ -148,14 +158,18 @@ sudo npm install -g pnpm
148
  pnpm run dev
149
  ```
150
 
 
 
151
  ## Adding New LLMs:
152
 
153
- To make new LLMs available to use in this version of Bolt.diy, head on over to `app/utils/constants.ts` and find the constant MODEL_LIST. Each element in this array is an object that has the model ID for the name (get this from the provider's API documentation), a label for the frontend model dropdown, and the provider.
154
 
155
  By default, Anthropic, OpenAI, Groq, and Ollama are implemented as providers, but the YouTube video for this repo covers how to extend this to work with more providers if you wish!
156
 
157
  When you add a new model to the MODEL_LIST array, it will immediately be available to use when you run the app locally or reload it. For Ollama models, make sure you have the model installed already before trying to use it here!
158
 
 
 
159
  ## Available Scripts
160
 
161
  - `pnpm run dev`: Starts the development server.
@@ -167,6 +181,8 @@ When you add a new model to the MODEL_LIST array, it will immediately be availab
167
  - `pnpm run typegen`: Generates TypeScript types using Wrangler.
168
  - `pnpm run deploy`: Builds the project and deploys it to Cloudflare Pages.
169
 
 
 
170
  ## Development
171
 
172
  To start the development server:
@@ -177,9 +193,11 @@ pnpm run dev
177
 
178
  This will start the Remix Vite development server. You will need Google Chrome Canary to run this locally if you use Chrome! It's an easy install and a good browser for web development anyway.
179
 
 
 
180
  ## Tips and Tricks
181
 
182
- Here are some tips to get the most out of Bolt.diy:
183
 
184
  - **Be specific about your stack**: If you want to use specific frameworks or libraries (like Astro, Tailwind, ShadCN, or any other popular JavaScript framework), mention them in your initial prompt to ensure Bolt scaffolds the project accordingly.
185
 
 
1
+ # Welcome to bolt diy
2
+ bolt.diy allows you to choose the LLM that you use for each prompt! Currently, you can use OpenAI, Anthropic, Ollama, OpenRouter, Gemini, LMStudio, Mistral, xAI, HuggingFace, DeepSeek, or Groq models - and it is easily extended to use any other model supported by the Vercel AI SDK! See the instructions below for running this locally and extending it to include more models.
3
 
4
+ ---
5
 
6
+ ## Join the community!
7
 
8
+ [Join the community!](https://thinktank.ottomator.ai)
9
 
10
+ ---
11
 
12
+ ## Whats bolt.diy
13
 
14
+ bolt.diy is an AI-powered web development agent that allows you to prompt, run, edit, and deploy full-stack applications directly from your browser—no local setup required. If you're here to build your own AI-powered web dev agent using the Bolt open source codebase, [click here to get started!](./CONTRIBUTING.md)
15
 
16
+ ---
17
+
18
+ ## What Makes bolt.diy Different
19
+
20
+ Claude, v0, etc are incredible- but you can't install packages, run backends, or edit code. That’s where bolt.diy stands out:
21
+
22
+ - **Full-Stack in the Browser**: bolt.diy integrates cutting-edge AI models with an in-browser development environment powered by **StackBlitz’s WebContainers**. This allows you to:
23
  - Install and run npm tools and libraries (like Vite, Next.js, and more)
24
  - Run Node.js servers
25
  - Interact with third-party APIs
26
  - Deploy to production from chat
27
  - Share your work via a URL
28
 
29
+ - **AI with Environment Control**: Unlike traditional dev environments where the AI can only assist in code generation, bolt.diy gives AI models **complete control** over the entire environment including the filesystem, node server, package manager, terminal, and browser console. This empowers AI agents to handle the whole app lifecycle—from creation to deployment.
30
 
31
+ Whether you’re an experienced developer, a PM, or a designer, bolt.diy allows you to easily build production-grade full-stack applications.
32
 
33
  For developers interested in building their own AI-powered development tools with WebContainers, check out the open-source Bolt codebase in this repo!
34
 
35
+ ---
36
+
37
  ## Setup
38
 
39
  Many of you are new users to installing software from Github. If you have any installation troubles reach out and submit an "issue" using the links above, or feel free to enhance this documentation by forking, editing the instructions, and doing a pull request.
40
 
41
+ 1. [Install Git from](https://git-scm.com/downloads)
42
 
43
+ 2. [Install Node.js from](https://nodejs.org/en/download/)
44
 
45
  Pay attention to the installer notes after completion.
46
 
 
70
 
71
  **NOTE**: you only have to set the ones you want to use and Ollama doesn't need an API key because it runs locally on your computer:
72
 
73
+ [Get your GROQ API Key here](https://console.groq.com/keys)
74
 
75
+ [Get your Open AI API Key by following these instructions](https://help.openai.com/en/articles/4936850-where-do-i-find-my-openai-api-key)
76
 
77
+ Get your Anthropic API Key in your [account settings](https://console.anthropic.com/settings/keys)
78
 
79
  ```
80
  GROQ_API_KEY=XXX
 
136
  make on your machine to the code will automatically be reflected in the site running
137
  on the container (i.e. hot reloading still applies!).
138
 
139
+ ---
140
+
141
  ## Run Without Docker
142
 
143
  1. Install dependencies using Terminal (or CMD in Windows with admin permissions):
 
158
  pnpm run dev
159
  ```
160
 
161
+ ---
162
+
163
  ## Adding New LLMs:
164
 
165
+ To make new LLMs available to use in this version of bolt.diy, head on over to `app/utils/constants.ts` and find the constant MODEL_LIST. Each element in this array is an object that has the model ID for the name (get this from the provider's API documentation), a label for the frontend model dropdown, and the provider.
166
 
167
  By default, Anthropic, OpenAI, Groq, and Ollama are implemented as providers, but the YouTube video for this repo covers how to extend this to work with more providers if you wish!
168
 
169
  When you add a new model to the MODEL_LIST array, it will immediately be available to use when you run the app locally or reload it. For Ollama models, make sure you have the model installed already before trying to use it here!
170
 
171
+ ---
172
+
173
  ## Available Scripts
174
 
175
  - `pnpm run dev`: Starts the development server.
 
181
  - `pnpm run typegen`: Generates TypeScript types using Wrangler.
182
  - `pnpm run deploy`: Builds the project and deploys it to Cloudflare Pages.
183
 
184
+ ---
185
+
186
  ## Development
187
 
188
  To start the development server:
 
193
 
194
  This will start the Remix Vite development server. You will need Google Chrome Canary to run this locally if you use Chrome! It's an easy install and a good browser for web development anyway.
195
 
196
+ ---
197
+
198
  ## Tips and Tricks
199
 
200
+ Here are some tips to get the most out of bolt.diy:
201
 
202
  - **Be specific about your stack**: If you want to use specific frameworks or libraries (like Astro, Tailwind, ShadCN, or any other popular JavaScript framework), mention them in your initial prompt to ensure Bolt scaffolds the project accordingly.
203
 
docs/mkdocs.yml CHANGED
@@ -1,4 +1,4 @@
1
- site_name: Bolt.diy Docs
2
  site_dir: ../site
3
  theme:
4
  name: material
@@ -31,7 +31,7 @@ theme:
31
  repo: fontawesome/brands/github
32
  # logo: assets/logo.png
33
  # favicon: assets/logo.png
34
- repo_name: Bolt.diy
35
  repo_url: https://github.com/stackblitz-labs/bolt.diy
36
  edit_uri: ""
37
 
@@ -40,16 +40,16 @@ extra:
40
  social:
41
  - icon: fontawesome/brands/github
42
  link: https://github.com/stackblitz-labs/bolt.diy
43
- name: Bolt.diy
44
  - icon: fontawesome/brands/discourse
45
  link: https://thinktank.ottomator.ai/
46
- name: Bolt.diy Discourse
47
  - icon: fontawesome/brands/x-twitter
48
  link: https://x.com/bolt_diy
49
- name: Bolt.diy on X
50
  - icon: fontawesome/brands/bluesky
51
  link: https://bsky.app/profile/bolt.diy
52
- name: Bolt.diy on Bluesky
53
 
54
 
55
 
 
1
+ site_name: bolt.diy Docs
2
  site_dir: ../site
3
  theme:
4
  name: material
 
31
  repo: fontawesome/brands/github
32
  # logo: assets/logo.png
33
  # favicon: assets/logo.png
34
+ repo_name: bolt.diy
35
  repo_url: https://github.com/stackblitz-labs/bolt.diy
36
  edit_uri: ""
37
 
 
40
  social:
41
  - icon: fontawesome/brands/github
42
  link: https://github.com/stackblitz-labs/bolt.diy
43
+ name: bolt.diy
44
  - icon: fontawesome/brands/discourse
45
  link: https://thinktank.ottomator.ai/
46
+ name: bolt.diy Discourse
47
  - icon: fontawesome/brands/x-twitter
48
  link: https://x.com/bolt_diy
49
+ name: bolt.diy on X
50
  - icon: fontawesome/brands/bluesky
51
  link: https://bsky.app/profile/bolt.diy
52
+ name: bolt.diy on Bluesky
53
 
54
 
55
 
package.json CHANGED
@@ -58,6 +58,7 @@
58
  "@octokit/rest": "^21.0.2",
59
  "@octokit/types": "^13.6.2",
60
  "@openrouter/ai-sdk-provider": "^0.0.5",
 
61
  "@radix-ui/react-dialog": "^1.1.2",
62
  "@radix-ui/react-dropdown-menu": "^2.1.2",
63
  "@radix-ui/react-separator": "^1.1.0",
 
58
  "@octokit/rest": "^21.0.2",
59
  "@octokit/types": "^13.6.2",
60
  "@openrouter/ai-sdk-provider": "^0.0.5",
61
+ "@radix-ui/react-context-menu": "^2.2.2",
62
  "@radix-ui/react-dialog": "^1.1.2",
63
  "@radix-ui/react-dropdown-menu": "^2.1.2",
64
  "@radix-ui/react-separator": "^1.1.0",
pnpm-lock.yaml CHANGED
@@ -95,6 +95,9 @@ importers:
95
  '@openrouter/ai-sdk-provider':
96
  specifier: ^0.0.5
97
  version: 0.0.5([email protected])
 
 
 
98
  '@radix-ui/react-dialog':
99
  specifier: ^1.1.2
100
@@ -1530,6 +1533,19 @@ packages:
1530
  '@types/react':
1531
  optional: true
1532
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1533
  '@radix-ui/[email protected]':
1534
  resolution: {integrity: sha512-OKrckBy+sMEgYM/sMmqmErVn0kZqrHPJze+Ql3DzYsDDp0hl0L62nx/2122/Bvps1qz645jlcu2tD9lrRSdf8A==}
1535
  peerDependencies:
@@ -6888,6 +6904,20 @@ snapshots:
6888
  optionalDependencies:
6889
  '@types/react': 18.3.12
6890
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6891
6892
  dependencies:
6893
  react: 18.3.1
 
95
  '@openrouter/ai-sdk-provider':
96
  specifier: ^0.0.5
97
  version: 0.0.5([email protected])
98
+ '@radix-ui/react-context-menu':
99
+ specifier: ^2.2.2
100
101
  '@radix-ui/react-dialog':
102
  specifier: ^1.1.2
103
 
1533
  '@types/react':
1534
  optional: true
1535
 
1536
+ '@radix-ui/[email protected]':
1537
+ resolution: {integrity: sha512-99EatSTpW+hRYHt7m8wdDlLtkmTovEe8Z/hnxUPV+SKuuNL5HWNhQI4QSdjZqNSgXHay2z4M3Dym73j9p2Gx5Q==}
1538
+ peerDependencies:
1539
+ '@types/react': '*'
1540
+ '@types/react-dom': '*'
1541
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
1542
+ react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
1543
+ peerDependenciesMeta:
1544
+ '@types/react':
1545
+ optional: true
1546
+ '@types/react-dom':
1547
+ optional: true
1548
+
1549
  '@radix-ui/[email protected]':
1550
  resolution: {integrity: sha512-OKrckBy+sMEgYM/sMmqmErVn0kZqrHPJze+Ql3DzYsDDp0hl0L62nx/2122/Bvps1qz645jlcu2tD9lrRSdf8A==}
1551
  peerDependencies:
 
6904
  optionalDependencies:
6905
  '@types/react': 18.3.12
6906
 
6907
6908
+ dependencies:
6909
+ '@radix-ui/primitive': 1.1.0
6910
+ '@radix-ui/react-context': 1.1.1(@types/[email protected])([email protected])
6911
6912
+ '@radix-ui/react-primitive': 2.0.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
6913
+ '@radix-ui/react-use-callback-ref': 1.1.0(@types/[email protected])([email protected])
6914
+ '@radix-ui/react-use-controllable-state': 1.1.0(@types/[email protected])([email protected])
6915
+ react: 18.3.1
6916
+ react-dom: 18.3.1([email protected])
6917
+ optionalDependencies:
6918
+ '@types/react': 18.3.12
6919
+ '@types/react-dom': 18.3.1
6920
+
6921
6922
  dependencies:
6923
  react: 18.3.1
public/favicon.ico ADDED
public/icons/Default.svg ADDED
public/icons/Perplexity.svg ADDED
vite.config.ts CHANGED
@@ -19,7 +19,8 @@ export default defineConfig((config) => {
19
  future: {
20
  v3_fetcherPersist: true,
21
  v3_relativeSplatPath: true,
22
- v3_throwAbortReason: true
 
23
  },
24
  }),
25
  UnoCSS(),
 
19
  future: {
20
  v3_fetcherPersist: true,
21
  v3_relativeSplatPath: true,
22
+ v3_throwAbortReason: true,
23
+ v3_lazyRouteDiscovery: true
24
  },
25
  }),
26
  UnoCSS(),
worker-configuration.d.ts CHANGED
@@ -14,4 +14,5 @@ interface Env {
14
  GOOGLE_GENERATIVE_AI_API_KEY: string;
15
  MISTRAL_API_KEY: string;
16
  XAI_API_KEY: string;
 
17
  }
 
14
  GOOGLE_GENERATIVE_AI_API_KEY: string;
15
  MISTRAL_API_KEY: string;
16
  XAI_API_KEY: string;
17
+ PERPLEXITY_API_KEY: string;
18
  }