Switch from one LLM to another with ease in your Voiceflow assistant using Replicate
The main aim of this project is to enable the use of different LLM models for generating text based on a given prompt. It provides a simple…
The main aim of this project is to enable the use of different LLM models for generating text based on a given prompt. It provides a simple and accessible API, making it perfect for users looking for a quick and easy-to-use solution to integrate in their API Step in Voiceflow.
To start using the Replicate LLM Model API, follow a few easy steps:
- Clone the repository
- Got to the replicate-llm-models-api directory
- Install dependencies with
npm install
- Set up the environment variables with your Replicate token
- Start the server using the
npm start
command
The API features a POST request endpoint, /api
, with adjustable parameters such as prompt, model name, and specific model settings.
/api
This endpoint allows a POST request with the prompt, the model name and the settings for this model.
The response contains the generated text based on the given prompt and model settings as well as the processing time in seconds.
Available models
You can update and add more models using the models.json file
{
"dolly-v2-12b":{
"id":"replicate/dolly-v2-12b:ef0e1aefc61f8e096ebe4db6b2bacc297daf2ef6899f0f7e001ec445893500e5",
"split":true,
"info": "https://replicate.com/replicate/dolly-v2-12b"
},
"stablelm-tuned-alpha-7b":{
"id":"stability-ai/stablelm-tuned-alpha-7b:4a9a32b4fd86c2d047f1d271fa93972683ec6ef1cf82f402bd021f267330b50b",
"split":false,
"info": "https://replicate.com/stability-ai/stablelm-tuned-alpha-7b"
},
"flan-t5-xl":{
"id":"replicate/flan-t5-xl:eec2f71c986dfa3b7a5d842d22e1130550f015720966bec48beaae059b19ef4c",
"split":true,
"info": "https://replicate.com/replicate/flan-t5-xl"
},
"llama-7b":{
"id":"replicate/llama-7b:2014ee1247354f2e81c0b3650d71ca715bc1e610189855f134c30ecb841fae21",
"split":true,
"info": "https://replicate.com/replicate/llama-7b"
},
"oasst-sft-1-pythia-12b":{
"id":"replicate/oasst-sft-1-pythia-12b:28d1875590308642710f46489b97632c0df55adb5078d43064e1dc0bf68117c3",
"split":true,
"info": "https://replicate.com/replicate/oasst-sft-1-pythia-12b"
},
"gpt-j-6b":{
"id":"replicate/gpt-j-6b:b3546aeec6c9891f0dd9929c2d3bedbf013c12e02e7dd0346af09c37e008c827",
"split":true,
"info": "https://replicate.com/replicate/gpt-j-6b"
}
}
You can find more information about this project and other projects we are working on in our Github repo.