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
fixtures/dataset.json— unit fixtureexamples/support_agent/— recorded support-agent traces (dogfood in this repo, not a Task AI merge)
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
11c88f0e0da7b269b4aa2a07f3239a5f93c9057c074c4b8d125ab5ad93be87d4
|
|
| MD5 |
e29205beac9e0a8fee08eaa4af62c231
|
|
| BLAKE2b-256 |
adb4b3eaf9b6424d0b1d4c91d6f86013cfa85c3f41941f7e21ee7ce9468c13e8
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79463ab8ba138e7e065a4dbb91716a3766ceaf882f0da0e01e7c4f86f5b4d164
|
|
| MD5 |
fbb62b8363fceaffecca1a8806960110
|
|
| BLAKE2b-256 |
3b25f7f2192c5256b4b2f3300292cbb6ff4c51fdc8ab5f0e3ee73674cca4bb30
|