An llm plugin that provides a matched-responses model for testing - returns configurable responses based on input patterns
Project description
llm-matched-responses
An llm plugin that provides a matched-responses model for testing. Returns configurable responses based on input patterns, so you can test LLM-based systems without real API keys.
Installation
llm install llm-matched-responses
Usage
# Default: echoes back the input
llm -m matched-responses "Hello world"
# Output: Echo: Hello world
# Static response for all inputs (via env var)
LLM_MATCHED_RESPONSE="Fixed reply" llm -m matched-responses "anything"
# Output: Fixed reply
# Substring-matched responses from a JSON file
echo '{"hello": "Hi there!", "help": "I can help."}' > responses.json
LLM_MATCHED_RESPONSES_FILE=responses.json llm -m matched-responses "hello world"
# Output: Hi there!
Response resolution order
LLM_MATCHED_RESPONSEenv var: if set, always return this exact stringLLM_MATCHED_RESPONSES_FILEenv var: path to a JSON file mapping input substrings to responses. The first matching key wins.- Default: returns
"Echo: <input>"(or"Echo: (empty message)"for empty input)
Responses file format
{
"hello": "Hello! I am the test model.",
"help": "I am a test model that returns matched responses.",
"code": "Here is some code:\n```python\nprint('hello')\n```"
}
Keys are matched as substrings of the user's message. The first match wins.
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_matched_responses-0.0.3.tar.gz.
File metadata
- Download URL: llm_matched_responses-0.0.3.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b43f62f1d61ee7d0347e4bcc8ff07437a31732846879c591d267d313b88fdca4
|
|
| MD5 |
3991891be92d49c2410a3bca2c50553a
|
|
| BLAKE2b-256 |
bddeb191b5e92e3032bbd704970a4084d2a9b244c7503a91ca771a9b45637fbb
|
Provenance
The following attestation bundles were made for llm_matched_responses-0.0.3.tar.gz:
Publisher:
publish.yml on imbue-ai/llm-matched-responses
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llm_matched_responses-0.0.3.tar.gz -
Subject digest:
b43f62f1d61ee7d0347e4bcc8ff07437a31732846879c591d267d313b88fdca4 - Sigstore transparency entry: 1043019474
- Sigstore integration time:
-
Permalink:
imbue-ai/llm-matched-responses@db152b63236f219ee2ef545ba305256ad28f8326 -
Branch / Tag:
refs/tags/v0.0.3 - Owner: https://github.com/imbue-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@db152b63236f219ee2ef545ba305256ad28f8326 -
Trigger Event:
release
-
Statement type:
File details
Details for the file llm_matched_responses-0.0.3-py3-none-any.whl.
File metadata
- Download URL: llm_matched_responses-0.0.3-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f73712c38ef39e26382fc1eda1db212bc3cbf93af5911057a20d06ee4e1c82a
|
|
| MD5 |
c8ff622b4a6396283407cec3f4579999
|
|
| BLAKE2b-256 |
789ebaffde28a2515b5f44fd675bbf6bb08b482f0d7d04da533cebaa9cccc398
|
Provenance
The following attestation bundles were made for llm_matched_responses-0.0.3-py3-none-any.whl:
Publisher:
publish.yml on imbue-ai/llm-matched-responses
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llm_matched_responses-0.0.3-py3-none-any.whl -
Subject digest:
3f73712c38ef39e26382fc1eda1db212bc3cbf93af5911057a20d06ee4e1c82a - Sigstore transparency entry: 1043019556
- Sigstore integration time:
-
Permalink:
imbue-ai/llm-matched-responses@db152b63236f219ee2ef545ba305256ad28f8326 -
Branch / Tag:
refs/tags/v0.0.3 - Owner: https://github.com/imbue-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@db152b63236f219ee2ef545ba305256ad28f8326 -
Trigger Event:
release
-
Statement type: