llm-comply
Multi-format LLM API compliance testing tool — validates endpoints against official specs for OpenAI Chat Completions, Open Responses, Anthropic Messages, and Google GenAI.
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
Docker
docker run -p 8090:8090 oaklight/llm-comply:latest
Reference compose.yaml for production deployment:
services:
llm-comply:
image: oaklight/llm-comply:latest
container_name: llm-comply
restart: unless-stopped
ports:
- 127.0.0.1:8090:8090
read_only: true
tmpfs:
- /tmp:size=64m,exec
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
mem_limit: 256m
cpus: 0.5
Note: The binary image uses Nuitka onefile format, which extracts to
/tmpat startup. Thetmpfsmount withexecis required when usingread_only: true.
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.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| llm_comply-0.4.1.tar.gz | 428.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| llm_comply-0.4.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 868.6 kB
Release files / llm_comply-0.4.1.tar.gz
| Download URL | llm_comply-0.4.1.tar.gz |
|---|---|
| Size | 428.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7504baf193dc91902462fbe74ebeb7f2f6aa1d9333b2de82efb39a332b251efd
|
|
BLAKE2b-256 checksum How to use checksums |
1285dd60cb4200c30842b737022e050597fc83886e82f675e41d4a6805062443
|
| 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 Sep 3, 2026.
Transparency logRelease files / llm_comply-0.4.1-py3-none-any.whl
| Download URL | llm_comply-0.4.1-py3-none-any.whl |
|---|---|
| Size | 440.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
442c02adc7ce56c2849b0873d78b4a4f28d64d97712849898210397a41d65a75
|
|
BLAKE2b-256 checksum How to use checksums |
b8d960cc5d06df73db17c7435c11513ee7db891dfae7a9687faa4308bc096aea
|
| 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 Sep 3, 2026.
Transparency log