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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llm_cohere-1.0-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file llm-cohere-1.0.tar.gz.

File metadata

  • Download URL: llm-cohere-1.0.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for llm-cohere-1.0.tar.gz
Algorithm Hash digest
SHA256 8f05f5b7f90fbc95ba06be22eeecb88c8aeaecf06d860fe5a7863da377e41be2
MD5 5b79a638b862d5b1df3156d674dcf6c4
BLAKE2b-256 7e275182ce93fd87201c14805e254c99e70908182314026193e6491c5618f610

See more details on using hashes here.

File details

Details for the file llm_cohere-1.0-py3-none-any.whl.

File metadata

  • Download URL: llm_cohere-1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for llm_cohere-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d35942c3465372115ed1a4d91d56130f949f8581bef90c67569bb74abd1422b1
MD5 bc3fc3ef440b906745c4c1f30630ff41
BLAKE2b-256 f0c029cdf1c88ef5571c3899194869358e3ccb25cfb335df0e55ac318a0d95e1

See more details on using hashes here.

Supported by

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