Skip to main content

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:

Installation

pip install llama-index-llms-paieas

Setup

To get started:

  1. Create a free account with Aliyun PAI EAS and login.

  2. 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.

  3. Under the Basic Information, on the Public Address Call tab, click View Call Information, and get the service token PAIEAS_API_KEY and access address PAIEAS_API_BASE.

  4. Copy and save the service token as PAIEAS_API_KEY and access address as PAIEAS_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

llama_index_llms_paieas-0.3.1.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llama_index_llms_paieas-0.3.1-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file llama_index_llms_paieas-0.3.1.tar.gz.

File metadata

  • Download URL: llama_index_llms_paieas-0.3.1.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.10 Darwin/24.1.0

File hashes

Hashes for llama_index_llms_paieas-0.3.1.tar.gz
Algorithm Hash digest
SHA256 4921f51057179e8d002931c4e99182afd856bc6cc2083ec590d4ea1f82e83613
MD5 05f159e92946cd20ffd40eaf903694fa
BLAKE2b-256 9ab315425acc7ea460802c82d6c5fd0bfa47377c8ecccc5652cedc26beb2f2ff

See more details on using hashes here.

File details

Details for the file llama_index_llms_paieas-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_llms_paieas-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f0d5ba4d8f7a05acdee182aa260604bb3af6096ed27b5949cb94b05d147db261
MD5 a986588b5e8467f2ab19f3bbaa45f013
BLAKE2b-256 e6bfa8923fc53d1e2677a5718b72a826458b17929509f37789dfede9b286b186

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page