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

Uploaded Source

Built Distribution

llm_command_r-0.2-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file llm-command-r-0.2.tar.gz.

File metadata

  • Download URL: llm-command-r-0.2.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for llm-command-r-0.2.tar.gz
Algorithm Hash digest
SHA256 621e73799b11bca713e5bdfe73e4890ef19229899e16f9d7bb3149086c3c097a
MD5 90adef54131e2e1ff79bfc431185f40e
BLAKE2b-256 58ba53c2f6c76b1e5beb92358305f01eb46c372009870276a5c7bc10d4c0f79d

See more details on using hashes here.

File details

Details for the file llm_command_r-0.2-py3-none-any.whl.

File metadata

  • Download URL: llm_command_r-0.2-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for llm_command_r-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b4a562bc89a2798b75201654df523b5c4c05c138a3fe2816e48bf20553cb0240
MD5 883a730d4e3e5e34d9de1096c3bc47b7
BLAKE2b-256 af7cb927aeff434ae1e770f44ce7e210d4ca89af701b1175a7af6c6bf8a888e3

See more details on using hashes here.

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