coleam00 / bolt.new-any-llm

Prompt, run, edit, and deploy full-stack web applications using any LLM you want!
https://bolt.new
MIT License
3.07k stars 1.31k forks source link

Project templates before start create #52

Open danielmeloalencar opened 3 weeks ago

danielmeloalencar commented 3 weeks ago

I noticed that the original Bolt.new uses project templates with the entire basic structure according to the project type (React, Vite, Express, Vue) when it recognizes the required project type based on the prompt. This helps prevent errors, such as occasionally adding unnecessary or non-existent dependencies to the package.json. I believe this could be done directly in the prompt within app\lib.server\llm\prompts.ts.

image

An alternative would be to choose the project type (template) before starting the prompt. That way, the entire project base (Vite/React, Node Express, Vue, etc.) would be set up correctly, and then the user could proceed with their prompt.

faddy19 commented 3 weeks ago

Absolutely right. This would make things much easier. We need to take out the guess work and channel the system so we get the endresult we want.

Any idea how to implement that?

danielmeloalencar commented 3 weeks ago

Absolutely right. This would make things much easier. We need to take out the guess work and channel the system so we get the endresult we want.

Any idea how to implement that?

Yes, using the same concept already applied, but with an additional step beforehand. There would need to be another prompt to identify which template needs to be installed.

Example:

User: Create a Todo app with React and Vite. The first interaction with the AI would be: Based on the user's statement, the AI needs to identify which template should be used and then write the files in the web container (based on template files already created beforehand). Once everything is created, it starts editing the template according to the user's prompt. An alternative would be to identify the necessary template and use it as context for the final prompt, but this would increase the processing cost and token usage.

thecodacus commented 1 week ago

I'm noticing an issue when comparing the output from the official bolt.new site with my local output. Even when using the Sonnet 3.5 model, the results still fall short of the quality seen on bolt.new.

And I found a .boltfolder that seems to contain the configuration settings for project templates. The config.json file within this folder shows a variety of available templates:

image

To improve this, I recommend creating a set of high-quality project templates and storing them in the Git repository. Each template should include a name and description, and we could make them selectable through a configuration panel.

When a user starts a new project, the system could first engage an LLM, supplying it with the list of templates and their descriptions. The LLM could then output a structured response indicating the chosen template, or it could suggest starting with a blank template.

Once a template is chosen, the system would clone it into the web container and proceed with the usual setup process.

Without these templating features, achieving high-quality code output is challenging, and this project risks being viewed as a toy if it can't support serious development.

(P.S: this comment is refined with AI for better readability 😆 , here us the prompt I am writing this comment in a github issue, rewrite it for better readability )

danielmeloalencar commented 1 week ago

I'm noticing an issue when comparing the output from the official site with my local output. Even when using the Sonnet 3.5 model, the results still fall short of the quality seen on .bolt.new``bolt.new

And I found a folder that seems to contain the configuration settings for project templates. The config.json file within this folder shows a variety of available templates:.bolt

image

To improve this, I recommend creating a set of high-quality project templates and storing them in the Git repository. Each template should include a name and description, and we could make them selectable through a configuration panel.

When a user starts a new project, the system could first engage an LLM, supplying it with the list of templates and their descriptions. The LLM could then output a structured response indicating the chosen template, or it could suggest starting with a blank template.

Once a template is chosen, the system would clone it into the web container and proceed with the usual setup process.

Without these templating features, achieving high-quality code output is challenging, and this project risks being viewed as a toy if it can't support serious development.

(P.S: this comment is refined with AI for better readability 😆 , here us the prompt I am writing this comment in a github issue, rewrite it for better readability )

I believe that with the use of agents (which is already on the project roadmap), this can be solved. An agent can be run to choose a suitable template from the predefined options and then other agents follow the process of generating the code.

thecodacus commented 3 days ago

Working on a PR #266 which will allow you to start from a code template

chrismahoney commented 2 days ago

^^ Keep an eye on the above PR regarding templates, thanks @thecodacus for the work and also reminding me about the .bolt directory!

thecodacus commented 4 hours ago

closed the previous PR, as @wonderwhy-er suggested it would be better to have text based approach for for tool calling. submitted #302 with that solution in mind