Skip to content

Welcome to bolt diy

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.

Table of Contents


Join the community!

Join the community!


Features

  • AI-powered full-stack web development directly in your browser.
  • Support for multiple LLMs with an extensible architecture to integrate additional models.
  • Attach images to prompts for better contextual understanding.
  • Integrated terminal to view output of LLM-run commands.
  • Revert code to earlier versions for easier debugging and quicker changes.
  • Download projects as ZIP for easy portability.
  • Integration-ready Docker support for a hassle-free setup.

Setup

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.

Prerequisites

  1. Install Git: Download Git
  2. Install Node.js: Download Node.js

  3. After installation, the Node.js path is usually added to your system automatically. To verify:

    • Windows: Search for "Edit the system environment variables," click "Environment Variables," and check if Node.js is in the Path variable.
    • Mac/Linux: Open a terminal and run:
      echo $PATH  
      
      Look for /usr/local/bin in the output.

Clone the Repository

Alternatively, you can download the latest version of the project directly from the Releases Page. Simply download the .zip file, extract it, and proceed with the setup instructions below. If you are comfertiable using git then run the command below.

Clone the repository using Git:

git clone -b stable https://github.com/stackblitz-labs/bolt.diy  

Entering API Keys

There are two ways to configure your API keys in bolt.diy:

1. Set API Keys in the .env.local File

When setting up the application, you will need to add your API keys for the LLMs you wish to use. You can do this by renaming the .env.example file to .env.local and adding your API keys there.

  • On Mac, you can find the file at [your name]/bolt.diy/.env.example.
  • On Windows/Linux, the path will be similar.

If you can't see the file, it's likely because hidden files are not being shown. On Mac, open a Terminal window and enter the following command to show hidden files:

defaults write com.apple.finder AppleShowAllFiles YES

Make sure to add your API keys for each provider you want to use, for example:

GROQ_API_KEY=XXX
OPENAI_API_KEY=XXX
ANTHROPIC_API_KEY=XXX

Once you've set your keys, you can proceed with running the app. You will set these keys up during the initial setup, and you can revisit and update them later after the app is running.

Note: Never commit your .env.local file to version control. It’s already included in the .gitignore.

2. Configure API Keys Directly in the Application

Alternatively, you can configure your API keys directly in the application once it's running. To do this:

  1. Launch the application and navigate to the provider selection dropdown.
  2. Select the provider you wish to configure.
  3. Click the pencil icon next to the selected provider.
  4. Enter your API key in the provided field.

This method allows you to easily add or update your keys without needing to modify files directly.

Once you've configured your keys, the application will be ready to use the selected LLMs.


Run the Application

Option 1: Without Docker

  1. Install Dependencies:

    pnpm install  
    
    If pnpm is not installed, install it using:
    sudo npm install -g pnpm  
    

  2. Start the Application:

    pnpm run dev  
    
    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.

Option 2: With Docker

Prerequisites

Steps

  1. Build the Docker Image:

Use the provided NPM scripts:

npm run dockerbuild 

Alternatively, use Docker commands directly:

docker build . --target bolt-ai-development

  1. Run the Container:
    Use Docker Compose profiles to manage environments:

    docker-compose --profile development up 
    

  2. With the development profile, changes to your code will automatically reflect in the running container (hot reloading).


Update Your Local Version to the Latest

To keep your local version of bolt.diy up to date with the latest changes, follow these steps for your operating system:

1. Navigate to your project folder

Navigate to the directory where you cloned the repository and open a terminal:

2. Fetch the Latest Changes

Use Git to pull the latest changes from the main repository:

git pull origin main

3. Update Dependencies

After pulling the latest changes, update the project dependencies by running the following command:

pnpm install

4. Rebuild and Start the Application

  • If using Docker, ensure you rebuild the Docker image to avoid using a cached version:

    docker-compose --profile development up --build  
    

  • If not using Docker, you can start the application as usual with:

    pnpm run dev  
    

This ensures that you're running the latest version of bolt.diy and can take advantage of all the newest features and bug fixes.


Adding New LLMs:

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.

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!

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!


Available Scripts

  • pnpm run dev: Starts the development server.
  • pnpm run build: Builds the project.
  • pnpm run start: Runs the built application locally using Wrangler Pages. This script uses bindings.sh to set up necessary bindings so you don't have to duplicate environment variables.
  • pnpm run preview: Builds the project and then starts it locally, useful for testing the production build. Note, HTTP streaming currently doesn't work as expected with wrangler pages dev.
  • pnpm test: Runs the test suite using Vitest.
  • pnpm run typecheck: Runs TypeScript type checking.
  • pnpm run typegen: Generates TypeScript types using Wrangler.
  • pnpm run deploy: Builds the project and deploys it to Cloudflare Pages.

Development

To start the development server:

pnpm run dev

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.


Tips and Tricks

Here are some tips to get the most out of bolt.diy:

  • 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.

  • 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.

  • Scaffold the basics first, then add features: Make sure the basic structure of your application is in place before diving into more advanced functionality. This helps Bolt understand the foundation of your project and ensure everything is wired up right before building out more advanced functionality.

  • Batch simple instructions: Save time by combining simple instructions into one message. For example, you can ask Bolt 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.