A Hono app that exposes a REST API for Git-like version control of AI prompts, with eval-gated staging-to-production promotion, A/B traffic splitting, metrics ingestion, and webhook subscriptions, backed by Prisma and PostgreSQL.
Status: Pre-1.0 — APIs may change in minor versions. Pin to a specific version in production.
Prompt Version Control API server providing Git-like versioning for AI prompts with eval-gated promotion, A/B deployment, metrics collection, and webhook integrations. Built on Hono 4 with Prisma and PostgreSQL.
Prompt CRUD — create, read, update, and archive prompts with automatic version numbering
Version management — store and track prompt versions with SHA-256 checksums for deduplication
Tag-based lifecycle — resolve versions by draft, staging, and production tags
Evaluation gates — block staging→production promotion on eval harness results
A/B deployments — serve multiple versions with weighted traffic splitting and sticky sessions
Semantic diffing — compare versions with line-level diffs and semantic impact scoring
Metrics ingestion — track per-version cost, latency, and quality metrics
Promotion workflows — promote/rollback production with audit trails
Webhook subscriptions — notify external systems on version creation, tag changes, and evaluations
Structured logging — Pino-based JSON logging with automatic pretty-printing in development
Prometheus metrics — built-in /metrics endpoint for monitoring
API key auth — scoped API keys with HMAC verification and audit logging
Swagger UI — OpenAPI 3.0 spec served at /api/v1/docs
Quick Start
Development
terminal
# Set up environmentcp .env.example .env# Install dependenciespnpm install# Generate Prisma clientpnpm --filter @reaatech/prompt-version-control-server db:generate# Run migrationspnpm --filter @reaatech/prompt-version-control-server db:migrate# Seed the databasepnpm --filter @reaatech/prompt-version-control-server db:seed# Start development server with hot reloadpnpm --filter @reaatech/prompt-version-control-server dev
Programmatic
typescript
import { app } from "@reaatech/prompt-version-control-server";import { serve } from "@hono/node-server";serve({ fetch: app.fetch, port: 3000 }, (info) => { console.log(`Server running on http://localhost:${info.port}`);});
API Reference
Infrastructure Endpoints
Method
Path
Description
GET
/health
Health check — returns { status: "ok", timestamp }
GET
/ready
Readiness check — returns { status: "ready" }
GET
/metrics
Prometheus text-format metrics
GET
/api/v1/docs
Swagger UI
GET
/api/v1/docs/openapi.yaml
Raw OpenAPI 3.0 spec
All API routes are prefixed with /api/v1 and require Authorization: Bearer <api-key> unless noted.
Prompts
Method
Path
Description
GET
/api/v1/prompts
List prompts (paginated: ?limit=20&cursor=...)
POST
/api/v1/prompts
Create prompt
GET
/api/v1/prompts/:id
Get prompt by ID
PUT
/api/v1/prompts/:id
Update prompt
DELETE
/api/v1/prompts/:id
Archive prompt
GET
/api/v1/prompts/:id/versions
List versions for prompt (paginated)
POST
/api/v1/prompts/:id/versions
Create version (auto-increments number)
GET
/api/v1/prompts/:id/versions/:vid
Get specific version
GET
/api/v1/prompts/:id/production
Get production-tagged version
GET
/api/v1/prompts/:id/diff
Diff two versions (?fromVersion=X&toVersion=Y)
Tags
Method
Path
Description
GET
/api/v1/prompts/:id/tags
List tags for prompt
POST
/api/v1/prompts/:id/tags/:name
Set tag to a version ({ versionId } in body)
GET
/api/v1/prompts/:id/tags/:name
Get tag details
DELETE
/api/v1/prompts/:id/tags/:name
Remove tag
Tag names: draft, staging, production. Only one version can hold a given tag at a time.
Promotions
Method
Path
Description
POST
/api/v1/prompts/:id/promote
Promote staging → production (gated by eval)
POST
/api/v1/prompts/:id/promote/override
Force-promote a specific version ({ versionId } in body)
POST
/api/v1/prompts/:id/rollback
Rollback production to previous version
The promote endpoint checks the evaluation gate: if the staging version has failed evaluations, the promotion is blocked.