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.2.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.2.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: llama_index_llms_qianfan-0.2.0.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.13 Darwin/23.6.0

File hashes

Hashes for llama_index_llms_qianfan-0.2.0.tar.gz
Algorithm Hash digest
SHA256 8dc1632cc68bbed656ec7022214b006f3dc2950b91b72ce3732d23bf5e63de75
MD5 1bd105fbbd562185150631fa78b61954
BLAKE2b-256 6b991462a87529c583d7ee8b72015e2b27b7963444ca44d14012eacfeaf65dff

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for llama_index_llms_qianfan-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a3229b90398acb5272b56592bb74655bf1d47daa8d45f8c03269bf58cf48d222
MD5 05bac28b1e3aaad97c17d14aa90f5e30
BLAKE2b-256 8c2f0e6c2c531315861cd7b441063a008b0c3700796e064d53c1f4233f51593d

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