Skip to main content

LLM plugin to generate few-shot prompts for plugin creation

Project description

llm-plugin-generator

PyPI Changelog Tests License

LLM plugin to generate plugins for LLM

Installation

Install this plugin in the same environment as LLM:

llm install llm-plugin-generator

Usage

To generate a new LLM plugin, use the generate-plugin command:

llm generate-plugin "Description of your plugin"

Options:

  • PROMPT: Description of your plugin (optional)
  • INPUT_FILES: Path(s) to input README or prompt file(s) (optional, multiple allowed)
  • --output-dir: Directory to save generated plugin files (default: current directory)
  • --type: Type of plugin to generate (default, model, or utility)
  • --model, -m: Model to use for generation

--type

--type model will use a few-shot prompt focused on llm model plugins. --type utility focuses on utilities. leaving off --type will use a default prompt that combines all off them. I suggest picking one of the focused options which should be faster.

Examples:

  1. Basic usage:
llm generate-plugin "Create a plugin that translates text to emoji" --output-dir ./my-new-plugin --type utility --model gpt-4
  1. Using a prompt and input files - Generating plugin from a README.md
llm generate-plugin "Few-shot Prompt Generator. Call it llm-few-shot-generator" 'files/README.md' --output-dir plugins/Utilities/few-shot-generator --type utility -m claude-3.5-sonnet

This will generate a new LLM plugin based on the provided description and/or input files. The files will be saved in the specified output directory.

Features

  • Generates fully functional LLM plugins based on descriptions or input files
  • Supports different plugin types: default, model, and utility
  • Uses few-shot learning with predefined examples for better generation
  • Allows specifying custom output directory
  • Compatible with various LLM models
  • Generates main plugin file, README.md, and pyproject.toml
  • Extracts plugin name from generated pyproject.toml for consistent naming

Development

To set up this plugin locally, first checkout the code. Then create a new virtual environment:

cd llm-plugin-generator
python -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

pip install -e '.[test]'

To run the tests:

pytest

Contributing

Contributions to llm-plugin-generator are welcome! Please refer to the GitHub repository for more information on how to contribute.

License

This project is licensed under the Apache License 2.0. See the LICENSE file for details.

Project details


Download files

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

Source Distribution

llm_plugin_generator-0.3.tar.gz (33.5 kB view details)

Uploaded Source

Built Distribution

llm_plugin_generator-0.3-py3-none-any.whl (37.0 kB view details)

Uploaded Python 3

File details

Details for the file llm_plugin_generator-0.3.tar.gz.

File metadata

  • Download URL: llm_plugin_generator-0.3.tar.gz
  • Upload date:
  • Size: 33.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for llm_plugin_generator-0.3.tar.gz
Algorithm Hash digest
SHA256 1c45edc01cfd7ac8acfd597265e7396c792d99e0c2d308c7c7c7c3be07e191b7
MD5 b5fd2a3d14e303a652afe95bc51fbe18
BLAKE2b-256 879998606e4e02fa241f15df062fbda52f57dc5db9347cf243cb2392df74933f

See more details on using hashes here.

File details

Details for the file llm_plugin_generator-0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for llm_plugin_generator-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8941cc5135b841d7fd4774d071e731a46d572f7bfc86bc1eeaa54de0ad11ddce
MD5 2af55224a2f97e45f4fc85990153a390
BLAKE2b-256 bddc9885e1159a12192d0643647fce08e5a2f05c5be6a68511bc11155b1dbdb4

See more details on using hashes here.

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