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.0.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.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for llama_index_llms_qianfan-0.4.0.tar.gz
Algorithm Hash digest
SHA256 660786d69bdf3e57f5a4a43df3c3541e7f348e139462d639aa5603df52b948db
MD5 90900fe9d964eeb6b09e73111d929fe5
BLAKE2b-256 e97975b1126762a9d102d3d83c0c41a3c9f7e6a112968b067e3a6a526a7c2fd6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for llama_index_llms_qianfan-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 66c2c4cf090f449c68f50a7d8ee912ad3f8dc5a50712776451ec3592001d36f5
MD5 0d78ddd3fa393356f1ee4c123a944f3b
BLAKE2b-256 84143e1eb1f0f8e0bf3c6464148035cdf1f1459f5e1733f0175e94b79a38a5db

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