Skip to main content

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]'

Metadata

Release files for llm-cohere 1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for llm-cohere 1.0
File Size Uploaded
llm-cohere-1.0.tar.gz 4.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for llm-cohere 1.0
File Interpreter ABI Platform
llm_cohere-1.0-py3-none-any.whl Python 3 none any Details

Total release size: 8.0 kB

Release files / llm-cohere-1.0.tar.gz

Download URL llm-cohere-1.0.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
8f05f5b7f90fbc95ba06be22eeecb88c8aeaecf06d860fe5a7863da377e41be2
BLAKE2b-256 checksum
How to use checksums
7e275182ce93fd87201c14805e254c99e70908182314026193e6491c5618f610
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release files / llm_cohere-1.0-py3-none-any.whl

Download URL llm_cohere-1.0-py3-none-any.whl
Size 4.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d35942c3465372115ed1a4d91d56130f949f8581bef90c67569bb74abd1422b1
BLAKE2b-256 checksum
How to use checksums
f0c029cdf1c88ef5571c3899194869358e3ccb25cfb335df0e55ac318a0d95e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release history Release notifications | RSS feed

This release

1.0 This release

2 release files

0.9

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page