Skip to main content

LLM Few Shot Gen

PyPI - Version PyPI - Python Version


Installation

pip install llm-few-shot-gen

What is LLM Few Shot Generator?

Large language models (LLMs) are emerging as a transformative technology, enabling developers to build applications that they previously could not. However, fine-tune them is not always possible or too expansive. In-context learning like Few Shot learning tries to solve this problem. Based on a few number of examples within the prompt a specific output can be obtained. This llm-few-shot-gen library enables few shot learning in a convenient way.

How can I use it?

The core functionality is the generators module. The class PromptEngineeringGenerator defines all requirements for a LLM to generate text based on prompt engineering techniques. If you want your output to be parsed into an pydantic dataclass checkout the class ParsablePromptEngineeringGenerator.

How to customise the class for my own use case?

The class PromptEngineeringGenerator contains two core parts 1. LLM 2. prompt engineering dataclass. If you want to initialise the generator class for you custom use case, you need to define a prompt engineering JSON file matching the format of llm_few_shot_gen.models.prompt_engineering.PromptElements.

The JSON file can contain the following prompt elements in any combination tailored to your use case:

Role: The role in which the LLM should respond

Instruction: The task of the LLM

Context: Context with relevant information to solve the task

Output Format: Description how the LLM output format should look like

Few Shot Examples: Few shot examples with optional introduction

Input: Target which the LLM should execute the task on. Could be for example a user question, or a text block to summarize.

Showcases

License

llm-few-shot-gen is distributed under the terms of the MIT license.

Metadata

Release files for llm-few-shot-gen 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for llm-few-shot-gen 0.1.2
File Size Uploaded Provenance
llm_few_shot_gen-0.1.2.tar.gz 14.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for llm-few-shot-gen 0.1.2
File Interpreter ABI Platform
llm_few_shot_gen-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 21.7 kB

Release files / llm_few_shot_gen-0.1.2.tar.gz

Download URL llm_few_shot_gen-0.1.2.tar.gz
Size 14.3 kB
Tags Source
SHA-256 checksum
How to use checksums
a2aa4d1c8e500ae64efeb14d883eb802340393d8556a60dc7beddb2daa6335b4
BLAKE2b-256 checksum
How to use checksums
f608415a506c47b95c0343f07e6efd8147f7b615884f2ba7bce780c4441a2b25
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.24.1

Release files / llm_few_shot_gen-0.1.2-py3-none-any.whl

Download URL llm_few_shot_gen-0.1.2-py3-none-any.whl
Size 7.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d503c4aa2517af00a0432f72d2ac6487e65b8ff1e840ab0c23935bf78576d0ce
BLAKE2b-256 checksum
How to use checksums
83766d4cccac2b375557cc76c8a8db3ca09fb1a020c2bf76f34d14dd7119dcc8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.24.1

Security for llm-few-shot-gen 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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