Git for prompts - Manage LLM prompts with version control
Project description
Grompt - Git for Prompts
Version, test, and manage LLM prompts separately from code.
Grompt lets you store prompts as YAML files, version them with git, test them with real data, and use them in your code by ID. Change prompts without deploying code.
Why Grompt?
Problem: Prompts buried in code are hard to version, test, and optimize. Solution: Prompts as files, referenced by ID.
Benefits:
- ✅ Change prompts without touching code
- ✅ Version prompts with git
- ✅ Test prompts with real data
- ✅ Track which version is in production
Installation
Install Grompt via pip:
pip install grompt
For development installation:
pip install -e ".[dev]"
Quick Start
1. Initialize Grompt
Initialize Grompt in your project root. This creates a .grompt config file and a prompts directory.
grompt init
2. Create a Prompt
Create a new prompt named code-review.
grompt add code-review --template "Review this code:\n{{ code }}"
This creates prompts/code-review.yaml.
3. Test it with Data
Run the prompt with sample data to verify the output.
grompt test code-review --var code="def hello(): pass"
4. Use in Python
Load and use the prompt in your application.
import grompt
# Load the prompt
prompt = grompt.load("code-review")
# Render with variables
rendered = prompt.render(
code="def add(a,b): return a+b"
)
print(rendered)
Documentation
- Defining Prompts - Learn how to create prompts with variables, system messages, and more.
- Using Prompts - How to use prompts in your CLI and Python code.
- Testing Prompts - Creating test cases and running tests.
- Variable Validation - Ensuring inputs match expected schemas.
- CLI Reference - Complete command-line interface documentation.
- Python API - API reference for integrating Grompt.
- Configuration - Global configuration options.
- Best Practices - Tips for managing prompts effectively.
- Examples - Real-world usage examples.
License
MIT
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 grompt-0.2.1.tar.gz.
File metadata
- Download URL: grompt-0.2.1.tar.gz
- Upload date:
- Size: 11.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ea1e6133cad55617231e3002e8c35d4a9ec4ed40691adc17784f135761907f87
|
|
| MD5 |
b7b2fb27ad61fd37a3df13bede772499
|
|
| BLAKE2b-256 |
3a435abca5fbd17b6210a894d997d388336df376057ca70d1811d7eef2f306bd
|
File details
Details for the file grompt-0.2.1-py3-none-any.whl.
File metadata
- Download URL: grompt-0.2.1-py3-none-any.whl
- Upload date:
- Size: 14.7 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 |
55186aee80a06ad1d0238a4c62a0c1437bab5ab3cdc39ac38513c0b2fb5af392
|
|
| MD5 |
b56d50b0ed833586fae3962d7f08101e
|
|
| BLAKE2b-256 |
6c04c8dbd617f559d6a505f96a0abe49cfc219713eadd1b8402b1af35b9872aa
|