Large Language Model Programming (LLMP)
LLMP provides a high-level abstraction for creating, storing, and optimizing generative NLP tasks. It leverages the power of large language models, enabling users to seamlessly integrate them into their software projects without the hassle of manually crafting and optimizing prompts.
Key Features
- Job Creation: Define jobs using input and output object structures.
- Auto-Optimization: LLMP automatically optimizes prompts to achieve desired outputs.
- Metrics Collection: Evaluate the performance of prompts in terms of accuracy, efficiency, and cost.
- Storage Management: Jobs are organized and stored systematically for easy retrieval and management.
Documentation and Examples
For detailed documentation and examples, please refer to the:
- Full documentation: project documentation.
- API Reference: API reference.
Quick Start
Installation
pip install pyllmp
Creating a Job
from pydantic import BaseModel
from typing import Literal
from llmp.services.program import Program
class InputObject(BaseModel):
book_title: str
book_author: str
release_year: int
class OutputObject(BaseModel):
genre: Literal["fiction", "non-fiction", "fantasy", "sci-fi", "romance", "thriller", "horror", "other"]
# Initialize a job
program = Program("Book to Genre", input_model=InputObject, output_model=OutputObject)
Loading a Job
program = Program("Book to Genre")
Running a Job
After creating or loading a job, you can easily execute it with input data to get the desired output.
input_data = {
"book_title": "The Lord of the Rings",
"book_author": "J. R. R. Tolkien",
"release_year": 1954
}
result = program(input_data=input_data)
print(result)
Output:
{
"genre": "fantasy"
}
Monitoring a Job
To monitor existing jobs, you can use the streamlit command-line tool to run the monitoring application. Navigate to the libs/llmp-monitor directory and run the following command:
streamlit run app.py
Here you can past your local job directory path to monitor, update and optimize jobs located in that directory.
Once you have run the command and entered the path, you can access the monitoring application at http://localhost:8501.
You should see a screen similar to the following:
Architecture
LLMP follows a component-based architecture with service layers, ensuring modularity and scalability. For detailed insights into the architecture, refer to the project documentation.
Contribute
LLMP is an open-source project. Contributions, feedback, and suggestions are welcome! Please check out the CONTRIBUTING.md guide for more details.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Metadata
Release files for pyllmp 0.0.14
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| pyllmp-0.0.14.tar.gz | 137.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyllmp-0.0.14-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 241.5 kB
Release files / pyllmp-0.0.14.tar.gz
| Download URL | pyllmp-0.0.14.tar.gz |
|---|---|
| Size | 137.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6d272f9ce46a81426a9eeb3e7fc39d74160906b97c71b48b642ffc90adc36872
|
|
BLAKE2b-256 checksum How to use checksums |
cc7fad352f15b08ebd4db760bb085e0055caf41b1448b1f8cf34caa4ed5b8a8c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.0
|
Release files / pyllmp-0.0.14-py3-none-any.whl
| Download URL | pyllmp-0.0.14-py3-none-any.whl |
|---|---|
| Size | 104.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
befc59667ca52b4948c817a527916df3930e93e8d6fbded49ced07cde9507e07
|
|
BLAKE2b-256 checksum How to use checksums |
a1923a0d4136ddc9a4a6149e23f567899f705865b044bf5cec6d7bc7b226e404
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.0
|
Security for pyllmp 0.0.14
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.