Folio is a versatile CLI and Python library designed for efficient prompt management. With versioning capabilities and Jinja2 templating support, it allows you to create, update, and retrieve prompt templates with ease. Keep your prompts organized and dynamic, and integrate seamlessly with any LLM of your choice, all while enjoying a simple command line experience.
Folio is a user-friendly Command Line Interface (CLI) and Python library designed for efficient prompt management and storage, complete with versioning capabilities. This powerful tool enables you to create, organize, and maintain prompt templates effortlessly, utilizing the versatile Jinja2 templating engine for dynamic prompt rendering. With Folio, you can manage prompt versions, making it ideal for anyone looking to streamline their workflow and enhance productivity in working with language models.
Key Features
- Prompt Versioning: Folio automatically keeps track of your prompts, managing version increments upon modifications. This feature ensures that you have a comprehensive history of all your prompts readily available.
- LLM Agnostic: Folio is designed for flexibility. It does not interact directly with any language model, allowing you to use it with any LLM of your choice without limitations.
- Jinja2 Templating: Create highly customizable prompts using Jinja2 syntax. This feature allows you to incorporate variables into your prompts, facilitating dynamic text generation. By utilizing templates, you can reduce redundancy and keep your prompts well-organized.
- CLI and Python API Support: Whether you prefer managing prompts via the command line or programmatically through Python, Folio supports both, giving you the freedom to choose how you want to use it.
Example Usage
CLI Commands
Initialize a Folio project:
folio init
Add a prompt using a file:
folio add <prompt_name> --file path/to/prompt.txt
Or by piping standard input:
echo "Write a haiku about {{ topic }}" | folio add <prompt_name>
List all prompts with their respective versions:
folio list-prompts
Python API Example
You can also use Folio programmatically:
- Initialize Folio:
from folio import Folio folio = Folio.init()
- Add a new prompt:
prompt_text = "Write a haiku about {{ topic }}" folio.add_prompt("song", prompt_text)
- Retrieve and render a prompt:
rendered_prompt = folio.get_prompt("song", render={"topic" : "Generative AI"}) print(rendered_prompt.text)
Prompt Inheritance
Folio also supports Jinja2-based prompt inheritance, allowing for the creation of templates that can extend other templates. This feature streamlines prompt creation and makes it easier to maintain a cohesive structure across multiple prompts.
Folio is your essential tool for effective prompt management, enabling you to elevate your workflow with sophisticated templating and seamless version tracking. Harness the power of Folio today!