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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for llama_index_llms_qianfan-0.3.0.tar.gz
Algorithm Hash digest
SHA256 f3eac5686acf4b417474fd8212815456e59e24b0291e9013a23a78dd7dc51553
MD5 464736c61883c7d375574d64487f709b
BLAKE2b-256 826c937995e524ec51b0613a7ec78799b9fdc63a22e8525341097e25a2f5c13a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for llama_index_llms_qianfan-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6bc68a34679f22377631406522feabd514454761bcd6d49192427c19100489bc
MD5 91e69f5c6cc3bb9244d5a6676e7631f3
BLAKE2b-256 50a4272954ebbef33e53310f1d0cf41842f7b2acbb77f2b2b54fe8b4a969e012

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