HILT Logo
v0.2.8 - Open Source

HILT

Human-AI Log Tracing

Open-source and privacy-first format for logging human-AI interactions. One line of code to capture all your LLM calls.

pip install hilt-python
PyPIGitHub

Features

Privacy-first

Your data stays in your environment. GDPR compliant.

One-line setup

A single line of code to instrument all your LLM calls.

Auto-instrumentation

Automatic support for OpenAI SDK. Anthropic and Gemini coming soon.

Flexible backends

Local JSONL export or real-time Google Sheets.

Quick Start

from hilt import instrument, uninstrument
from openai import OpenAI

# Enable automatic logging
instrument(backend="local", filepath="logs/chat.jsonl")

client = OpenAI()
response = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[{"role": "user", "content": "Hello!"}],
)

print(response.choices[0].message.content)

# Stop logging when done
uninstrument()

After calling instrument(), all prompts and completions are automatically logged with latency, tokens, cost and status codes.

Available columns

Select the columns you need for compliance or dashboards.

ColumnDescription
timestampISO timestamp (UTC)
conversation_idStable thread identifier
event_idUnique event UUID
speakerhuman / agent
actionType: prompt, completion, system
messageNormalized content (500 chars max)
tokens_inPrompt tokens
tokens_outCompletion tokens
cost_usdMonetized cost (6 decimals)
latency_msWall-clock latency
modelProvider/model label

Storage options

Local JSONL (default)

instrument(
  backend="local",
  filepath="logs/app.jsonl"
)
  • Privacy-first: local data
  • Compatible with Pandas, Spark, etc.

Google Sheets (real-time)

instrument(
  backend="sheets",
  sheet_id="1abc...",
  credentials_path="creds.json"
)
  • Ideal for support, QA, costs
  • Install: pip install "hilt[sheets]"

Roadmap

OpenAI SDK auto-instrumentation
Anthropic Claude auto-instrumentation
Google Gemini auto-instrumentation
LangGraph auto-instrumentation

Apache 2.0 License - Maintained by mcsEdition

ailoggingllmprivacygdpropenai

Python 3.10+ required

mcsÉdition — Where ideas take shape