Skip to content

Blueprints is an open-source tool that integrates with your text editor to help you generate code with an LLM based on patterns you already have in your codebase. Download one of our official editor plugins to get started.

License

Notifications You must be signed in to change notification settings

sublayerapp/blueprints

Repository files navigation

Blueprints by Sublayer

This Ruby on Rails app enables you to store chunks of your code we call "blueprints" and then use them as a basis for generating new code using those previously saved blueprints as a base for GPT4 to generate from.

Blog post sharing some background info: Is Software Engineering Dead?

Demo video showing Blueprints usage in VSCode

Installation

OpenAI Configuration

Google Configuration

  • Get a Gemini API key: https://ai.google.dev/

  • Set the API key in your environment as: GEMINI_API_KEY

  • Set config.ai_provider to google in config/application.rb

  • Install Postgres (if not installed): brew install postgres

  • Install pgvector (if on postgres14): brew install pgvector

  • Install one of the editor plugins:

  • Clone the repo: git clone https://github.com/sublayerapp/blueprints
  • Change to the blueprints directory: cd blueprints
  • Install dependencies: bundle install
  • Create your database: bin/rails db:create
  • Run migrations: bin/rails db:migrate
  • Generate the tailwind css: bin/rails tailwindcss:build
  • Run the server: bin/rails s

Usage

With a server running on http://localhost:3000 you can use any of the above plugins to start storing blueprints locally and generating new ones.

Once you have a handful of blueprints you can view them and their associated descriptions at http://localhost:3000

LLM Performance specs

  1. go to spec_perforamnce/llms/ai_models.yml to specify which llms you'd like to test
  2. run rspec spec_performance

You must have the appropriate llm setup. See sublayer for setup instructions.

How It Works

Create A New Blueprint

When you use the editor plugin to POST your highlighted code to blueprints#create it first sends the code to gpt4 to generate a description and a name.

Once it has a description and a name, it creates vector embeddings of that description and stores the whole record in the database for future lookup.

Create A Blueprint Variant

When you use the editor plugin to POST your highlighted description to blueprint_variants#create it uses the description to find the closest blueprint.

Once the closest blueprint is found, it sends that blueprint's description, associated code, and the new description to gpt4 for generation and replaces the highlighted text in your editor with the generated code.

Community

Like what you see, or looking for more people working on the future of programming with LLMs?

Come join us in the Sublayer Discord

About

Blueprints is an open-source tool that integrates with your text editor to help you generate code with an LLM based on patterns you already have in your codebase. Download one of our official editor plugins to get started.

Resources

License

Stars

Watchers

Forks

Packages

No packages published