Skip to main content
InstructVault logo

InstructVault (ivault)

PyPI version Python versions CI Release Downloads License Types

Version prompts in Git, test them in CI, load them locally at runtime.

Prompts live as YAML/JSON files. Changes go through PRs and CI, releases are pinned by tag or SHA, and your app renders them from a local checkout or a bundle artifact — no hosted registry in the request path.

Quickstart

pip install instructvault
ivault init                                              # scaffold prompts/, datasets/, CI workflow
ivault validate prompts                                  # check every prompt spec
ivault render prompts/hello_world.prompt.yml --vars '{"name":"Ava"}'

A prompt looks like this

# prompts/support_reply.prompt.yml
spec_version: "1.0"
name: support_reply
modelParameters:
  model: gpt-4o
  temperature: 0.3
variables:
  required: [ticket_text]
  optional: [customer_name]
messages:
  - role: system
    content: "You are a concise, empathetic support engineer."
  - role: user
    content: |
      Customer: {{ customer_name | default("there") }}
      Ticket: {{ ticket_text }}
tests:                       # at least one test is required
  - name: includes_ticket
    vars: { ticket_text: "My order arrived damaged." }
    assert: { contains_all: ["Ticket:"] }

Use it in your app

render() returns a list of {role, content} messages that also carries the spec's model config, so it drops straight into any client:

from openai import OpenAI
from instructvault import InstructVault

client = OpenAI()
vault = InstructVault(repo_root=".")               # or bundle_path="out/ivault.bundle.json"

result = vault.render(
    "prompts/support_reply.prompt.yml",
    vars={"ticket_text": "My order is delayed", "customer_name": "Ava"},
    ref="prompts/v1.0.0",                          # pin to a tag/SHA (omit for working tree)
)

response = client.chat.completions.create(**result.to_openai())

result is a plain list, so for m in result: m.content still works. Adapters: .to_openai(), .to_anthropic(), .to_litellm(), .to_dict().

CLI

Command Purpose
ivault init Scaffold prompts/, datasets/, and a CI workflow
ivault validate <path> Validate prompt specs (add --policy for custom rules)
ivault lint <path> --fail-under warning Quality gate: report prompt smells (secrets, missing docs), score, and gate CI
ivault render <prompt> --vars '{...}' Render messages locally
ivault eval <prompt> --report out/report.json --junit out/junit.xml Run tests/datasets, emit reports
ivault diff <prompt> --ref1 <a> --ref2 <b> Diff a prompt across two refs
ivault bundle --prompts prompts --out out/ivault.bundle.json --ref <tag> Build a deployable bundle
ivault lock --prompts prompts --out ivault.lock.json Write a content-addressed lockfile
ivault verify ivault.lock.json Fail if prompts drift from the lockfile
ivault schema --out schemas/prompt.schema.json Emit the prompt JSON Schema
ivault resolve <ref> / ivault migrate prompts Resolve a ref to a SHA / migrate specs

By default eval asserts against the rendered prompt — fully deterministic, no network. Add --provider openai to instead call a model and assert on its reply (needs OPENAI_API_KEY). Network is strictly opt-in, so CI stays deterministic unless you ask for a provider.

Where it fits

Approach Versioned in Git CI-friendly Local runtime Hosted dependency
Prompt strings in app code Partial Partial Yes No
Prompts in a database / admin UI Usually not Usually not No Usually yes
Hosted prompt registry/platform Varies Varies Usually no Yes
InstructVault Yes Yes Yes No
flowchart LR
  A[Prompt files] --> B[PR review] --> C[CI validate + eval] --> D[Tag, SHA, or bundle] --> E[App runtime]

Develop locally

git clone https://github.com/05satyam/instruct_vault.git
cd instruct_vault
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
python -m pytest

Docs & examples

License

Apache-2.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

instructvault-0.7.0.tar.gz (2.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

instructvault-0.7.0-py3-none-any.whl (27.7 kB view details)

Uploaded Python 3

File details

Details for the file instructvault-0.7.0.tar.gz.

File metadata

  • Download URL: instructvault-0.7.0.tar.gz
  • Upload date:
  • Size: 2.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for instructvault-0.7.0.tar.gz
Algorithm Hash digest
SHA256 dff0ea81220095aab525bdf64a7954ba1ed7d836adf828baf4ffa1985548cc6a
MD5 abb613dca2bf40eb780d56ba8b3bd804
BLAKE2b-256 e0d0de550a960f4ad863b43ac415166e5da56eb063bda39f83df757cd17039e2

See more details on using hashes here.

File details

Details for the file instructvault-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: instructvault-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 27.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for instructvault-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9e0428750c95f86ff3fad8ce41f9142673a60382c509b2a728d2d0767072439c
MD5 14ca0fbbe9c922d8089bcc22ae15a812
BLAKE2b-256 51511b5fc22e929ea68c2fcc86e9d2f895f429e49b4b5dc28494b27d6429af6b

See more details on using hashes here.

Release history Release notifications | RSS feed

0.7.1

2 files

This release

0.7.0 This release

2 files

0.6.1

2 files

0.6.0

2 files

0.5.0

2 files

0.4.0

2 files

0.3.1

2 files

0.3.0

2 files

0.2.9

2 files

0.2.8

2 files

0.2.7

2 files

0.2.6

2 files

0.2.5

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page