Skip to main content

PyPI - Version PyPI - Downloads

atif

Pydantic models for the Agent Trajectory Interchange Format (ATIF), a standardized JSON schema for logging the complete interaction history of autonomous LLM agents (user messages, agent responses, tool calls, observations, metrics, and embedded subagent trajectories). Implements ATIF v1.8. This project is independent and not an official implemention.

Install

pip install atif

Usage

from atif import Trajectory

data = {
    "schema_version": "ATIF-v1.8",
    "agent": {"name": "my-agent", "version": "1.0.0", "model_name": "claude-sonnet-4-6"},
    "steps": [
        {"step_id": 1, "source": "user", "message": "What time is it?"},
        {
            "step_id": 2,
            "source": "agent",
            "message": "Let me check.",
            "tool_calls": [
                {"tool_call_id": "c1", "function_name": "now", "arguments": {}}
            ],
            "observation": {
                "results": [{"source_call_id": "c1", "content": "2026-05-16T12:00:00Z"}]
            },
            "metrics": {"prompt_tokens": 120, "completion_tokens": 18},
        },
    ],
}

trajectory = Trajectory.model_validate(data)
print(trajectory.steps[1].tool_calls[0].function_name)  # "now"
print(trajectory.to_json_dict(exclude_none=True))

Validation enforces the ATIF rules: sequential step_ids, ISO 8601 timestamps, agent-only fields gated on source == "agent", tool-call, observation correlation, embedded-subagent trajectory_id uniqueness, and ContentPart text/source XOR with the source kind matching type.

Versioning

atif's MAJOR.MINOR tracks the ATIF RFC version it implements (1.8.x ⇔ ATIF v1.8); PATCH is reserved for library-only fixes.

AI disclosure

Parts of this project, including code, tests, and documentation, were written with the assistance of AI tooling. Readers should be aware that AI was involved in its production.

Metadata

Release files for atif 1.8.0

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

Source distribution (sdist)

Source distribution for atif 1.8.0
File Size Uploaded
atif-1.8.0.tar.gz 10.0 kB Details

Built distribution (wheel)

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

Total release size: 22.9 kB

Release files / atif-1.8.0.tar.gz

Download URL atif-1.8.0.tar.gz
Size 10.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f5b07100f9bf93d035f0b6103e6dbd7f0a90d9308eaaf610044ddd8cd3e50858
BLAKE2b-256 checksum
How to use checksums
802588f175844855543a26cf9d7812df1ea0ca7ccdb6ec965c8f13a8daa248cc
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 11, 2026.

Transparency log

Release files / atif-1.8.0-py3-none-any.whl

Download URL atif-1.8.0-py3-none-any.whl
Size 12.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b002ade91e50a5925e6f540adc0f5f5cdc6afdd806efc6282b69f03d461958cc
BLAKE2b-256 checksum
How to use checksums
88370326a9f875b0acbd4d065a93e26ec7cbb5c148375221051f83b5847e812e
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 11, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.8.0 This release

2 release files

1.7.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