Validation for LLM prompts.
Project description
PyPrompt
LLM Prompt Validation and Manipulation
This project provides functionality for creating prompts for LLMs, including their validation and manipulation. This includes functionality for limiting the number of tokens used for LLM prompts and distributing these tokens among the parts of the LLM message.
Note that the tokenizer used here may not be exactly the same as the one used by the LLM, so the actual number of tokens used may be greater than or less than this module estimates. If using more tokens the the context window is problematic, you can add a margin to this module's estimate by simply passing in a smaller number of tokens than the context window.
Dependencies
The required packages can be installed by running poetry install
. This depends on poetry
being installed locally; instructions can be found here.
Usage
For direction on how to use this module, please see function example
in pyprompt/prompt_validation.py
and read the appropriate docstrings as necessary.
Tests
The test suite can be run using poetry run pytest
.
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
File details
Details for the file pyprompt-0.1.0.tar.gz
.
File metadata
- Download URL: pyprompt-0.1.0.tar.gz
- Upload date:
- Size: 9.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.10.13 Linux/6.7.4-200.fc39.x86_64
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a025c72eca700a3629ab4e6424ab42354a2bd7480ce7eec7b0dfd6225a8de00 |
|
MD5 | a464618ff383705d5ef6f26107d91d81 |
|
BLAKE2b-256 | b2014978a743ed7a41e144efa9563a950559d31bf062b5b3561c78e50e86cf1a |
File details
Details for the file pyprompt-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: pyprompt-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.10.13 Linux/6.7.4-200.fc39.x86_64
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6dc79d4051b240a07241e44dd8ca80dbf0b4d5214667b66028d7003a74bf706 |
|
MD5 | 9ec38ac7715e8aa0a9dff4fa7fb80702 |
|
BLAKE2b-256 | 61af4db2eb725e099590d34026a0ec1b6aed890b5e4e39f17001622f499f19b8 |