Git-first prompt registry + CI evals + lightweight runtime SDK (ivault).
Project description
InstructVault (ivault)
Git‑first prompt hub for teams and individual developers.
InstructVault makes prompts first‑class, governed, testable, versioned artifacts — just like code — while keeping runtime fast and local.
What this does (at a glance)
- Prompts live in Git as YAML/JSON files
- CI validates + evaluates prompts on every change
- Releases are tags/SHAs, reproducible by design
- Runtime stays lightweight (local read or bundle artifact)
System flow (Mermaid)
flowchart LR
A[Prompt files<br/>YAML/JSON] --> B[PR Review]
B --> C[CI: validate + eval]
C --> D{Release?}
D -- tag/SHA --> E[Bundle artifact]
D -- tag/SHA --> F[Deploy app]
E --> F
F --> G[Runtime render<br/>local or bundle]
Why this exists
Enterprises already have Git + PR reviews + CI/CD. Prompts usually don’t. InstructVault brings prompt‑as‑code without requiring a server, database, or platform.
Vision
Short version: Git‑first prompts with CI governance and zero‑latency runtime.
Full vision: docs/vision.md
Features
- ✅ Git‑native versioning (tags/SHAs = releases)
- ✅ CLI‑first (
init,validate,render,eval,diff,resolve,bundle) - ✅ LLM‑framework agnostic (returns standard
{role, content}messages) - ✅ CI‑friendly reports (JSON + optional JUnit XML)
- ✅ No runtime latency tax (local read or bundle)
- ✅ Optional playground (separate package)
Install
Users
pip install instructvault
Contributors
git clone <your-repo>
cd instructvault
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
pytest
Quickstart (end‑to‑end)
1) Initialize a repo
ivault init
2) Create a prompt
prompts/support_reply.prompt.yml (YAML or JSON)
spec_version: "1.0"
name: support_reply
description: Respond to a support ticket with empathy and clear steps.
model_defaults:
temperature: 0.2
variables:
required: [ticket_text]
optional: [customer_name]
messages:
- role: system
content: |
You are a support engineer. Be concise, empathetic, and action-oriented.
- role: user
content: |
Customer: {{ customer_name | default("there") }}
Ticket:
{{ ticket_text }}
tests:
- name: must_contain_customer_and_ticket
vars:
ticket_text: "My order arrived damaged."
customer_name: "Alex"
assert:
contains_all: ["Customer:", "Ticket:"]
3) Validate + render locally
ivault validate prompts
ivault render prompts/support_reply.prompt.yml --vars '{"ticket_text":"My app crashed.","customer_name":"Sam"}'
Safety tip: add --safe to scan rendered output for common secret patterns.
Use --strict-vars to forbid unknown vars and --redact to mask detected secrets.
Use --policy /path/to/policy.py to enforce custom compliance rules.
4) Add dataset‑driven eval
datasets/support_cases.jsonl
{"vars":{"ticket_text":"Order arrived damaged","customer_name":"Alex"},"assert":{"contains_any":["Ticket:"]}}
{"vars":{"ticket_text":"Need refund"},"assert":{"contains_all":["Ticket:"]}}
ivault eval prompts/support_reply.prompt.yml --dataset datasets/support_cases.jsonl --report out/report.json --junit out/junit.xml
Note: Prompts must include at least one inline test. Datasets are optional.
Migration tip: if you need to render a prompt that doesn’t yet include tests, use
ivault render --allow-no-tests or add a minimal test first.
Spec migration check:
ivault migrate prompts
5) Version prompts with tags
git add prompts datasets
git commit -m "Add support prompts + eval dataset"
git tag prompts/v1.0.0
6) Load by Git ref at runtime
from instructvault import InstructVault
vault = InstructVault(repo_root=".")
msgs = vault.render(
"prompts/support_reply.prompt.yml",
vars={"ticket_text":"My order is delayed", "customer_name":"Ava"},
ref="prompts/v1.0.0",
)
7) Bundle prompts at build time (optional)
ivault bundle --prompts prompts --out out/ivault.bundle.json --ref prompts/v1.0.0
from instructvault import InstructVault
vault = InstructVault(bundle_path="out/ivault.bundle.json")
Notebooks
examples/notebooks/instructvault_colab.ipynbexamples/notebooks/instructvault_rag_colab.ipynbexamples/notebooks/instructvault_openai_colab.ipynb
Example Policies
examples/policies/policy_example.pyexamples/policies/policy_pack.py
How teams use this in production
- Prompt changes go through PRs
- CI runs
validate+eval - Tags or bundles become the deployable artifact
- Apps load by tag or bundle (no runtime network calls)
Datasets (why JSONL)
Datasets are deterministic eval inputs checked into Git. This makes CI reproducible and audit‑friendly.
For cloud datasets, use a CI pre‑step (e.g., download from S3) and then run ivault eval on the local file.
Playground (optional)
A minimal playground exists under playground/ for local or org‑hosted use.
It lists prompts, renders with variables, and runs evals — without touching production prompts directly.
For local dev, run from the repo root:
export IVAULT_REPO_ROOT=/path/to/your/repo
PYTHONPATH=. uvicorn ivault_playground.app:app --reload
Optional auth:
export IVAULT_PLAYGROUND_API_KEY=your-secret
Then send x-ivault-api-key in requests (or keep it behind your org gateway).
If you don’t set the env var, no auth is required.
Docs
docs/spec.mddocs/vision.mddocs/governance.mddocs/ci.mddocs/playground.mddocs/cookbooks.mddocs/audit_logging.mddocs/dropin_guide.mddocs/release_checklist.mddocs/ci_templates/gitlab-ci.ymldocs/ci_templates/JenkinsfileCHANGELOG.mdCODE_OF_CONDUCT.md
License
Apache‑2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file instructvault-0.2.9.tar.gz.
File metadata
- Download URL: instructvault-0.2.9.tar.gz
- Upload date:
- Size: 2.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f312ce7c59157e13cabe50d911fe49b66b10dc5d3c3a02244609d50daf587ad3
|
|
| MD5 |
0653aa7ce1637eb0fbdf87ff54b9a431
|
|
| BLAKE2b-256 |
cc5b87badf07c4236eef4263b463e9577892c526761d6b668414eb15d7bdfff2
|
File details
Details for the file instructvault-0.2.9-py3-none-any.whl.
File metadata
- Download URL: instructvault-0.2.9-py3-none-any.whl
- Upload date:
- Size: 15.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
976d7b93beb9f659123bdded0e7ed5f7fdd26abd55da5dbd0b738ab60dba89fb
|
|
| MD5 |
8aa6acccc6f1688a817e3f0eeb770a0e
|
|
| BLAKE2b-256 |
fc5e6a1e4a3ba73244bffb6acc26f287b8817f733b3925552de94e87363d3e51
|