arjunattam / prompt-learner

Never write a prompt from scratch again

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Prompt Learner

Documentation Discord

What is Prompt Learner?

A Modular Approach To Prompting

Prompt Learner is designed to make prompts modular.
This enables easy tuning, quick experimentation, and frictionless maintenance.
A prompt is composed of distinct modules where each module can be optimized & modified both on its own, and as a part of the complete system. Some modules are -

  1. The task type
  2. The task description
  3. A few examples
  4. Custom Prompt Technique specific Instructions
  5. Instructions for output format

See the documentation on "Why Prompt Learner?" to learn more.

Getting started

Watch our quick start guide

You can pip install Prompt Learner:

pip install prompt-learner

Tip

See the getting started tutorial for a detailed example of Prompt Learner in action.

How it works

Architecture Prompt-learner runs on the above architecture. Starting from the left, the user has to decide on 3 aspects -

  1. The Task
  2. A set of Examples
  3. An LLM Adapter

A task and examples feed into the template of choice (Claude, Open AI..). The task and examples also interact with selectors which can pick the best n examples for the task using statistical and machine learning techniques. These selected examples slot into the template, along with any custom instructions from any prompting technique( such as adding 'think step by step' for chain of thought prompting) comprise the final prompt. The prompt invokes the LLM through the adapter with any given inference sample to produce the final output.

About

Never write a prompt from scratch again


Languages

Language:Python 100.0%