llama-index llms aliyun paieas integration
Project description
LlamaIndex Llms Integration: Aliyun-PaiEas
The llama-index-llms-paieas package contains LlamaIndex integrations building applications with models on
Aliyun PAI-EAS(Elastic Algorithm Service) (Chinese Version)LLM inference service.
The Elastic Algorithm Service (EAS) is a model online service platform that allows you to deploy models as online reasoning services or AI-Web applications with one click. It provides functions such as elastic scaling and blue-green deployment, which can support you to obtain high-concurrency and stable online algorithm model services at a lower resource cost. In addition, EAS also provides functions such as resource group management, version control, and resource monitoring, which facilitates you to apply model services to your business. EAS is suitable for a variety of AI reasoning scenarios such as real-time synchronous reasoning and near-real-time asynchronous reasoning, and has the capabilities of a complete operation and maintenance monitoring system.
PAI EAS's LLM Service
This example goes over how to use LlamaIndex to interact with and develop LLM-powered systems using the PAI-EAS LLM service endpoints.
With this endpoint, you'll be able to connect to various open-source LLM, such as:
- Tongyi's qwen
- Google's gemma-7b
- Mistal AI's mistral-7b-instruct-v0.2
- And more!
Installation
pip install llama-index-llms-paieas
Setup
To get started:
-
Create a free account with Aliyun PAI EAS and login.
-
Refer the guide(https://help.aliyun.com/zh/pai/use-cases/deploy-llm-in-eas?spm=a2c4g.11186623.0.0.63de3c57Ef3r3C#f3ef8927ec4l2), on the EAS page, click Deploy LLM Service.
-
Under the Basic Information, on the Public Address Call tab, click View Call Information, and get the service token
PAIEAS_API_KEYand access addressPAIEAS_API_BASE. -
Copy and save the service token as
PAIEAS_API_KEYand access address asPAIEAS_API_BASE.
import os
os.environ["PAIEAS_API_KEY"] = your_service_token
os.environ["PAIEAS_API_BASE"] = your_access_address
Working with API Catalog
from llama_index.llms.paieas import PaiEas
from llama_index.core.llms import ChatMessage, MessageRole
llm = PaiEas()
messages = [
ChatMessage(
role=MessageRole.SYSTEM, content=("You are a helpful assistant.")
),
ChatMessage(
role=MessageRole.USER,
content=("What is Alibaba Cloud?"),
),
]
llm.chat(messages)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llama_index_llms_paieas-0.1.0.tar.gz.
File metadata
- Download URL: llama_index_llms_paieas-0.1.0.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.5.0-1025-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
81430439a4afa70c730c889562cfefe8eafae427cbc282a140693053bf084519
|
|
| MD5 |
bf834befe6f66bb247b7da20797c0b28
|
|
| BLAKE2b-256 |
8df1e4d407c6c5c8b0bb8be01b5bdd7fe2e0541295d10be0fa9ea62391b9757b
|
File details
Details for the file llama_index_llms_paieas-0.1.0-py3-none-any.whl.
File metadata
- Download URL: llama_index_llms_paieas-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.5.0-1025-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
24d6d326f9d6b109d5cda333ac76a3ff897c8da2a6a11cce97131509d0c4de3e
|
|
| MD5 |
e284c987a2498033141365fa16db5f38
|
|
| BLAKE2b-256 |
5f8587a3405e3ebca23194261eb05e0675b0ad82dcd87acb050a4edc607762d8
|