Skip to main content

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

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llm_comply-0.2.0.tar.gz (375.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llm_comply-0.2.0-py3-none-any.whl (385.3 kB view details)

Uploaded Python 3

File details

Details for the file llm_comply-0.2.0.tar.gz.

File metadata

  • Download URL: llm_comply-0.2.0.tar.gz
  • Upload date:
  • Size: 375.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for llm_comply-0.2.0.tar.gz
Algorithm Hash digest
SHA256 0b362d1ff28850851bdd0eee0b38db83ce0d7601b442fa31ed18747ee9944b9a
MD5 113e368b625d1c50ad3ae51d99dd9e47
BLAKE2b-256 e3c5d6a764c30118252d0a89a9d697faf5cfd48dfb0a070bbec45623e9ac0e68

See more details on using hashes here.

Provenance

The following attestation bundles were made for llm_comply-0.2.0.tar.gz:

Publisher: release.yml on Oaklight/llm-comply

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file llm_comply-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: llm_comply-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 385.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for llm_comply-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7295cfb6e88cc29736a6bbba2dc83e05e7e19e7e31e114c099f340d5a6f5b8fe
MD5 55e9d2f523711a5f8222721b0d52f558
BLAKE2b-256 d97288f68fa2dda4a22652f89debfeb5acf14038231ebc8808ca9c33a4bdbb64

See more details on using hashes here.

Provenance

The following attestation bundles were made for llm_comply-0.2.0-py3-none-any.whl:

Publisher: release.yml on Oaklight/llm-comply

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page