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.

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.1.0.tar.gz (358.3 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.1.0-py3-none-any.whl (368.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: llm_comply-0.1.0.tar.gz
  • Upload date:
  • Size: 358.3 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.1.0.tar.gz
Algorithm Hash digest
SHA256 0a623d2c476566cb04bedd0c83b2f557d8aa4e17146f2ece4639fc7daeeae761
MD5 7ad4036a9e102a6a9b4c3a982dafab44
BLAKE2b-256 868512212d95adde752fbcdd83c3bfdbd24ef582541b0d4f7f6613a0daa663ea

See more details on using hashes here.

Provenance

The following attestation bundles were made for llm_comply-0.1.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.1.0-py3-none-any.whl.

File metadata

  • Download URL: llm_comply-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 368.1 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9784db1f3a95add42e795ec41517f2b5481cfc496f4a7117d9c61bbda30e325e
MD5 9c8233ee43e8fd49de6f91a6eacb7172
BLAKE2b-256 91660d51b24b21603aa4e914a9c741ed4d343b31aac45e6014f031884aa60a60

See more details on using hashes here.

Provenance

The following attestation bundles were made for llm_comply-0.1.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