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
Metadata
Release files for llm-cache-plugin 0.1
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 | |
|---|---|---|---|---|
| llm_cache_plugin-0.1.tar.gz | 7.0 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| llm_cache_plugin-0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.4 kB
Release files / llm_cache_plugin-0.1.tar.gz
| Download URL | llm_cache_plugin-0.1.tar.gz |
|---|---|
| Size | 7.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6869ca12bd54ceb5016b9385faee41c775092039dcace8d2ae00fe88414b4996
|
|
BLAKE2b-256 checksum How to use checksums |
1534169dbde5251933f896f3ce84d7346b3f6320e56d2c389209f675d05af5b4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 29, 2025.
Transparency logRelease files / llm_cache_plugin-0.1-py3-none-any.whl
| Download URL | llm_cache_plugin-0.1-py3-none-any.whl |
|---|---|
| Size | 7.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
71ce46667d100cdd1d3103141bd59f06fcdb6745ca66003087b211f595af357b
|
|
BLAKE2b-256 checksum How to use checksums |
2c96ac8ef9aa2445b92c7e4a81b288438c80b9966cc87bb2c811045a2872db11
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 29, 2025.
Transparency logSecurity for llm-cache-plugin 0.1
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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for llm_cache_plugin-0.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 29, 2025.
Transparency logA 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.