Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs alibaba cloud #14772

Merged
merged 3 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,37 @@
"metadata": {},
"source": [
"---\n",
"sidebar_label: AliCloud PAI EAS\n",
"sidebar_label: Alibaba Cloud PAI EAS\n",
"---"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# PaiEasChatEndpoint\n",
"Machine Learning Platform for AI of Alibaba Cloud is a machine learning or deep learning engineering platform intended for enterprises and developers. It provides easy-to-use, cost-effective, high-performance, and easy-to-scale plug-ins that can be applied to various industry scenarios. With over 140 built-in optimization algorithms, Machine Learning Platform for AI provides whole-process AI engineering capabilities including data labeling (PAI-iTAG), model building (PAI-Designer and PAI-DSW), model training (PAI-DLC), compilation optimization, and inference deployment (PAI-EAS). PAI-EAS supports different types of hardware resources, including CPUs and GPUs, and features high throughput and low latency. It allows you to deploy large-scale complex models with a few clicks and perform elastic scale-ins and scale-outs in real time. It also provides a comprehensive O&M and monitoring system."
"# Alibaba Cloud PAI EAS\n",
"\n",
">[Alibaba Cloud PAI (Platform for AI)](https://www.alibabacloud.com/help/en/pai/?spm=a2c63.p38356.0.0.c26a426ckrxUwZ) is a lightweight and cost-efficient machine learning platform that uses cloud-native technologies. It provides you with an end-to-end modelling service. It accelerates model training based on tens of billions of features and hundreds of billions of samples in more than 100 scenarios.\n",
"\n",
">[Machine Learning Platform for AI of Alibaba Cloud](https://www.alibabacloud.com/help/en/machine-learning-platform-for-ai/latest/what-is-machine-learning-pai) is a machine learning or deep learning engineering platform intended for enterprises and developers. It provides easy-to-use, cost-effective, high-performance, and easy-to-scale plug-ins that can be applied to various industry scenarios. With over 140 built-in optimization algorithms, `Machine Learning Platform for AI` provides whole-process AI engineering capabilities including data labelling (`PAI-iTAG`), model building (`PAI-Designer` and `PAI-DSW`), model training (`PAI-DLC`), compilation optimization, and inference deployment (`PAI-EAS`).\n",
">\n",
">`PAI-EAS` supports different types of hardware resources, including CPUs and GPUs, and features high throughput and low latency. It allows you to deploy large-scale complex models with a few clicks and perform elastic scale-ins and scale-outs in real-time. It also provides a comprehensive O&M and monitoring system."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Setup Eas Service\n",
"## Setup EAS Service\n",
"\n",
"One who want to use eas llms must set up eas service first. When the eas service is launched, eas_service_rul and eas_service token can be got. Users can refer to https://www.alibabacloud.com/help/en/pai/user-guide/service-deployment/ for more information. Try to set environment variables to init eas service url and token:\n",
"Set up environment variables to init EAS service URL and token.\n",
"Use [this document](https://www.alibabacloud.com/help/en/pai/user-guide/service-deployment/) for more information.\n",
"\n",
"```base\n",
"```bash\n",
"export EAS_SERVICE_URL=XXX\n",
"export EAS_SERVICE_TOKEN=XXX\n",
"```\n",
"or run as follow codes:"
"Another option is to use this code:"
]
},
{
Expand All @@ -56,7 +62,8 @@
"metadata": {},
"source": [
"## Run Chat Model\n",
"You can use the default settings to call eas service as follows:"
"\n",
"You can use the default settings to call EAS service as follows:"
]
},
{
Expand All @@ -73,7 +80,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Or, call eas service with new inference params:"
"Or, call EAS service with new inference params:"
]
},
{
Expand Down Expand Up @@ -108,7 +115,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -122,10 +129,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.11"
},
"orig_nbformat": 4
"version": "3.10.12"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
35 changes: 35 additions & 0 deletions docs/docs/integrations/providers/alibaba_cloud.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Alibaba Cloud

