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.1.0.tar.gz (4.7 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.1.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: llama_index_llms_qianfan-0.1.0.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.10.12 Darwin/22.3.0

File hashes

Hashes for llama_index_llms_qianfan-0.1.0.tar.gz
Algorithm Hash digest
SHA256 25ed4f3faa0ffee0df6b0a125c5460a239a5e32e85d0d42088f11e5068f48173
MD5 8a28e31c057492d18edad7c40ae4c785
BLAKE2b-256 722b0f11914410f9e762909d0c2403108d2115f679392dcf5a4f10a309b45311

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for llama_index_llms_qianfan-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5e00c8ec2e5accd32099f3acb13e8da154a568882e457190741dccbf5ce0051f
MD5 dc2f925b73981e1c3e7ef79c6622a369
BLAKE2b-256 c2c4d6692c79d8a2eb9169c61c0be16445fb30335b8e53088e981496b622dec3

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