mirror of
https://github.com/hwchase17/langchain
synced 2024-11-02 09:40:22 +00:00
docs: Update PremAI Docs (#22114)
Thank you for contributing to LangChain! - [X] **PR title**: community: Updated langchain-community PremAI documentation - [X] **Lint and test**: Run `make format`, `make lint` and `make test` from the root of the package(s) you've modified. See contribution guidelines for more: https://python.langchain.com/docs/contributing/
This commit is contained in:
parent
1c9ceff503
commit
ee689412ab
@ -15,10 +15,9 @@
|
|||||||
"source": [
|
"source": [
|
||||||
"# ChatPremAI\n",
|
"# ChatPremAI\n",
|
||||||
"\n",
|
"\n",
|
||||||
">[PremAI](https://app.premai.io) is a unified platform that lets you build powerful production-ready GenAI-powered applications with the least effort so that you can focus more on user experience and overall growth. \n",
|
"[PremAI](https://premai.io/) is an all-in-one platform that simplifies the creation of robust, production-ready applications powered by Generative AI. By streamlining the development process, PremAI allows you to concentrate on enhancing user experience and driving overall growth for your application. You can quickly start using our platform [here](https://docs.premai.io/quick-start).\n",
|
||||||
"\n",
|
"\n",
|
||||||
"\n",
|
"This example goes over how to use LangChain to interact with different chat models with `ChatPremAI`"
|
||||||
"This example goes over how to use LangChain to interact with `ChatPremAI`. "
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -27,23 +26,13 @@
|
|||||||
"source": [
|
"source": [
|
||||||
"### Installation and setup\n",
|
"### Installation and setup\n",
|
||||||
"\n",
|
"\n",
|
||||||
"We start by installing langchain and premai-sdk. You can type the following command to install:\n",
|
"We start by installing `langchain` and `premai-sdk`. You can type the following command to install:\n",
|
||||||
"\n",
|
"\n",
|
||||||
"```bash\n",
|
"```bash\n",
|
||||||
"pip install premai langchain\n",
|
"pip install premai langchain\n",
|
||||||
"```\n",
|
"```\n",
|
||||||
"\n",
|
"\n",
|
||||||
"Before proceeding further, please make sure that you have made an account on PremAI and already started a project. If not, then here's how you can start for free:\n",
|
"Before proceeding further, please make sure that you have made an account on PremAI and already created a project. If not, please refer to the [quick start](https://docs.premai.io/introduction) guide to get started with the PremAI platform. Create your first project and grab your API key."
|
||||||
"\n",
|
|
||||||
"1. Sign in to [PremAI](https://app.premai.io/accounts/login/), if you are coming for the first time and create your API key [here](https://app.premai.io/api_keys/).\n",
|
|
||||||
"\n",
|
|
||||||
"2. Go to [app.premai.io](https://app.premai.io) and this will take you to the project's dashboard. \n",
|
|
||||||
"\n",
|
|
||||||
"3. Create a project and this will generate a project-id (written as ID). This ID will help you to interact with your deployed application. \n",
|
|
||||||
"\n",
|
|
||||||
"4. Head over to LaunchPad (the one with 🚀 icon). And there deploy your model of choice. Your default model will be `gpt-4`. You can also set and fix different generation parameters (like max-tokens, temperature, etc) and also pre-set your system prompt. \n",
|
|
||||||
"\n",
|
|
||||||
"Congratulations on creating your first deployed application on PremAI 🎉 Now we can use langchain to interact with our application. "
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -60,13 +49,13 @@
|
|||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"source": [
|
"source": [
|
||||||
"## Setup ChatPremAI instance in LangChain \n",
|
"### Setup PremAI client in LangChain\n",
|
||||||
"\n",
|
"\n",
|
||||||
"Once we import our required modules, let's set up our client. For now, let's assume that our `project_id` is 8. But make sure you use your project-id, otherwise, it will throw an error.\n",
|
"Once we imported our required modules, let's setup our client. For now let's assume that our `project_id` is `8`. But make sure you use your project-id, otherwise it will throw error.\n",
|
||||||
"\n",
|
"\n",
|
||||||
"To use langchain with prem, you do not need to pass any model name or set any parameters with our chat client. All of those will use the default model name and parameters of the LaunchPad model. \n",
|
"To use langchain with prem, you do not need to pass any model name or set any parameters with our chat-client. By default it will use the model name and parameters used in the [LaunchPad](https://docs.premai.io/get-started/launchpad). \n",
|
||||||
"\n",
|
"\n",
|
||||||
"`NOTE:` If you change the `model_name` or any other parameter like `temperature` while setting the client, it will override existing default configurations. "
|
"> Note: If you change the `model` or any other parameters like `temperature` or `max_tokens` while setting the client, it will override existing default configurations, that was used in LaunchPad. "
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -102,13 +91,11 @@
|
|||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"source": [
|
"source": [
|
||||||
"## Calling the Model\n",
|
"### Chat Completions\n",
|
||||||
"\n",
|
"\n",
|
||||||
"Now you are all set. We can now start by interacting with our application. `ChatPremAI` supports two methods `invoke` (which is the same as `generate`) and `stream`. \n",
|
"`ChatPremAI` supports two methods: `invoke` (which is the same as `generate`) and `stream`. \n",
|
||||||
"\n",
|
"\n",
|
||||||
"The first one will give us a static result. Whereas the second one will stream tokens one by one. Here's how you can generate chat-like completions. \n",
|
"The first one will give us a static result. Whereas the second one will stream tokens one by one. Here's how you can generate chat-like completions. "
|
||||||
"\n",
|
|
||||||
"### Generation"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -165,7 +152,7 @@
|
|||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"source": [
|
"source": [
|
||||||
"You can also change generation parameters while calling the model. Here's how you can do that"
|
"You can provide system prompt here like this:"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -192,15 +179,13 @@
|
|||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"source": [
|
"source": [
|
||||||
"### Important notes:\n",
|
"> If you are going to place system prompt here, then it will override your system prompt that was fixed while deploying the application from the platform. \n",
|
||||||
"\n",
|
"\n",
|
||||||
"Before proceeding further, please note that the current version of ChatPrem does not support parameters: [n](https://platform.openai.com/docs/api-reference/chat/create#chat-create-n) and [stop](https://platform.openai.com/docs/api-reference/chat/create#chat-create-stop) are not supported. \n",
|
"> Please note that the current version of ChatPremAI does not support parameters: [n](https://platform.openai.com/docs/api-reference/chat/create#chat-create-n) and [stop](https://platform.openai.com/docs/api-reference/chat/create#chat-create-stop). \n",
|
||||||
"\n",
|
|
||||||
"We will provide support for those two above parameters in sooner versions. \n",
|
|
||||||
"\n",
|
"\n",
|
||||||
"### Streaming\n",
|
"### Streaming\n",
|
||||||
"\n",
|
"\n",
|
||||||
"And finally, here's how you do token streaming for dynamic chat like applications. "
|
"In this section, let's see how we can stream tokens using langchain and PremAI. Here's how you do it. "
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -228,7 +213,7 @@
|
|||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"source": [
|
"source": [
|
||||||
"Similar to above, if you want to override the system-prompt and the generation parameters, here's how you can do it. "
|
"Similar to above, if you want to override the system-prompt and the generation parameters, you need to add the following:"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# PremAI
|
# PremAI
|
||||||
|
|
||||||
>[PremAI](https://app.premai.io) is a unified platform that lets you build powerful production-ready GenAI-powered applications with the least effort so that you can focus more on user experience and overall growth.
|
[PremAI](https://premai.io/) is an all-in-one platform that simplifies the creation of robust, production-ready applications powered by Generative AI. By streamlining the development process, PremAI allows you to concentrate on enhancing user experience and driving overall growth for your application. You can quickly start using our platform [here](https://docs.premai.io/quick-start).
|
||||||
|
|
||||||
|
|
||||||
## ChatPremAI
|
## ChatPremAI
|
||||||
@ -9,36 +9,27 @@ This example goes over how to use LangChain to interact with different chat mode
|
|||||||
|
|
||||||
### Installation and setup
|
### Installation and setup
|
||||||
|
|
||||||
We start by installing langchain and premai-sdk. You can type the following command to install:
|
We start by installing `langchain` and `premai-sdk`. You can type the following command to install:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pip install premai langchain
|
pip install premai langchain
|
||||||
```
|
```
|
||||||
|
|
||||||
Before proceeding further, please make sure that you have made an account on PremAI and already started a project. If not, then here's how you can start for free:
|
Before proceeding further, please make sure that you have made an account on PremAI and already created a project. If not, please refer to the [quick start](https://docs.premai.io/introduction) guide to get started with the PremAI platform. Create your first project and grab your API key.
|
||||||
|
|
||||||
1. Sign in to [PremAI](https://app.premai.io/accounts/login/), if you are coming for the first time and create your API key [here](https://app.premai.io/api_keys/).
|
|
||||||
|
|
||||||
2. Go to [app.premai.io](https://app.premai.io) and this will take you to the project's dashboard.
|
|
||||||
|
|
||||||
3. Create a project and this will generate a project-id (written as ID). This ID will help you to interact with your deployed application.
|
|
||||||
|
|
||||||
4. Head over to LaunchPad (the one with 🚀 icon). And there deploy your model of choice. Your default model will be `gpt-4`. You can also set and fix different generation parameters (like max-tokens, temperature, etc) and also pre-set your system prompt.
|
|
||||||
|
|
||||||
Congratulations on creating your first deployed application on PremAI 🎉 Now we can use langchain to interact with our application.
|
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from langchain_core.messages import HumanMessage, SystemMessage
|
from langchain_core.messages import HumanMessage, SystemMessage
|
||||||
from langchain_community.chat_models import ChatPremAI
|
from langchain_community.chat_models import ChatPremAI
|
||||||
```
|
```
|
||||||
|
|
||||||
### Setup ChatPrem instance in LangChain
|
### Setup PremAI client in LangChain
|
||||||
|
|
||||||
Once we import our required modules, let's set up our client. For now, let's assume that our `project_id` is 8. But make sure you use your project-id, otherwise, it will throw an error.
|
Once we imported our required modules, let's setup our client. For now let's assume that our `project_id` is `8`. But make sure you use your project-id, otherwise it will throw error.
|
||||||
|
|
||||||
To use langchain with prem, you do not need to pass any model name or set any parameters with our chat client. All of those will use the default model name and parameters of the LaunchPad model.
|
To use langchain with prem, you do not need to pass any model name or set any parameters with our chat-client. By default it will use the model name and parameters used in the [LaunchPad](https://docs.premai.io/get-started/launchpad).
|
||||||
|
|
||||||
|
> Note: If you change the `model` or any other parameters like `temperature` or `max_tokens` while setting the client, it will override existing default configurations, that was used in LaunchPad.
|
||||||
|
|
||||||
`NOTE:` If you change the `model_name` or any other parameter like `temperature` while setting the client, it will override existing default configurations.
|
|
||||||
|
|
||||||
```python
|
```python
|
||||||
import os
|
import os
|
||||||
@ -50,21 +41,19 @@ if "PREMAI_API_KEY" not in os.environ:
|
|||||||
chat = ChatPremAI(project_id=8)
|
chat = ChatPremAI(project_id=8)
|
||||||
```
|
```
|
||||||
|
|
||||||
### Calling the Model
|
### Chat Completions
|
||||||
|
|
||||||
Now you are all set. We can now start by interacting with our application. `ChatPremAI` supports two methods `invoke` (which is the same as `generate`) and `stream`.
|
`ChatPremAI` supports two methods: `invoke` (which is the same as `generate`) and `stream`.
|
||||||
|
|
||||||
The first one will give us a static result. Whereas the second one will stream tokens one by one. Here's how you can generate chat-like completions.
|
The first one will give us a static result. Whereas the second one will stream tokens one by one. Here's how you can generate chat-like completions.
|
||||||
|
|
||||||
### Generation
|
|
||||||
|
|
||||||
```python
|
```python
|
||||||
human_message = HumanMessage(content="Who are you?")
|
human_message = HumanMessage(content="Who are you?")
|
||||||
|
|
||||||
chat.invoke([human_message])
|
chat.invoke([human_message])
|
||||||
```
|
```
|
||||||
|
|
||||||
The above looks interesting, right? I set my default launchpad system-prompt as: `Always sound like a pirate` You can also, override the default system prompt if you need to. Here's how you can do it.
|
You can provide system prompt here like this:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
system_message = SystemMessage(content="You are a friendly assistant.")
|
system_message = SystemMessage(content="You are a friendly assistant.")
|
||||||
@ -82,16 +71,13 @@ chat.invoke(
|
|||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
> If you are going to place system prompt here, then it will override your system prompt that was fixed while deploying the application from the platform.
|
||||||
|
|
||||||
### Important notes:
|
> Please note that the current version of ChatPremAI does not support parameters: [n](https://platform.openai.com/docs/api-reference/chat/create#chat-create-n) and [stop](https://platform.openai.com/docs/api-reference/chat/create#chat-create-stop).
|
||||||
|
|
||||||
Before proceeding further, please note that the current version of ChatPrem does not support parameters: [n](https://platform.openai.com/docs/api-reference/chat/create#chat-create-n) and [stop](https://platform.openai.com/docs/api-reference/chat/create#chat-create-stop) are not supported.
|
|
||||||
|
|
||||||
We will provide support for those two above parameters in later versions.
|
|
||||||
|
|
||||||
### Streaming
|
### Streaming
|
||||||
|
|
||||||
And finally, here's how you do token streaming for dynamic chat-like applications.
|
In this section, let's see how we can stream tokens using langchain and PremAI. Here's how you do it.
|
||||||
|
|
||||||
```python
|
```python
|
||||||
import sys
|
import sys
|
||||||
@ -101,7 +87,7 @@ for chunk in chat.stream("hello how are you"):
|
|||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
```
|
```
|
||||||
|
|
||||||
Similar to above, if you want to override the system-prompt and the generation parameters, here's how you can do it.
|
Similar to above, if you want to override the system-prompt and the generation parameters, you need to add the following:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
import sys
|
import sys
|
||||||
@ -114,47 +100,30 @@ for chunk in chat.stream(
|
|||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
```
|
```
|
||||||
|
|
||||||
## Embedding
|
This will stream tokens one after the other.
|
||||||
|
|
||||||
In this section, we are going to discuss how we can get access to different embedding models using `PremEmbeddings`. Let's start by doing some imports and defining our embedding object
|
## PremEmbeddings
|
||||||
|
|
||||||
|
In this section we are going to dicuss how we can get access to different embedding model using `PremEmbeddings` with LangChain. Lets start by importing our modules and setting our API Key.
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from langchain_community.embeddings import PremEmbeddings
|
|
||||||
```
|
|
||||||
|
|
||||||
Once we import our required modules, let's set up our client. For now, let's assume that our `project_id` is 8. But make sure you use your project-id, otherwise, it will throw an error.
|
|
||||||
|
|
||||||
|
|
||||||
```python
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import getpass
|
import getpass
|
||||||
|
from langchain_community.embeddings import PremEmbeddings
|
||||||
|
|
||||||
|
|
||||||
if os.environ.get("PREMAI_API_KEY") is None:
|
if os.environ.get("PREMAI_API_KEY") is None:
|
||||||
os.environ["PREMAI_API_KEY"] = getpass.getpass("PremAI API Key:")
|
os.environ["PREMAI_API_KEY"] = getpass.getpass("PremAI API Key:")
|
||||||
|
|
||||||
# Define a model as a required parameter here since there is no default embedding model
|
```
|
||||||
|
|
||||||
|
We support lots of state of the art embedding models. You can view our list of supported LLMs and embedding models [here](https://docs.premai.io/get-started/supported-models). For now let's go for `text-embedding-3-large` model for this example. .
|
||||||
|
|
||||||
|
```python
|
||||||
|
|
||||||
model = "text-embedding-3-large"
|
model = "text-embedding-3-large"
|
||||||
embedder = PremEmbeddings(project_id=8, model=model)
|
embedder = PremEmbeddings(project_id=8, model=model)
|
||||||
```
|
|
||||||
|
|
||||||
We have defined our embedding model. We support a lot of embedding models. Here is a table that shows the number of embedding models we support.
|
|
||||||
|
|
||||||
|
|
||||||
| Provider | Slug | Context Tokens |
|
|
||||||
|-------------|------------------------------------------|----------------|
|
|
||||||
| cohere | embed-english-v3.0 | N/A |
|
|
||||||
| openai | text-embedding-3-small | 8191 |
|
|
||||||
| openai | text-embedding-3-large | 8191 |
|
|
||||||
| openai | text-embedding-ada-002 | 8191 |
|
|
||||||
| replicate | replicate/all-mpnet-base-v2 | N/A |
|
|
||||||
| together | togethercomputer/Llama-2-7B-32K-Instruct | N/A |
|
|
||||||
| mistralai | mistral-embed | 4096 |
|
|
||||||
|
|
||||||
To change the model, you simply need to copy the `slug` and access your embedding model. Now let's start using our embedding model with a single query followed by multiple queries (which is also called as a document)
|
|
||||||
|
|
||||||
```python
|
|
||||||
query = "Hello, this is a test query"
|
query = "Hello, this is a test query"
|
||||||
query_result = embedder.embed_query(query)
|
query_result = embedder.embed_query(query)
|
||||||
|
|
||||||
@ -162,8 +131,11 @@ query_result = embedder.embed_query(query)
|
|||||||
|
|
||||||
print(query_result[:5])
|
print(query_result[:5])
|
||||||
```
|
```
|
||||||
|
<Note>
|
||||||
|
Setting `model_name` argument in mandatory for PremAIEmbeddings unlike chat.
|
||||||
|
</Note>
|
||||||
|
|
||||||
Finally, let's embed a document
|
Finally, let's embed some sample document
|
||||||
|
|
||||||
```python
|
```python
|
||||||
documents = [
|
documents = [
|
||||||
@ -178,4 +150,20 @@ doc_result = embedder.embed_documents(documents)
|
|||||||
# of the first document vector
|
# of the first document vector
|
||||||
|
|
||||||
print(doc_result[0][:5])
|
print(doc_result[0][:5])
|
||||||
```
|
```
|
||||||
|
|
||||||
|
```python
|
||||||
|
print(f"Dimension of embeddings: {len(query_result)}")
|
||||||
|
```
|
||||||
|
Dimension of embeddings: 3072
|
||||||
|
|
||||||
|
```python
|
||||||
|
doc_result[:5]
|
||||||
|
```
|
||||||
|
>Result:
|
||||||
|
>
|
||||||
|
>[-0.02129288576543331,
|
||||||
|
0.0008162345038726926,
|
||||||
|
-0.004556538071483374,
|
||||||
|
0.02918623760342598,
|
||||||
|
-0.02547479420900345]
|
@ -6,25 +6,26 @@
|
|||||||
"source": [
|
"source": [
|
||||||
"# PremAI\n",
|
"# PremAI\n",
|
||||||
"\n",
|
"\n",
|
||||||
">[PremAI](https://app.premai.io) is an unified platform that let's you build powerful production-ready GenAI powered applications with least effort, so that you can focus more on user experience and overall growth. In this section we are going to dicuss how we can get access to different embedding model using `PremAIEmbeddings`\n",
|
"[PremAI](https://premai.io/) is an all-in-one platform that simplifies the creation of robust, production-ready applications powered by Generative AI. By streamlining the development process, PremAI allows you to concentrate on enhancing user experience and driving overall growth for your application. You can quickly start using our platform [here](https://docs.premai.io/quick-start).\n",
|
||||||
"\n",
|
"\n",
|
||||||
"## Installation and Setup\n",
|
"### Installation and setup\n",
|
||||||
"\n",
|
"\n",
|
||||||
"We start by installing langchain and premai-sdk. You can type the following command to install:\n",
|
"We start by installing `langchain` and `premai-sdk`. You can type the following command to install:\n",
|
||||||
"\n",
|
"\n",
|
||||||
"```bash\n",
|
"```bash\n",
|
||||||
"pip install premai langchain\n",
|
"pip install premai langchain\n",
|
||||||
"```\n",
|
"```\n",
|
||||||
"\n",
|
"\n",
|
||||||
"Before proceeding further, please make sure that you have made an account on Prem and already started a project. If not, then here's how you can start for free:\n",
|
"Before proceeding further, please make sure that you have made an account on PremAI and already created a project. If not, please refer to the [quick start](https://docs.premai.io/introduction) guide to get started with the PremAI platform. Create your first project and grab your API key."
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"## PremEmbeddings\n",
|
||||||
"\n",
|
"\n",
|
||||||
"1. Sign in to [PremAI](https://app.premai.io/accounts/login/), if you are coming for the first time and create your API key [here](https://app.premai.io/api_keys/).\n",
|
"In this section we are going to dicuss how we can get access to different embedding model using `PremEmbeddings` with LangChain. Lets start by importing our modules and setting our API Key. "
|
||||||
"\n",
|
|
||||||
"2. Go to [app.premai.io](https://app.premai.io) and this will take you to the project's dashboard. \n",
|
|
||||||
"\n",
|
|
||||||
"3. Create a project and this will generate a project-id (written as ID). This ID will help you to interact with your deployed application. \n",
|
|
||||||
"\n",
|
|
||||||
"Congratulations on creating your first deployed application on Prem 🎉 Now we can use langchain to interact with our application. "
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -42,7 +43,9 @@
|
|||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"source": [
|
"source": [
|
||||||
"Once we imported our required modules, let's setup our client. For now let's assume that our `project_id` is 8. But make sure you use your project-id, otherwise it will throw error.\n"
|
"Once we imported our required modules, let's setup our client. For now let's assume that our `project_id` is `8`. But make sure you use your project-id, otherwise it will throw error.\n",
|
||||||
|
"\n",
|
||||||
|
"> Note: Setting `model_name` argument in mandatory for PremAIEmbeddings unlike [ChatPremAI.](https://python.langchain.com/v0.1/docs/integrations/chat/premai/)"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -72,20 +75,7 @@
|
|||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"source": [
|
"source": [
|
||||||
"We have defined our embedding model. We support a lot of embedding models. Here is a table that shows the number of embedding models we support. \n",
|
"We support lots of state of the art embedding models. You can view our list of supported LLMs and embedding models [here](https://docs.premai.io/get-started/supported-models). For now let's go for `text-embedding-3-large` model for this example."
|
||||||
"\n",
|
|
||||||
"\n",
|
|
||||||
"| Provider | Slug | Context Tokens |\n",
|
|
||||||
"|-------------|------------------------------------------|----------------|\n",
|
|
||||||
"| cohere | embed-english-v3.0 | N/A |\n",
|
|
||||||
"| openai | text-embedding-3-small | 8191 |\n",
|
|
||||||
"| openai | text-embedding-3-large | 8191 |\n",
|
|
||||||
"| openai | text-embedding-ada-002 | 8191 |\n",
|
|
||||||
"| replicate | replicate/all-mpnet-base-v2 | N/A |\n",
|
|
||||||
"| together | togethercomputer/Llama-2-7B-32K-Instruct | N/A |\n",
|
|
||||||
"| mistralai | mistral-embed | 4096 |\n",
|
|
||||||
"\n",
|
|
||||||
"To change the model, you simply need to copy the `slug` and access your embedding model. Now let's start using our embedding model with a single query followed by multiple queries (which is also called as a document)"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user