Skip to main content

Plugin for LLM adding a Markov chain generating model

Project description

llm-markov

PyPI Changelog Tests License

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

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llm-markov-0.1.tar.gz (7.2 kB view hashes)

Uploaded Source

Built Distribution

llm_markov-0.1-py3-none-any.whl (7.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page