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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llama_index_llms_qianfan-0.5.0.tar.gz.
File metadata
- Download URL: llama_index_llms_qianfan-0.5.0.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c3388ff239550e6323bad9f3e91f110cae2357895734ea08a5b517f7d00b74b
|
|
| MD5 |
01cf810283dd8f1312422a8568354243
|
|
| BLAKE2b-256 |
e4a7f075b7840b698a4e8dd78c18e37c28b8003f93cc5134ffbd663832ebff34
|
File details
Details for the file llama_index_llms_qianfan-0.5.0-py3-none-any.whl.
File metadata
- Download URL: llama_index_llms_qianfan-0.5.0-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2324c574a14de6daae82d86e11e243aadb83be1724c4f1a3a701cddb0c5f552c
|
|
| MD5 |
5ece17b6cfa4877585a50b7611d4851f
|
|
| BLAKE2b-256 |
e2074e417a0e0b9d83222393d37d3e112ce33916b78f98b719a224f6a4428515
|