Skip to main content

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)

Metadata

Release files for llama-index-llms-qianfan 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for llama-index-llms-qianfan 0.6.0
File Size Uploaded Provenance Actions
llama_index_llms_qianfan-0.6.0.tar.gz 6.0 kB Without provenance Details for llama_index_llms_qianfan-0.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for llama-index-llms-qianfan 0.6.0
File Interpreter ABI Platform Actions
llama_index_llms_qianfan-0.6.0-py3-none-any.whl Python 3 none any Details for llama_index_llms_qianfan-0.6.0-py3-none-any.whl

Total release size: 11.6 kB

Release files / llama_index_llms_qianfan-0.6.0.tar.gz

Download URL llama_index_llms_qianfan-0.6.0.tar.gz
Size 6.0 kB
Tags Source
SHA-256 checksum
How to use checksums
bfd024f09507b8209acee0350bcc4ac9b7286db3d92cca2a324a1ea1a35ad80d
BLAKE2b-256 checksum
How to use checksums
8673ec70af65f56baf746b64ef9dc2abecc4d2bc369a6f308e163e27c9135fc7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / llama_index_llms_qianfan-0.6.0-py3-none-any.whl

Download URL llama_index_llms_qianfan-0.6.0-py3-none-any.whl
Size 5.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d9ec98fea8c4843dbdc32ce830d82c2eec21116067f5c9775aa2d48b0e3c81f2
BLAKE2b-256 checksum
How to use checksums
5bd7ebbf9a7feb32e8f646fd4ba5c8891cb401903da21bcf9ec7af6905251dff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for llama-index-llms-qianfan 0.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page