Metadata-Version: 2.4
Name: llama-index-llms-idemcore
Version: 0.1.0
Summary: LlamaIndex LLM for Idemcore, with signed verifiable receipts in response metadata.
Author-email: Don Wick <don.wick@idemcore.net>
License-Expression: Apache-2.0
Project-URL: Homepage, https://idemcore.net
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: idemcore<0.4,>=0.3.0
Requires-Dist: idemcore-verify<0.4,>=0.3.6
Requires-Dist: llama-index-core>=0.12.0
Provides-Extra: dev
Requires-Dist: pytest>=8; extra == "dev"
Requires-Dist: pytest-asyncio>=0.24; extra == "dev"

# llama-index-llms-idemcore

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

Private package. Do not publish to PyPI without explicit approval.

## Install (local)

```bash
pip install -e /workspace/idemcore-integrations/packages/llama-index-llms-idemcore
export IDEMCORE_API_KEY=ick_...
```

Requires `idemcore>=0.3` (r2 receipts) and `idemcore-verify>=0.3.6`.

## Quickstart

```python
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.

## Sampling

Idemcore decoding is greedy: **temperature is fixed at 0**. Other sampling
settings (`top_p`, `top_k`, penalties, `seed`, `n`, stop sequences) and tool
calling 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

```bash
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.
