HomeTrang chủ · IntegrationsTích hợp · LlamaIndexLlamaIndex
Idemcore for LlamaIndexIdemcore cho LlamaIndex
A LlamaIndex LLM that returns a signed, independently verifiable receipt with every response.LLM LlamaIndex, mỗi phản hồi kèm biên nhận có chữ ký, kiểm chứng được độc lập.
llama-index-llms-idemcore is a LlamaIndex LLM for the Idemcore API. Every answer includes a signed, independently verifiable receipt on the response metadata.llama-index-llms-idemcore là LLM LlamaIndex cho API Idemcore. Mỗi câu trả lời kèm biên nhận có chữ ký, kiểm chứng được độc lập, nằm trong metadata phản hồi.
Install stepsCác bước cài đặt
- 1Install Python 3.9 or newer.Cài Python 3.9 trở lên.
- 2Run pip install llama-index-llms-idemcore.Chạy pip install llama-index-llms-idemcore.
- 3Export IDEMCORE_API_KEY and call IdemcoreLLM.chat or complete.Xuất IDEMCORE_API_KEY và gọi IdemcoreLLM.chat hoặc complete.
- 4Check the receipt with verify_llamaindex_receipt.Kiểm biên nhận bằng verify_llamaindex_receipt.
PrerequisitesĐiều kiện cần
- Python 3.9 or newer.
- An Idemcore API key in
IDEMCORE_API_KEY. - The package depends on
idemcore0.3 or newer andidemcore-verify0.3.6 or newer (installed automatically).
- Python 3.9 trở lên.
- Khóa API Idemcore trong
IDEMCORE_API_KEY. - Gói phụ thuộc
idemcore0.3 trở lên vàidemcore-verify0.3.6 trở lên (được cài kèm).
A minimal working exampleVí dụ tối thiểu chạy được
A short chat that prints the receipt id and checks the receipt locally:Một cuộc chat ngắn, in mã biên nhận và kiểm biên nhận tại chỗ:
import os
from llama_index.core.base.llms.types import ChatMessage, MessageRole
from llama_index.llms.idemcore import IdemcoreLLM, verify_llamaindex_receipt
# export IDEMCORE_API_KEY=ick_…
llm = IdemcoreLLM(model="qwen3.8-27b-idna", max_tokens=64)
response = llm.chat([
ChatMessage(role=MessageRole.USER, content="Name the three primary colours."),
])
print(response.message.content)
print(response.additional_kwargs["receipt_id"])
bundle = verify_llamaindex_receipt(response)
print(bundle.ok)complete(prompt) sends the prompt as a single user message. Streaming (stream_chat, stream_complete) yields text as it arrives; the receipt is attached on the final item.complete(prompt) gửi prompt như một tin nhắn người dùng. Streaming (stream_chat, stream_complete) trả dần văn bản; biên nhận được gắn ở phần tử cuối.
Options and configurationTùy chọn và cấu hình
The receipt is stored on ChatResponse.additional_kwargs and message.additional_kwargs["idemcore"], including receipt_id and the full signed receipt. verify_llamaindex_receipt checks it on your machine. Decoding is greedy (temperature 0). Other sampling settings and tool calling are rejected. max_tokens is 1 to 2048.
Biên nhận được lưu trên ChatResponse.additional_kwargs và message.additional_kwargs["idemcore"], gồm receipt_id và toàn bộ biên nhận có chữ ký. verify_llamaindex_receipt kiểm trên máy bạn. Giải mã là greedy (temperature 0). Các thiết lập lấy mẫu khác và gọi công cụ bị từ chối. max_tokens từ 1 đến 2048.
TroubleshootingXử lý sự cố
The import path is not found.Không tìm thấy đường dẫn import.
Install pip install llama-index-llms-idemcore and import from llama_index.llms.idemcore.Cài pip install llama-index-llms-idemcore và import từ llama_index.llms.idemcore.
A sampling setting is rejected.Một thiết lập lấy mẫu bị từ chối.
Leave temperature at 0 and do not set top_p, penalties or tool calling.Hãy để temperature ở 0 và đừng đặt top_p, penalty hoặc gọi công cụ.
Version and changelogPhiên bản và nhật ký thay đổi
Current published version: 0.1.0.Phiên bản đang phát hành: 0.1.0.
See the version on PyPI, and the site changelog.Xem phiên bản trên PyPI, và nhật ký thay đổi trên site.
SupportHỗ trợ
Questions about install, API keys or receipts: support@idemcore.net. Security reports: security@idemcore.net. Sales and pilots: dev@idemcore.net.Câu hỏi về cài đặt, khóa API hoặc biên nhận: support@idemcore.net. Báo cáo bảo mật: security@idemcore.net. Bán hàng và thí điểm: dev@idemcore.net.
support@idemcore.net · Contact page →Trang liên hệ →
Package registryKho gói
How to get an API keyCách lấy khóa API
IdemcoreLLM reads IDEMCORE_API_KEY. verify_llamaindex_receipt checks a saved response locally.IdemcoreLLM đọc IDEMCORE_API_KEY. verify_llamaindex_receipt kiểm phản hồi đã lưu ngay trên máy.
To create a key, sign in to the console and create an API key. It starts with ick_ and is shown once, so keep it on your server. Then set IDEMCORE_API_KEY in the environment.Để tạo khóa, đăng nhập console và tạo khóa API. Khóa bắt đầu bằng ick_ và chỉ hiện một lần, hãy giữ nó ở phía máy chủ. Sau đó đặt IDEMCORE_API_KEY trong biến môi trường.
Get a key on this site →Lấy khóa trên trang này → Open the console →Mở console →
How to check a receiptCách kiểm biên nhận
Call verify_llamaindex_receipt on the response, or open a public share on the receipt page at idemcore.net/r/.Gọi verify_llamaindex_receipt trên phản hồi, hoặc mở bản chia sẻ công khai trên trang biên nhận tại idemcore.net/r/.
You can also open a public share on the receipt page, or use the check page on this site.Bạn cũng có thể mở bản chia sẻ công khai trên trang biên nhận, hoặc dùng trang kiểm trên site này.
Receipt page →Trang biên nhận → Check a receipt →Kiểm một biên nhận →