invera SDK
Stream complete text and tool-call fragments with word-level input and output attributions. The SDK handles Engine discovery, tokenizer parity, chat-template rendering, raw NDJSON transport, token-to-word aggregation, claim evidence, and pre-execution tool-call assessment.
Start here
- Install the SDK and stream your first completion
- Add evidence to text responses
- Validate and gate tool calls
- Understand attribution and evidence
- TypeScript
- Python
import { InveraClient } from "@layerwise/invera-sdk";
const client = new InveraClient({
baseUrl: process.env.INVERA_BASE_URL!,
});
for await (const chunk of client.chat.completions.stream({
messages: [{ role: "user", content: "What is attention attribution?" }],
maxTokens: 256,
})) {
console.log(chunk.content, chunk.input_attributions);
}
from invera_sdk import ChatMessage, CompletionRequest, InveraClient
client = InveraClient("https://host.example/api/invera-engine/v1")
for chunk in client.chat.completions.stream(
CompletionRequest(
messages=[ChatMessage("user", "What is attention attribution?")],
max_tokens=256,
)
):
print(chunk.content, chunk.input_attributions)
Compatibility
- SDK version:
0.4.1 - Supported Engine Contract range:
>=1.2.0 <2.0.0 - Developed by:
layerwise(Layerwise GmbH)
Released SDK versions are available from the version selector in the navigation bar.