Skip to main content

llama-index-llms-idemcore

LlamaIndex LLM for the Idemcore API. Every answer comes with a signed, independently verifiable, bit-exact receipt, stored on ChatResponse.additional_kwargs and message.additional_kwargs["idemcore"].

Install guide: https://idemcore.net/integrations/llamaindex

Install

pip install llama-index-llms-idemcore
export IDEMCORE_API_KEY=ick_...

Requires idemcore>=0.3.1 (r2 receipts). Optional: pip install "llama-index-llms-idemcore[verify]" adds the open verifier idemcore-verify>=0.4.0 to check format v2 logs.

Quickstart

from llama_index.core.base.llms.types import ChatMessage, MessageRole
from llama_index.llms.idemcore import IdemcoreLLM, verify_llamaindex_receipt

llm = IdemcoreLLM(model="your-model-id", 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"])  # rcpt_...

# bundle = verify_llamaindex_receipt(response, log_text=log_text)
# print(bundle.ok)

complete(prompt) sends the prompt as a single user message. Streaming (stream_chat, stream_complete) yields text deltas and attaches the receipt on the final item, once the answer is complete.

Tool calling

Since 0.1.3, IdemcoreLLM is a FunctionCallingLLM: chat_with_tools, predict_and_call and LlamaIndex agents send OpenAI-format tools to every hosted model. Tool calls are on response.message.additional_kwargs["tool_calls"] (read them with get_tool_calls_from_response), and every answer, including one that calls a tool, still carries a signed receipt.

from llama_index.core.base.llms.types import ChatMessage, MessageRole
from llama_index.core.tools import FunctionTool
from llama_index.llms.idemcore import IdemcoreLLM, verify_llamaindex_receipt

def get_weather(city: str) -> str:
    """Get the current weather for a city."""
    return '{"city": "Hanoi", "temp_c": 24, "condition": "light rain"}'

weather = FunctionTool.from_defaults(fn=get_weather)
llm = IdemcoreLLM(model="qwen3.6-35b-a3b-idna", max_tokens=128)

history = [ChatMessage(role=MessageRole.USER, content="What is the weather in Hanoi right now?")]
first = llm.chat_with_tools([weather], chat_history=history)
call = llm.get_tool_calls_from_response(first)[0]  # get_weather {'city': 'Hanoi'}

history += [first.message, ChatMessage(role=MessageRole.TOOL, content=get_weather(**call.tool_kwargs),
                                       additional_kwargs={"tool_call_id": call.tool_id})]
final = llm.chat_with_tools([weather], chat_history=history)
print(final.message.content)
print(verify_llamaindex_receipt(final).ok)  # True
  • tool_required=True sends tool_choice: "required"; tool_choice also accepts "none" or a tool name.
  • stream_chat_with_tools accumulates the tool calls; the receipt arrives on the final item.
  • For requests sent with tools, the receipt payload also holds prompt_messages and output_token_ids; the verify helper uses them.
  • In auto mode a model may occasionally answer a live-data question itself instead of calling your tool. Use tool_required=True when a call must happen.

Sampling

Idemcore decoding is greedy: temperature is fixed at 0. Other sampling settings (top_p, top_k, penalties, seed, n, stop sequences) and the legacy functions API are rejected. max_tokens must be a whole number from 1 to 2048. Auth is IDEMCORE_API_KEY. Billing is measured server-side in tokens.

Tests

pip install -e ".[dev]"
pytest

Unit tests mock the SDK. A live smoke test runs only when IDEMCORE_API_KEY is set in the environment.

Metadata

Release files for llama-index-llms-idemcore 0.1.4

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-idemcore 0.1.4
File Size Uploaded Provenance Actions
llama_index_llms_idemcore-0.1.4.tar.gz 17.0 kB Without provenance Details for llama_index_llms_idemcore-0.1.4.tar.gz

Built distribution (wheel)

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

Total release size: 31.9 kB

Release files / llama_index_llms_idemcore-0.1.4.tar.gz

Download URL llama_index_llms_idemcore-0.1.4.tar.gz
Size 17.0 kB
Tags Source
SHA-256 checksum
How to use checksums
380aa32dccc54e71e4a5e7fcaa1f1b87c0c01e3be7959033e6342f5d9154c37d
BLAKE2b-256 checksum
How to use checksums
5c02f6ae3ee471214f52ef08ecb21acf887417cf8f5cf90da3bc5b22664a652f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Release files / llama_index_llms_idemcore-0.1.4-py3-none-any.whl

Download URL llama_index_llms_idemcore-0.1.4-py3-none-any.whl
Size 14.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
061d978e1c5122ff24f1882951e7d724e1581db10e80f30b8ea7372483f5e1a3
BLAKE2b-256 checksum
How to use checksums
0979089acc3434ef212be18d3a08210617f499c4cd3cb6ddbd8a0ab243b30425
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Security for llama-index-llms-idemcore 0.1.4

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.

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files No provenance

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