Skip to main content

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

Release files for llm-replicate 0.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-replicate 0.1
File Size Uploaded
llm-replicate-0.1.tar.gz 11.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for llm-replicate 0.1
File Interpreter ABI Platform
llm_replicate-0.1-py3-none-any.whl Python 3 none any Details

Total release size: 26.1 kB

Release files / llm-replicate-0.1.tar.gz

Download URL llm-replicate-0.1.tar.gz
Size 11.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a108c4cf5a4155f03635d7b59885e578a210a42d1bf86deb84f7854a4d8370bf
BLAKE2b-256 checksum
How to use checksums
f0ae3cac2bfb3fc6430046c710a5cd0612648e3a894b8bf71b44e7023628aa42
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release files / llm_replicate-0.1-py3-none-any.whl

Download URL llm_replicate-0.1-py3-none-any.whl
Size 14.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cfbc8ad2e009129ef7c268c326b1bd11f3c7141ddc79c602387aac0b45008cc2
BLAKE2b-256 checksum
How to use checksums
d76566d4098fcc0f17d7b5221d74d1c9d7c0d88afd96d584d04411fc5fc2e636
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release history Release notifications | RSS feed

0.3.1

2 release files

0.2

2 release files

This release

0.1 This release

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