Skip to main content

Git for prompts - Manage LLM prompts with version control

Project description

Grompt - Git for Prompts

PyPI version License: MIT Tests Coverage Python Versions

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


License

MIT

Project details


Download files

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

Source Distribution

grompt-0.2.1.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

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

grompt-0.2.1-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

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

Hashes for grompt-0.2.1.tar.gz
Algorithm Hash digest
SHA256 ea1e6133cad55617231e3002e8c35d4a9ec4ed40691adc17784f135761907f87
MD5 b7b2fb27ad61fd37a3df13bede772499
BLAKE2b-256 3a435abca5fbd17b6210a894d997d388336df376057ca70d1811d7eef2f306bd

See more details on using hashes here.

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

Hashes for grompt-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 55186aee80a06ad1d0238a4c62a0c1437bab5ab3cdc39ac38513c0b2fb5af392
MD5 b56d50b0ed833586fae3962d7f08101e
BLAKE2b-256 6c04c8dbd617f559d6a505f96a0abe49cfc219713eadd1b8402b1af35b9872aa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page