Skip to main content

Plugin for LLM adding support for Cohere's Generate and Summarize models

Project description

llm-cohere

PyPI Changelog License

Plugin for LLM adding support for Cohere's Generater and Summarize models.

Installation

Install this plugin in the same environment as LLM.

llm install llm-cohere

Configuration

You will need an API key from Cohere. You can obtain one by creating an account and going to 'API Keys'.

You can set that as an environment variable called COHERE_API_KEY, or add it to the llm set of saved keys using:

llm keys set cohere
Enter key: <paste key here>

Usage

This plugin adds two models. cohere-generate uses an input prompt and generates output based on it. summarize takes an input prompt and generates a summarised response.

llm -m cohere-generate "Seven great names for a pet lemur"

Cohere also supports system prompts, which are sent to Cohere in the format of <prompt>: <system prompt>.

echo "I like lemurs a lot" | llm -m cohere-generate --system "Translate to german"

Development

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

cd llm-cohere
python3 -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

pip install -e '.[test]'

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-cohere-1.0.tar.gz (4.0 kB view hashes)

Uploaded Source

Built Distribution

llm_cohere-1.0-py3-none-any.whl (4.1 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