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

import phylax
from phylax._internal.decorator import trace
from phylax._internal.context import execution
from phylax._internal.adapters.gemini import GeminiAdapter

# add google api key
@trace(provider="gemini")
def ask_gemini(prompt: str):
    """Traced Gemini call."""
    adapter = GeminiAdapter()
    response, _ = adapter.generate(
        prompt=prompt,
        model="gemini-2.5-flash",
    )
    return response

# Single call
result = ask_gemini("Hello!")
print(result.text)

# Track multi-step agent flows
with execution() as exec_id:
    step1 = ask_gemini("What is 2+2?")
    step2 = ask_gemini("Is that correct?")
# Start the UI server
phylax server
# Open http://127.0.0.1:8000/ui

# 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.


Using the Web UI

pip install phylax[server]
phylax server
# Open http://127.0.0.1:8000/ui

The UI shows:

  • Trace list with pass/fail status
  • Execution graphs for multi-step flows
  • Forensics mode for debugging

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

Commands

Command What it does
phylax init Initialize config
phylax server Start API server + UI
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
Execution Context Group traces by execution() context
Golden Traces Baseline comparisons with hash verification
CI Integration phylax check exits 1 on regression
Web UI View traces at http://127.0.0.1:8000/ui
Forensics Mode Debug failures with guided investigation

Stability Guarantee

Phylax v1.x is API-frozen:

  • No breaking changes in v1.x
  • trace, 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.1.1.tar.gz (6.8 MB view details)

Uploaded Source

Built Distribution

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

phylax-1.1.1-py3-none-any.whl (6.8 MB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for phylax-1.1.1.tar.gz
Algorithm Hash digest
SHA256 b0329c78ac0caffd9ee001483122b0537d760d24418065cb3f1459020b918f63
MD5 15f9e0e8f559b17a47ae477344694672
BLAKE2b-256 a24134fb2b9da5d09b6f96a8bfe89f203c270f13ff593feb4775ec7ebe2bb1c6

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for phylax-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8868a85d9aa525d40aa5eb2adc601160ac5b0cb14198792a64eb1a98ad40e4f0
MD5 23f0ac1fdd29ab8cf8178af480fcbd99
BLAKE2b-256 42e2a4ccf8dec578301864318625e75a16f01f20c521fb93f7f971520c201311

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