Installation
How to install PromptEngine into your Rails Application
Getting Started with PromptEngine
This guide will help you get PromptEngine integrated into your Rails application quickly. You'll be managing AI prompts through a beautiful admin interface in just a few minutes.
Prerequisites
Before starting, ensure you have:
- Ruby 3.0 or higher
- Rails 7+ (currently PromptEngine has been tested with Rails 8+)
- API keys for OpenAI or Anthropic (for playground features)
Quick Setup
Add PromptEngine to your Gemfile
bundle add prompt_engine
gem 'prompt_engine'
You can also use prompt_engine
from the GitHub Source as the gem is in very active development.
gem "prompt_engine", git: "https://github.com/aviflombaum/prompt_engine.git"
Then run bundle install to install the gem:
bundle install
Install and run migrations
Install the migrations from the gem by running:
bin/rails prompt_engine:install:migrations
You will see the migrations copied to your db/migrations
.
Then run the migrations:
bin/rails db:migrate
This creates the necessary tables for prompts, versions, and parameters.
Mount the engine in your routes
Add this line to your config/routes.rb
:
Rails.application.routes.draw do
mount PromptEngine::Engine => "/prompt_engine"
# Your other routes...
end
This makes the admin interface available at /prompt_engine
in your application.
Configure API credentials
Currently, PromptEngine only needs your LLM provider's API key to run Test Runs of your Prompts in the Playground. You will be able to supply an API Key when you run a test or you can save your API Keys in the PromptEngine Setting Page where they will be stored and encrypted in the database.
In a future release, you will be able to piggyback off where you normally might store your LLM provider's keys, such as in your Rails Credentials files or your ENV
.
Keep your API keys secure! Never commit them to version control.
Read more about configuring your API Keys.
Start your Rails server
rails server
Visit http://localhost:3000/prompt_engine
to access the admin interface.

What's Next?
Now that PromptEngine is installed, you're ready to create your first prompt!