Skip to main content

llama-index llms baidu qianfan integration

Project description

LlamaIndex Llms Integration: Baidu Qianfan

Baidu Intelligent Cloud's Qianfan LLM Platform offers API services for all Baidu LLMs, such as ERNIE-3.5-8K and ERNIE-4.0-8K. It also provides a small number of open-source LLMs like Llama-2-70b-chat.

Before using the chat client, you need to activate the LLM service on the Qianfan LLM Platform console's online service page. Then, Generate an Access Key and a Secret Key in the Security Authentication page of the console.

Installation

Install the necessary package:

pip install llama-index-llms-qianfan

Initialization

from llama_index.llms.qianfan import Qianfan

access_key = "XXX"
secret_key = "XXX"
model_name = "ERNIE-Speed-8K"
endpoint_url = "https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/ernie_speed"
context_window = 8192
llm = Qianfan(access_key, secret_key, model_name, endpoint_url, context_window)

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_qianfan-0.4.1.tar.gz (6.0 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_qianfan-0.4.1-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file llama_index_llms_qianfan-0.4.1.tar.gz.

File metadata

File hashes

Hashes for llama_index_llms_qianfan-0.4.1.tar.gz
Algorithm Hash digest
SHA256 1c5211ff61f3461eea20799231f9e4f4ab8d177b621e9f8dd844d6a267512902
MD5 76db42ceea7b185c518e6a583a19c611
BLAKE2b-256 31b528d993c163ec62975f6a7013b8065e9ab0f3ab3c60900bcd7f89035abf53

See more details on using hashes here.

File details

Details for the file llama_index_llms_qianfan-0.4.1-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_llms_qianfan-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6b4e388b4f8da7ff8df38c2b36ae53af4db5c1b22c5831c2c1ef76561841fbea
MD5 8615a7cc887a2ad78c473e872a8ad758
BLAKE2b-256 233388e9aeb25b095f15d99b11b91d4ebe626a3a9097e187b6bf15473e16a548

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