Skip to main content

hajer — the Python SDK

Your application's model calls, as traces the Hajer platform stores and shows: every request a trace, every model call a generation under it, every conversation a session you can read top to bottom. And hajer eval: the repository's promptfoo suites, run on a pinned engine in CI and reported to the platform against the workflows and obligations they cover.

This package does not run your application, does not sit in your provider path and decides nothing on your behalf. It records what the application already does and exports it over OpenTelemetry.

Documentation: docs.hajer.ai

Install

pip install "hajer[otel]"          # the SDK with the OpenTelemetry exporter: what a production app installs
pip install hajer                  # httpx + pydantic only: records locally, exports nothing (no OTel SDK)
pip install "hajer[evals]"         # `hajer eval`: run promptfoo suites on the pinned engine (Node >= 22.22 on PATH)

Python ≥ 3.11.

Configure

Variable Required Meaning
HAJER_API_KEY yes Your team API key.
HAJER_TEAM_ID yes The team the traces belong to.
HAJER_BASE_URL no The service. Defaults to https://api.hajer.ai.

In the Hajer app, Settings → API keys → Create key shows all three as a .env block. Without a key and team id the SDK is inert: every call is still recorded locally, nothing opens a socket, nothing raises. Every other setting is in Configuration.

Quickstart

import hajer
from openai import OpenAI

hajer.instrument()                      # every provider client built from here on records its model calls
client = OpenAI()                       # (or: client = hajer.wrap(OpenAI()) where you build it)

@hajer.workflow("answer-support-question")      # the unit the platform shows a trace as
def handle_ticket(ticket):
    with hajer.session(ticket.conversation_id), hajer.user(ticket.customer_id):
        reply = client.chat.completions.create(
            model="gpt-5", messages=[{"role": "user", "content": ticket.question}]
        ).choices[0].message.content
    return reply

Each handle_ticket call is one trace: a workflow answer-support-question span with a chat gpt-5 generation under it, and session.id / user.id on both. openai, anthropic, langchain-openai, langchain-anthropic, litellm and google-genai are supported, sync and async, streamed and not. Run hajer doctor when nothing arrives.

Evals

hajer eval            # runs every suite hajer.yaml declares, on the pinned promptfoo
hajer eval --upload   # and reports each run to the platform

Documentation

  • Telemetry: instrumenting clients, workflows, sessions, export, redaction, configuration, the command line and the API reference.
  • Evals: hajer eval, hajer.yaml, test metadata, providers, uploading, CI and the engine.
  • Changelog · Contributing

License

MIT.

Metadata

Release files for hajer 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hajer 0.2.1
File Size Uploaded
hajer-0.2.1.tar.gz 265.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hajer 0.2.1
File Interpreter ABI Platform
hajer-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 553.9 kB

Release files / hajer-0.2.1.tar.gz

Download URL hajer-0.2.1.tar.gz
Size 265.0 kB
Tags Source
SHA-256 checksum
How to use checksums
5e77fc3944e2c3f0996fd54a3c9114086ed246a326df1901bf7b1625a0c25958
BLAKE2b-256 checksum
How to use checksums
9d7ac27dd10fb9320654a5b6e07cb39891188cd0e7118a82c4e3bc49fff5fe12
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.

Transparency log

Release files / hajer-0.2.1-py3-none-any.whl

Download URL hajer-0.2.1-py3-none-any.whl
Size 288.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3cd352ff0d3696317418456053b09a80fb39735b92af1f4e4df6423b4919fbbc
BLAKE2b-256 checksum
How to use checksums
f407f42cd55cad6c3d5e5b4fa057d2dcddc7b58c3e0bdf202c83667205d409bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.0

2 release files

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