Skip to main content

LLM plugin for models hosted on Replicate

Project description

llm-replicate

PyPI Changelog Tests License

LLM plugin for models hosted on Replicate

Installation

Install this plugin in the same environment as LLM.

llm install llm-replicate

Configuration

You will need an API key from Replicate. You can obtain one here.

You can set that as an environment variable called REPLICATE_API_TOKEN, or add it to the llm set of saved keys using:

llm keys set replicate
Enter key: <paste key here>

To fetch and save details of the default collection of language models hosted on Replicate, run this:

llm replicate fetch-models

Usage

Run llm models list to see the list of models:

llm models list

Then run a prompt through a specific model like this:

llm -m replicate-llama-7b "Ten great names for a pet pelican"

Registering extra models

To register additional models that are not included in the default Language models collection, find their ID on Replicate and use the llm replicate add command.

For example, to add the joehoover/falcon-40b-instruct model, run this:

llm replicate add joehoover/falcon-40b-instruct --alias falcon

This adds the model with the alias falcon - you can have 0 or more aliases for a model.

Now you can run it like this:

llm -m replicate-joehoover-falcon-40b-instruct "Three reasons to get a pet falcon"

Or using the alias like this:

llm -m falcon "Three reasons to get a pet falcon"

You can edit the list of models you have registered using the default $EDITOR like this:

llm replicate edit-models

Development

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

cd llm-palm
python3 -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

pip 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-replicate-0.1.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

llm_replicate-0.1-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

Details for the file llm-replicate-0.1.tar.gz.

File metadata

  • Download URL: llm-replicate-0.1.tar.gz
  • Upload date:
  • Size: 11.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for llm-replicate-0.1.tar.gz
Algorithm Hash digest
SHA256 a108c4cf5a4155f03635d7b59885e578a210a42d1bf86deb84f7854a4d8370bf
MD5 c5f0ca0ef0b50fda5c8ba0c9b5f68240
BLAKE2b-256 f0ae3cac2bfb3fc6430046c710a5cd0612648e3a894b8bf71b44e7023628aa42

See more details on using hashes here.

File details

Details for the file llm_replicate-0.1-py3-none-any.whl.

File metadata

  • Download URL: llm_replicate-0.1-py3-none-any.whl
  • Upload date:
  • Size: 14.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for llm_replicate-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cfbc8ad2e009129ef7c268c326b1bd11f3c7141ddc79c602387aac0b45008cc2
MD5 fb5a00a489166cb387f79615bc8ebc4e
BLAKE2b-256 d76566d4098fcc0f17d7b5221d74d1c9d7c0d88afd96d584d04411fc5fc2e636

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page