Plomp Python Module
Project description
Plomp
A small python module for managing and debugging agent contexts.
Just plomp it in and 'prompt' away
Overview
Plomp is a tiny library designed to easily integrate into python programs which invoke an LLM over multiple steps and provide some useful benefits such as visualizing progress and making context retrival easier.
Plomp has three main goals:
- Provide simple observability into execution multistep LLM prompts ("agents" if you must)
- Track and manage context retrieval
- Integrate easily into existing code in an unopinionated way
Example Usage
For a richer example look at the example project which simulates the game surivivor at https://michaelgiba.github.io/survivor/static/plomp.html with the repo here https://github.com/michaelgiba/survivor
A simpler example below:
import plomp
@plomp.wrap_prompt_fn()
def prompt_llm(prompt: str) -> str:
return "<EXAMPLE LLM RESPONSE>"
llm_response = prompt_llm("What's the weather today?")
for i in range(4):
plomp.record_event(
{
"plomp_display_event_type": "weather_data_accessed",
"plomp_display_text": f"accessed weather data from API: {i + 1}/10",
"value": random.random(),
},
tags={"tool": "weather_api"},
)
past_weather_events = plomp.buffer().filter(tags_filter={"tool": ["weather_api"]}).last(3)
past_weather_events.record(tags={"type": "recent_weather_queries"})
llm_response = prompt_llm(
f"How has the temperature changed over the last three samples?: "
+ str(past_weather_events.to_dict())
)
plomp.write_html(plomp.buffer(), "progress.html")
This would produce a self-contained HTML page which looks like this:
Structure
Plomp revolves around a centralized buffer which stores three different types of sequential records:
- "Events": Discrete events which happened that could useful future context for decision making
- "Queries": An expression which matches previous events based on user provided logic
- "Prompts": A record of a prompt to an LLM and the response recieved
Installation
pip install plomp
For development:
pip install plomp[dev]
Contributions
All contributions are welcome. There are a number of things that need to be added:
- Concurrency support
- More frontend features
- Better API documentation
- Optional live progress reloading instead of only static HTML files for realtime playback
-
- anything else valuable
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file plomp-0.1.2.tar.gz.
File metadata
- Download URL: plomp-0.1.2.tar.gz
- Upload date:
- Size: 27.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b5d8034de0b062e3dfdab5099c61a84ff84dffe9785ccbff0d890f24454492cf
|
|
| MD5 |
0fb4e379947e67bb8ded029a5d9d9722
|
|
| BLAKE2b-256 |
545d4976b0d56947528314596ef970f275080cedb3820d31a7fbfffdd1d1cc78
|
File details
Details for the file plomp-0.1.2-py3-none-any.whl.
File metadata
- Download URL: plomp-0.1.2-py3-none-any.whl
- Upload date:
- Size: 24.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e344e9629820942da99a5b23850192e4bb4c1f5668ca990b689f745da9264fe5
|
|
| MD5 |
0e1ab8d420d7a48c05b8785630ae10e6
|
|
| BLAKE2b-256 |
7f6b78f0b2c0884e8c9d9ffa0348477645d52aff2a723e82847427b139a78030
|