Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/accudio/llm-cohere
Plugin for LLM adding support for Cohere's Generate and Summarize models
https://github.com/accudio/llm-cohere
cohere
Last synced: about 1 month ago
JSON representation
Plugin for LLM adding support for Cohere's Generate and Summarize models
- Host: GitHub
- URL: https://github.com/accudio/llm-cohere
- Owner: Accudio
- Created: 2023-07-30T19:29:20.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-03-29T20:13:43.000Z (8 months ago)
- Last Synced: 2024-10-11T04:20:20.246Z (about 1 month ago)
- Topics: cohere
- Language: Python
- Homepage:
- Size: 10.7 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# llm-cohere
[![PyPI](https://img.shields.io/pypi/v/llm-cohere.svg)](https://pypi.org/project/llm-cohere/)
[![Changelog](https://img.shields.io/github/v/release/accudio/llm-cohere?include_prereleases&label=changelog)](https://github.com/accudio/llm-cohere/releases)
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/accudio/llm-cohere/blob/main/LICENSE)Plugin for [LLM](https://llm.datasette.io/) adding support for [Cohere](https://cohere.com)'s Generater and Summarize models.
## Installation
Install this plugin in the same environment as LLM.
```bash
llm install llm-cohere
```
## ConfigurationYou 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:
```bash
llm keys set cohere
```
```
Enter key:
```## 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.
```bash
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 `: `.
```bash
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:
```bash
cd llm-cohere
python3 -m venv venv
source venv/bin/activate
```Now install the dependencies and test dependencies:
```bash
pip install -e '.[test]'
```