Plugin for LLM adding a Markov chain generating model
Project description
llm-markov
Plugin for LLM adding a Markov chain generating model
Installation
Install this plugin in the same environment as LLM.
llm install llm-markov
Usage
This plugin adds a model called markov
. You can execute it like this:
llm -m markov "The quick brown fox jumps over the lazy dog"
My default it will produce 100 words. You can control the number of words with the -o number
option:
llm -m markov -o 20 "The quick brown fox jumps over the lazy dog"
A delay of 0.02s is simulated between each token. You can modify this using the -o delay
option - to 0
to disable it, or some other floating point number of seconds to customize it:
llm -m markov "The quick brown fox jumps over the lazy dog" -o delay 0
llm -m markov "The quick brown fox jumps over the lazy dog" -o delay 0.1 -o length 20
Development
To set up this plugin locally, first checkout the code. Then create a new virtual environment:
cd llm-markov
python3 -m venv venv
source venv/bin/activate
Now install the dependencies and test dependencies:
pip 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.