Skip to main content

Phthos Eval

Pip package for offline agent eval. Deterministic scorers first. Optional LLM judge uses your key. This repo does not apply fixes.

Python 3.11+. Pip only (no npm).

Install

pip install phthos-eval

Or from git until the first PyPI release is cut:

pip install "phthos-eval @ git+https://github.com/PhthosAI/phthos-eval.git"

From a clone:

pip install -e ".[dev]"

Run

python -m phthos_eval run -d fixtures/dataset.json -o diagnosis.json
python -m phthos_eval check diagnosis.json

CI gate (exit 1 if any failure):

python -m phthos_eval run -d eval/dataset.json -o diagnosis.json --fail-on-findings

Copy-paste workflow: examples/github-eval.yml.

Read the JSON

diagnosis.json is versioned (schema_version: 0.1.0). Breaking schema changes bump the major package version.

Field Meaning
scores task_success, cost, latency_ms, policy_hits, n_run_reliability
failures[].type wrong_tool, loop, budget, policy
failures[].span_id Where it happened
change_class prompt | tool | policy | model | finetune_data | none
evidence Span / step pointers, not an essay
judge Optional LLM score; skipped: true with no key

Python:

from phthos_eval import Diagnosis, Scorer, failure, run_dataset, validate_diagnosis

class NoEmptyReply:
    def score(self, trace, *, case, dataset, case_id, trace_index):
        if not trace.get("spans"):
            return [failure("policy", "missing", case_id=case_id, trace_index=trace_index)]
        return []

doc = run_dataset(dataset, scorers=[NoEmptyReply()])  # or omit scorers for defaults
assert validate_diagnosis(doc) == []
print(doc["change_class"], doc["scores"])

Keys (do not mix)

Env Whose Used for
Agent provider keys The system under test Running the agent (not this package)
OPENAI_API_KEY or PHTHOS_EVAL_API_KEY You Optional judge only

Without a judge key, deterministic scorers still run. Optional: PHTHOS_EVAL_JUDGE_BASE_URL (OpenAI-compatible, Ollama, gateway), PHTHOS_EVAL_JUDGE_MODEL.

No hosted LLM is required.

Examples

Dev

python -m pytest
python -m ruff check src tests

Download files

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

Source Distribution

phthos_eval-0.1.0.tar.gz (13.3 kB view details)

Uploaded Source

Built Distribution

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

phthos_eval-0.1.0-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: phthos_eval-0.1.0.tar.gz
  • Upload date:
  • Size: 13.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for phthos_eval-0.1.0.tar.gz
Algorithm Hash digest
SHA256 11c88f0e0da7b269b4aa2a07f3239a5f93c9057c074c4b8d125ab5ad93be87d4
MD5 e29205beac9e0a8fee08eaa4af62c231
BLAKE2b-256 adb4b3eaf9b6424d0b1d4c91d6f86013cfa85c3f41941f7e21ee7ce9468c13e8

See more details on using hashes here.

File details

Details for the file phthos_eval-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: phthos_eval-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for phthos_eval-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 79463ab8ba138e7e065a4dbb91716a3766ceaf882f0da0e01e7c4f86f5b4d164
MD5 fbb62b8363fceaffecca1a8806960110
BLAKE2b-256 3b25f7f2192c5256b4b2f3300292cbb6ff4c51fdc8ab5f0e3ee73674cca4bb30

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 Sentry Error logging StatusPage Status page