Skip to main content

Access the Cohere Command R family of models

Project description

llm-command-r

PyPI Changelog Tests License

Access the Cohere Command R family of models via the Cohere API

Installation

Install this plugin in the same environment as LLM.

llm install llm-command-r

Configuration

You will need a Cohere API key. Configure it like this:

llm keys set cohere
# Paste key here

Usage

This plugin adds two models.

llm -m command-r 'Say hello from Command R'
llm -m command-r-plus 'Say hello from Command R Plus'

The Command R models have the ability to search the web as part of answering a prompt.

You can enable this feature using the -o websearch 1 option to the models:

llm -m command-r 'What is the LLM CLI tool?' -o websearch 1

Running a search costs more as it involves spending tokens including the search results in the prompt.

The full search results are stored as JSON in the LLM logs.

You can also use the command-r-search command provided by this plugin to see a list of documents that were used to answer your question as part of the output:

llm command-r-search 'What is the LLM CLI tool by simonw?'

Example output:

The LLM CLI tool is a command-line utility that allows users to access large language models. It was created by Simon Willison and can be installed via pip, Homebrew or pipx. The tool supports interactions with remote APIs and models that can be locally installed and run. Users can run prompts from the command line and even build an image search engine using the CLI tool.

Sources:

Development

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

cd llm-command-r
python3 -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

llm install -e '.[test]'

To run the tests:

pytest

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-command-r-0.2.tar.gz (8.4 kB view hashes)

Uploaded Source

Built Distribution

llm_command_r-0.2-py3-none-any.whl (8.7 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