Skip to main content

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

To use an alternative base URL for the Cohere API, set the COHERE_BASE_URL environment variable.

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

To generate new recorded VCR cassettes:

PYTEST_COHERE_API_KEY="$(llm keys get cohere)" pytest --record-mode once

Metadata

Release files for llm-command-r 0.3.1

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-command-r 0.3.1
File Size Uploaded
llm_command_r-0.3.1.tar.gz 9.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for llm-command-r 0.3.1
File Interpreter ABI Platform
llm_command_r-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 18.0 kB

Release files / llm_command_r-0.3.1.tar.gz

Download URL llm_command_r-0.3.1.tar.gz
Size 9.0 kB
Tags Source
SHA-256 checksum
How to use checksums
9cce12111d87a8e722301864826f51d1ec742b82931744793c08f3f3437461bc
BLAKE2b-256 checksum
How to use checksums
395e92a56423ac9d99bd5647cf68a9c87fe70e6bbc03b7eb924ebc51f9453fe0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 28, 2025.

Transparency log

Release files / llm_command_r-0.3.1-py3-none-any.whl

Download URL llm_command_r-0.3.1-py3-none-any.whl
Size 9.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ca88d58372e32091e9823413d46ee0fc7d448e2edc8b2d26d5612c1bf81763dc
BLAKE2b-256 checksum
How to use checksums
3c4c63c6b12aea49d6eb903d78cfc5ba06f53b7153b221e44b646fe1c5a50ef4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 28, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.3

2 release files

0.2

2 release files

0.1

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