>[Alibaba Group Holding Limited (Wikipedia)](https://en.wikipedia.org/wiki/Alibaba_Group), or `Alibaba`
> (Chinese: 阿里巴巴), is a Chinese multinational technology company specializing in e-commerce, retail,
> Internet, and technology.
>
> [Alibaba Cloud (Wikipedia)](https://en.wikipedia.org/wiki/Alibaba_Cloud), also known as `Aliyun`
> (Chinese: 阿里云; pinyin: Ālǐyún; lit. 'Ali Cloud'), is a cloud computing company, a subsidiary
> of `Alibaba Group`. `Alibaba Cloud` provides cloud computing services to online businesses and
> Alibaba's own e-commerce ecosystem.


## Chat Model

See [installation instructions and a usage example](/docs/integrations/chat/alibaba_cloud_pai_eas).

```python
from langchain.chat_models import PaiEasChatEndpoint
```

## Vectorstore

See [installation instructions and a usage example](/docs/integrations/vectorstores/alibabacloud_opensearch).

```python
from langchain.vectorstores import AlibabaCloudOpenSearch, AlibabaCloudOpenSearchSettings
```

## Document Loader

See [installation instructions and a usage example](/docs/integrations/document_loaders/alibaba_cloud_maxcompute).

```python
from langchain.document_loaders import MaxComputeLoader
```
30 changes: 0 additions & 30 deletions docs/docs/integrations/providers/alibabacloud_opensearch.md

This file was deleted.

67 changes: 58 additions & 9 deletions docs/docs/integrations/vectorstores/alibabacloud_opensearch.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,53 @@
"\n",
">[Alibaba Cloud Opensearch](https://www.alibabacloud.com/product/opensearch) is a one-stop platform to develop intelligent search services. `OpenSearch` was built on the large-scale distributed search engine developed by `Alibaba`. `OpenSearch` serves more than 500 business cases in Alibaba Group and thousands of Alibaba Cloud customers. `OpenSearch` helps develop search services in different search scenarios, including e-commerce, O2O, multimedia, the content industry, communities and forums, and big data query in enterprises.\n",
"\n",
">`OpenSearch` helps you develop high quality, maintenance-free, and high performance intelligent search services to provide your users with high search efficiency and accuracy.\n",
">`OpenSearch` helps you develop high-quality, maintenance-free, and high-performance intelligent search services to provide your users with high search efficiency and accuracy.\n",
"\n",
">`OpenSearch` provides the vector search feature. In specific scenarios, especially test question search and image search scenarios, you can use the vector search feature together with the multimodal search feature to improve the accuracy of search results.\n",
"\n",
"This notebook shows how to use functionality related to the `Alibaba Cloud OpenSearch Vector Search Edition`.\n",
"To run, you should have an [OpenSearch Vector Search Edition](https://opensearch.console.aliyun.com) instance up and running:\n",
"This notebook shows how to use functionality related to the `Alibaba Cloud OpenSearch Vector Search Edition`."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Setting up\n",
"\n",
"\n",
"### Purchase an instance and configure it\n",
"\n",
"Purchase OpenSearch Vector Search Edition from [Alibaba Cloud](https://opensearch.console.aliyun.com) and configure the instance according to the help [documentation](https://help.aliyun.com/document_detail/463198.html?spm=a2c4g.465092.0.0.2cd15002hdwavO).\n",
"\n",
"Read the [help document](https://www.alibabacloud.com/help/en/opensearch/latest/vector-search) to quickly familiarize and configure OpenSearch Vector Search Edition instance."
"To run, you should have an [OpenSearch Vector Search Edition](https://opensearch.console.aliyun.com) instance up and running.\n",
"\n",
" \n",
"### Alibaba Cloud OpenSearch Vector Store class\n",
" `AlibabaCloudOpenSearch` class supports functions:\n",
"- `add_texts`\n",
"- `add_documents`\n",
"- `from_texts`\n",
"- `from_documents`\n",
"- `similarity_search`\n",
"- `asimilarity_search`\n",
"- `similarity_search_by_vector`\n",
"- `asimilarity_search_by_vector`\n",
"- `similarity_search_with_relevance_scores`\n",
"- `delete_doc_by_texts`\n",
"\n",
"\n",
"Read the [help document](https://www.alibabacloud.com/help/en/opensearch/latest/vector-search) to quickly familiarize and configure OpenSearch Vector Search Edition instance.\n",
"\n",
"If you encounter any problems during use, please feel free to contact [[email protected]]([email protected]), and we will do our best to provide you with assistance and support."
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"source": [
"After the instance is up and running, follow these steps to split documents, get embeddings, connect to the alibaba cloud opensearch instance, index documents, and perform vector retrieval."
Expand All @@ -30,7 +63,10 @@
{
"cell_type": "markdown",
"metadata": {
"collapsed": false
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"source": [
"We need to install the following Python packages first."
Expand All @@ -48,7 +84,10 @@
{
"cell_type": "markdown",
"metadata": {
"collapsed": false
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"source": [
"We want to use `OpenAIEmbeddings` so we have to get the OpenAI API Key."
Expand All @@ -59,6 +98,9 @@
"execution_count": null,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
},
"pycharm": {
"name": "#%%\n"
}
Expand All @@ -71,6 +113,13 @@
"os.environ[\"OPENAI_API_KEY\"] = getpass.getpass(\"OpenAI API Key:\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -359,9 +408,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.6"
"version": "3.10.12"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
}
8 changes: 8 additions & 0 deletions docs/vercel.json
leo-gan marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
{
"redirects": [
{
"source": "docs/docs/integrations/providers/alibabacloud_opensearch",
"destination": "docs/docs/integrations/providers/alibaba_cloud"
},
{
"source": "/docs/integrations/chat/pai_eas_chat_endpoint",
"destination": "/docs/integrations/chat/alibaba_cloud_pai_eas"
},
{
"source": "/docs/integrations/providers/tencentvectordb",
"destination": "/docs/integrations/providers/tencent"
Expand Down
Loading