Load LLM templates from the local filesystem
Install this plugin in the same environment as LLM.
llm install llm-filesystem
To use a template from the local filesystem:
llm -t file:/path/to/template.yaml
The plugin supports using ~
for home directory paths:
llm -t file:~/templates/my-template.yaml
Templates should be in YAML format, either as:
- A simple string (which becomes the prompt)
- A structured YAML with additional template properties
Example template:
# Simple example - just the prompt
"Summarize the following text in three bullet points: {{input}}"
Or with more options:
system: You are a helpful AI assistant.
prompt: |
Summarize the following text:
{{input}}
model: gpt-4
temperature: 0.7
To set up this plugin locally, first checkout the code. Then create a new virtual environment:
cd llm-filesystem
python -m venv venv
source venv/bin/activate
Now install the dependencies and test dependencies:
pip install -e '.[test]'
To run the tests:
python -m pytest
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.