Load LLM templates from Fabric
Install this plugin in the same environment as LLM.
llm install llm-templates-fabric
This plugin adds a template loader with the fabric:
prefix that loads templates from the Fabric repository.
In this example, we use the summarize pattern for the Wikipedia Application software page.
llm -t fabric:summarize -f https://en.wikipedia.org/wiki/Application_software
The plugin looks for templates in the Fabric repository's patterns/
directory. The command above will load from:
- System prompt: https://github.com/danielmiessler/fabric/blob/main/patterns/summarize/system.md
- User prompt: https://github.com/danielmiessler/fabric/blob/main/patterns/summarize/user.md
Both files are optional - if at least one of them exists, the template will load successfully.
To set up this plugin locally, first checkout the code. Then create a new virtual environment:
cd llm-templates-fabric
python -m venv venv
source venv/bin/activate
Now install the dependencies and test dependencies:
llm install -e '.[test]'
To run the tests:
python -m pytest