Place the plugin file in either:
The main plugins
directory of this module
A plugins
directory in your profile
Use the /config files
command to see a list of currently configured plugin paths.
Install the plugin package – see below for a list of package plugins.
Enabling plugins¶Enable the plugin in your configuration:
plugins: enabled: # This is a list of plugins to enable, each list item # should be the name of a plugin file. # For file-based plugins, this is the filename without the # extension. # For package-based plugins, see the installation instructions # for the package. - test
Note that setting plugins.enabled
will overwrite the default enabled plugins. Use the /plugins
command for a list of currently enabled plugins.
To dynamically reload a plugin:
/plugin reload [plugin_name]
Reloading a plugin will also clear the main cache file for the plugin – as some provider plugins cache data on current models, this command can be used to refresh the available models for the provider. For example:
/plugin reload provider_chat_fireworksCore plugins¶
These plugins are built into LWE core:
echo: Simple echo plugin, echos back the text you give it
examples: Easily install example configuration files (see Installing examples)
provider_chat_openai_compat: Allows access to third-party providers that offer an OpenAI compatible API.
They can be disabled by removing them from plugins.enabled
in your configuration file.
These plugins are maintained by the LWE team, and are not part of LWE core – they must be installed.
Instructions for installing and configuring each plugin can be found at the referenced repository for each plugin.
Shell command plugins¶These plugins add additional commands to the shell:
https://github.com/llm-workflow-engine/lwe-plugin-data-query
These plugins add additional LLM providers:
NOTE: Most provider plugins are NOT chat-based, and instead return a single response to any text input. These inputs and responses are still managed as ‘conversations’ for storage purposes, using the same storage mechanism the chat-based providers use.
Supported providers¶NOTE: While these provider integrations are working, none have been well-tested yet.
https://github.com/llm-workflow-engine/lwe-plugin-provider-chat-ai21
https://github.com/llm-workflow-engine/lwe-plugin-provider-azure-openai-chat
https://github.com/llm-workflow-engine/lwe-plugin-provider-chat-anthropic
https://github.com/llm-workflow-engine/lwe-plugin-provider-chat-anyscale
https://github.com/llm-workflow-engine/lwe-plugin-provider-chat-cohere
https://github.com/llm-workflow-engine/lwe-plugin-provider-chat-fireworks
https://github.com/llm-workflow-engine/lwe-plugin-provider-chat-google-genai
https://github.com/llm-workflow-engine/lwe-plugin-provider-chat-groq
https://github.com/llm-workflow-engine/lwe-plugin-provider-chat-mistralai
https://github.com/llm-workflow-engine/lwe-plugin-provider-chat-ollama
https://github.com/llm-workflow-engine/lwe-plugin-provider-chat-together
https://github.com/llm-workflow-engine/lwe-plugin-provider-chat-vertexai
https://github.com/llm-workflow-engine/lwe-plugin-provider-chat-xai
https://github.com/llm-workflow-engine/lwe-plugin-provider-huggingface-hub
https://github.com/llm-workflow-engine/lwe-plugin-provider-openai
https://github.com/llm-workflow-engine/lwe-plugin-provider-openrouter
https://github.com/llm-workflow-engine/lwe-plugin-provider-requesty
https://github.com/llm-workflow-engine/lwe-plugin-provider-vertexai
Use the /providers
command for a list of currently enabled providers.
See /help provider
for how to switch providers/models on the fly.
Example:
/provider openai /model model_name text-davinci-003Writing plugins¶
There is currently no developer documentation for writing plugins.
The plugins
directory has some default plugins, examining those will give a good idea for how to design a new one. In particular, the echo
plugin is well commented. The package plugins listed above also contain many different approaches you can learn from.
To write new provider plugins, investigate the existing provider plugins as examples.
Currently, plugins for the shell can only add new commands.
Plugin structure¶In order for plugins to load, a few simple conventions must be followed:
All plugins must inherit from the base Plugin class, and provide implementations of the setup()
and default_config()
methods. Class name should be a camel-cased version of the plugin name:
from lwe.core.plugin import Plugin class ExamplePlugin(Plugin): """ An example plugin, does blah blah blah... """ # Implement these... @abstractmethod def setup(self): pass @abstractmethod def default_config(self): pass
The first line of the class docstring will be used as the plugin description.
example_plugin
:
File-based plugin: The filename must be the plugin name with a .py
extension, example_plugin.py
Package-based plugin: The the entry point must be lwe_plugins
, and the plugin name must be prefixed with lwe-plugin-
:
setup( name="lwe-plugin-example-plugin", # Other setup options... entry_points={ "lwe_plugins": [ "lwe_plugin_example_plugin = lwe_plugin_example_plugin.plugin:ExamplePlugin" ] }, )
An instantiated plugin has access to these objects.
self.config
: The current instantiated Config object
self.log
: The instantiated Logger object
self.backend
: The instantiated backend
self.shell
: The instantiated shell
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4