replicate
library that is provided by Replicate.
The required arguments to establish a connection are,
- model_name: Model name which you want to access in MindsDB. e.g ‘air-forever/kandinsky-2’
- version: version hash/id which you want to use in MindsDB.
- api_key: API key from Replicate Platform you can found here.
- model_type: It should be set to ‘LLM’ while using Large language Model else it Optional
Before you can use Replicate, it’s essential to authenticate by setting your API token in an environment variable named REPLICATE_API_TOKEN.
This token acts as a key to enable access to Replicate’s features.On Windows:Again, replace ‘YOUR_TOKEN’ with your actual Replicate API token.
- Using pip:
- Using Docker:
Usage
To use this handler and connect to a Replicate cluster in MindsDB, you need an account on Replicate. Make sure to create an account by following this link. To establish the connection and create a model in MindsDB, use the following syntax:OUTPUT
OUTPUT
Note: Replicate provides only a few free predictions, so choose your predictions wisely. Don’t let the machines have all the fun, save some for yourself! 😉