Skip to main content

llm-comply

PyPI CI Python License

Multi-format LLM API compliance testing tool — validates endpoints against official specs for OpenAI Chat Completions, Open Responses, Anthropic Messages, and Google GenAI.

Try it online →

Install

pip install llm-comply
# For colored terminal output:
pip install llm-comply[rich]

Quick Start

# Open Responses (default)
llm-comply -u https://api.openai.com/v1 -k $OPENAI_API_KEY -m gpt-4o-mini

# OpenAI Chat Completions
llm-comply --format openai-chat -u https://api.openai.com/v1 -k $OPENAI_API_KEY -m gpt-4o-mini

# Anthropic Messages
llm-comply --format anthropic -u https://api.anthropic.com/v1 -k $KEY -m claude-haiku-4-5 \
  --auth-header x-api-key --no-bearer -H anthropic-version:2023-06-01

# Google GenAI
llm-comply --format google-genai -u https://generativelanguage.googleapis.com -k $KEY \
  -m gemini-2.5-flash --auth-header x-goog-api-key --no-bearer

Options

-u, --base-url URL     API base URL (required)
-k, --api-key KEY      API key (or set OPENRESPONSES_API_KEY env)
-m, --model MODEL      Model name (default: gpt-4o-mini)
--format FORMAT        API format: open-responses, openai-chat, anthropic, google-genai
-f, --filter IDS       Comma-separated test IDs to run
-i, --ignore PATTERNS  Ignore errors matching substrings (e.g. refusal,verbosity)
-H, --header K:V       Extra headers (e.g. anthropic-version:2023-06-01)
--auth-header NAME     Auth header name (default: Authorization)
--no-bearer            Don't prepend "Bearer " to API key
-v, --verbose          Show request/response on failure
--json                 JSON output for CI
--list                 List available test IDs

Test Coverage

Format Tests What's Validated
Open Responses 12 Schema + semantic (lifecycle, phases, compaction)
OpenAI Chat 8 Schema + semantic (choices, finish_reason, delta)
Anthropic Messages 8 Schema + semantic (content blocks, stop_reason)
Google GenAI 8 Semantic only (candidates, parts, finishReason)

License

MIT

Metadata

Release files for llm-comply 0.4.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 llm-comply 0.4.0
File Size Uploaded
llm_comply-0.4.0.tar.gz 427.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for llm-comply 0.4.0
File Interpreter ABI Platform
llm_comply-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 867.7 kB

Release files / llm_comply-0.4.0.tar.gz

Download URL llm_comply-0.4.0.tar.gz
Size 427.5 kB
Tags Source
SHA-256 checksum
How to use checksums
f6ba9b06db02a5ec5c10caae9a8062d39ffec5271ce285eb5488e2c60b9bed11
BLAKE2b-256 checksum
How to use checksums
6472607b30bfb1dcb54fe10690ab43b341717e0928bf001d0494dd8f83f6a394
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 Aug 29, 2026.

Transparency log

Release files / llm_comply-0.4.0-py3-none-any.whl

Download URL llm_comply-0.4.0-py3-none-any.whl
Size 440.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0355adff4c783f15290b52b4aca81e7c71ad9cfa5dad4a1ae1533ccbeac07c30
BLAKE2b-256 checksum
How to use checksums
686304e0fc39389aa2481f02c8b8d05f23f49260a5c0b272b86478ff978bfa18
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 Aug 29, 2026.

Transparency log

Release history Release notifications | RSS feed

0.5.0

2 release files

0.4.1

2 release files

This release

0.4.0 This release

2 release files

0.3.0

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