Check whether you've already run this prompt before calling the LLM
Project description
llm-cache
Check whether you've already run this prompt before calling the LLM
Installation
Install this plugin in the same environment as LLM.
llm install llm-cache-plugin
Usage
This plugin add a --cache flag to llm prompt.
If --cache is specified, the plugin will search your llm database for a previously-saved response for this prompt-system-model combination. If it is found, it returns that text, saving you time and money. If not, it passes off to the regular llm prompt command.
llm 'How many rs are in strawberry? Think very hard.'
> There are 2 'R's in strawberry
Took 3.01s user 1.45s system 104% cpu 4.280 total
llm --cache 'How many rs are in strawberry? Think very hard.'
> There are 2 'R's in strawberry
Took 2.83s user 1.50s system 152% cpu 2.836 total
Development
To set up this plugin locally, first checkout the code. Then create a new virtual environment:
cd llm-cache
python -m venv venv
source venv/bin/activate
Now install the dependencies and test dependencies:
llm install -e '.[test]'
To run the tests:
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
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 llm_cache_plugin-0.1.tar.gz.
File metadata
- Download URL: llm_cache_plugin-0.1.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6869ca12bd54ceb5016b9385faee41c775092039dcace8d2ae00fe88414b4996
|
|
| MD5 |
f0ffe129eb3f6d64f8e56b44bc420870
|
|
| BLAKE2b-256 |
1534169dbde5251933f896f3ce84d7346b3f6320e56d2c389209f675d05af5b4
|
Provenance
The following attestation bundles were made for llm_cache_plugin-0.1.tar.gz:
Publisher:
publish.yml on kevinschaul/llm-cache-plugin
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llm_cache_plugin-0.1.tar.gz -
Subject digest:
6869ca12bd54ceb5016b9385faee41c775092039dcace8d2ae00fe88414b4996 - Sigstore transparency entry: 204388660
- Sigstore integration time:
-
Permalink:
kevinschaul/llm-cache-plugin@cc58b7cd59ac10385619fc61a82eb30c89bcb990 -
Branch / Tag:
refs/tags/v0.1 - Owner: https://github.com/kevinschaul
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cc58b7cd59ac10385619fc61a82eb30c89bcb990 -
Trigger Event:
release
-
Statement type:
File details
Details for the file llm_cache_plugin-0.1-py3-none-any.whl.
File metadata
- Download URL: llm_cache_plugin-0.1-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
71ce46667d100cdd1d3103141bd59f06fcdb6745ca66003087b211f595af357b
|
|
| MD5 |
fc2f506d7f19532d25cb3109c39c8287
|
|
| BLAKE2b-256 |
2c96ac8ef9aa2445b92c7e4a81b288438c80b9966cc87bb2c811045a2872db11
|
Provenance
The following attestation bundles were made for llm_cache_plugin-0.1-py3-none-any.whl:
Publisher:
publish.yml on kevinschaul/llm-cache-plugin
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llm_cache_plugin-0.1-py3-none-any.whl -
Subject digest:
71ce46667d100cdd1d3103141bd59f06fcdb6745ca66003087b211f595af357b - Sigstore transparency entry: 204388661
- Sigstore integration time:
-
Permalink:
kevinschaul/llm-cache-plugin@cc58b7cd59ac10385619fc61a82eb30c89bcb990 -
Branch / Tag:
refs/tags/v0.1 - Owner: https://github.com/kevinschaul
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cc58b7cd59ac10385619fc61a82eb30c89bcb990 -
Trigger Event:
release
-
Statement type: