Skip to main content

Deterministic regression enforcement for LLM systems.

Project description

Phylax Logo

Phylax

Deterministic regression enforcement for LLM systems.

Python 3.10+ PyPI version License: MIT


The Problem

LLM outputs change unexpectedly. Same prompt, different model version → different behavior. Without Phylax, you discover this in production.

Installation

pip install phylax

For server/UI support:

pip install phylax[server]

For all LLM providers:

pip install phylax[all]

Quick Start

from phylax import trace, expect, execution

@trace(provider="gemini")
@expect(must_include=["refund"], max_latency_ms=1500)
def customer_reply(query):
    return llm.generate(query)

# Track multi-step agent flows
with execution("customer-support-flow"):
    result = customer_reply("I want a refund")
# Mark a known-good response as baseline
phylax bless <trace_id>

# In CI: fail if output regresses
phylax check  # exits 1 on failure

That's it. Your CI now blocks LLM regressions.


What Phylax is NOT

  • Not monitoring — no metrics, no dashboards
  • Not observability — no traces-to-cloud, no analytics
  • Not AI judgment — rules are deterministic, not LLM-based
  • Not cloud-dependent — runs entirely local
  • Not prompt engineering — tests outputs, not prompts

Phylax is a test framework. It tells you when LLM behavior changes.


CI Integration

# .github/workflows/phylax.yml
- run: phylax check
  env:
    GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}

Exit codes:

  • 0 — All golden traces pass
  • 1 — Regression detected

Expectations (Deterministic Rules)

@expect(
    must_include=["word"],       # Required content
    must_not_include=["sorry"],  # Forbidden content
    max_latency_ms=2000,         # Performance gate
    min_tokens=10                # Minimum length
)

All rules are deterministic. No AI judgment. No ambiguity.


Commands

Command What it does
phylax init Initialize config
phylax server Start API server
phylax list List traces
phylax list --failed Show only failed traces
phylax show <id> Show trace details
phylax replay <id> Re-run a trace
phylax bless <id> Mark as golden baseline
phylax check CI regression check

Features

Feature Description
Trace Capture Record every LLM call automatically
Expectations Define PASS/FAIL rules (4 deterministic rules)
Golden Traces Baseline comparisons with hash verification
CI Integration phylax check exits 1 on regression
Execution Graphs Visualize multi-step agent workflows
Forensics Mode Debug failures with guided investigation

Stability Guarantee

Phylax v1.0.0 is API-frozen:

  • No breaking changes in v1.x
  • trace, expect, execution are stable
  • Exit codes are stable
  • Schema is stable

See docs/contract.md for full guarantees.


Documentation


License

MIT License

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

phylax-1.0.0.tar.gz (42.8 kB view details)

Uploaded Source

Built Distribution

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

phylax-1.0.0-py3-none-any.whl (45.6 kB view details)

Uploaded Python 3

File details

Details for the file phylax-1.0.0.tar.gz.

File metadata

  • Download URL: phylax-1.0.0.tar.gz
  • Upload date:
  • Size: 42.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for phylax-1.0.0.tar.gz
Algorithm Hash digest
SHA256 067786f2147878792b95a254319a2ee37b08ec1b75b70af44a283e7f2045290c
MD5 c8b04ae720a5c910e3f881836b4fdd2b
BLAKE2b-256 e5029cc00b3038461b2c6be35bc27f0f4e7acb7ebe7e04d607ae56bc2e79cfb1

See more details on using hashes here.

File details

Details for the file phylax-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: phylax-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 45.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for phylax-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0bc8e52492aebd315f33c7a339c99ddd39e65588109a508187920fbff08f3616
MD5 7f8914148810803307414bd740e71ede
BLAKE2b-256 8344f29bc3183f6299e0884b348618ebd930c3863579d661cb1a9cfc0816443e

See more details on using hashes here.

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