Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

phionyx-eval

LLM-as-judge primitive (eval-side) for Phionyx runtime-evidence chains. Score a (claim, evidence) pair under a rubric; produce a signed Judgment envelope; verify the chain end-to-end. The caller supplies the LLM client — there is no hard dependency on any provider SDK.

Status

v0.1.0a1 — alpha. This is an eval-side adapter in the Phionyx portfolio (it carries its own version line, independent of the engine and the evidence format it composes with). It is published to the public halvrenofviryel/phionyx-eval repo.

Where this sits in the Phionyx stack

Component Repo / package Role Version
Engine phionyx-core Deterministic runtime (46-block pipeline, audit chain) v0.9.0
Evidence format ai-runtime-evidence-protocol AI Runtime Evidence Protocol (AIREP) — a vendor-neutral, experimental open format for a per-decision AI decision receipt v0.1 (experimental)
This package phionyx-eval (adapter) Eval-side LLM-as-judge for claim/evidence pairs v0.1.0a2

phionyx-eval is an adapter, not the engine or the evidence format. It produces a JudgmentEnvelope — a signed, hash-chained record of one judgment — which sits alongside the AIREP decision records emitted by the Phionyx runtime.

What this package is

A small eval-side toolkit:

  • LLMClient — Protocol surface (complete(prompt: str) -> str). Plug in Anthropic SDK, OpenAI SDK, LiteLLM, an HTTP wrapper, or a mock.
  • Rubric — Pydantic model for a scoring rubric: criteria, integer scale, normalised pass threshold. Four canonical Phionyx rubrics ship by default.
  • LLMAsJudge — judges one (claim, evidence) pair under a rubric. Produces a Judgment with per-criterion scores, an aggregate normalised score, a deterministic verdict (pass / fail / uncertain), and the model's overall rationale.
  • build_judgment_envelope — wraps a Judgment in a signed, hash-chained envelope. Mirrors the audit-chain pattern used by phionyx-langchain-langgraph and phionyx-mcp-server.

What this package is NOT

  • NOT a runtime reasoning component. LLM-as-judge is a measurement tool. It does not update memory or affect determinism in phionyx-core — measurement only, not a runtime reasoning component and not a capability advance.
  • NOT a benchmark runner. It scores one (claim, evidence) pair at a time. Batch evaluation, score aggregation across many calls, and dashboarding are out of scope for v0.1.
  • NOT a compliance certifier. Phionyx publishes mappings; it does not issue compliance guarantees. A passing judgment is passed structural rubric evaluation, not approved for production.

Install

pip install phionyx-eval

Requires Python ≥3.10 and phionyx-core. The package declares a phionyx-core >= 0.5.0 floor; it is tested against the current phionyx-core v0.8.x line.

60-second usage

from phionyx_eval import (
    EVIDENCE_COVERAGE_RUBRIC,
    LLMAsJudge,
    build_judgment_envelope,
    GENESIS_HASH,
    __version__,
)

class MyClient:
    """Your existing LLM client — anything with .complete(prompt) -> str."""
    def complete(self, prompt: str) -> str:
        return your_llm.invoke(prompt)  # replace with your call

judge = LLMAsJudge(MyClient())
verdict = judge.judge(
    claim="Fixed the off-by-one in paginate() for the empty-input case",
    evidence="pytest tests/unit/test_paginate.py -k off_by_one — 1/1 pass",
    rubric=EVIDENCE_COVERAGE_RUBRIC,
)
print(verdict.verdict, verdict.aggregate_score)

# Wrap the judgment in a signed envelope for the audit chain:
envelope = build_judgment_envelope(
    judgment=verdict,
    package_version=__version__,
    previous_hash=GENESIS_HASH,  # or the previous envelope's integrity.current
    turn_index=0,
)

Standard rubrics

Rubric Pass threshold Criteria
EVIDENCE_COVERAGE_RUBRIC 0.7 evidence_addresses_claim_scope, evidence_exercises_claimed_paths, evidence_independent_of_claim_text
CORRECTNESS_RUBRIC 0.7 claim_consistent_with_evidence, no_internal_contradictions, scope_appropriately_qualified
COMPLETENESS_RUBRIC 0.6 claim_addresses_full_user_scope, omissions_explicitly_acknowledged, edge_cases_considered
INDEPENDENT_VERIFIABILITY_RUBRIC 0.7 evidence_contains_reproduction_steps, evidence_names_specific_paths_or_commands, evidence_independent_of_agent_narration

All four use a 0–5 integer scale per criterion. Caller-authored rubrics work the same way; pass a Rubric instance to judge.judge(...).

Verdict derivation

Verdicts are deterministic, not LLM-emitted:

  1. Average the per-criterion integer scores.
  2. Normalise into [0, 1] against (scale_max - scale_min).
  3. If aggregate >= pass_thresholdpass.
  4. Else if aggregate >= pass_threshold - 0.05uncertain (near-miss band).
  5. Else → fail.

The LLM does not vote on its own pass/fail.

Composing with the Phionyx audit chain

The JudgmentEnvelope follows the same hash-chained pattern Phionyx uses for AgentMessageEnvelope and the subagent_chain block. A producer accumulating many judgments builds a single linear chain by passing the prior envelope's integrity.current as the next call's previous_hash. Tampering any envelope's payload (claim text, rubric name, score, rationale) breaks envelope_hash recomputation.

Cross-runtime importers

Import Langfuse traces and LangSmith runs into Phionyx envelope chains. Round-trip lossless for the mappable fields named below; non-mappable foreign fields are preserved verbatim under subject.metadata.imported_extras so a future Phionyx-side exporter could reconstruct the foreign shape.

Langfuse

from phionyx_eval import import_langfuse_trace

result = import_langfuse_trace(langfuse_trace_dict)
# result.envelopes[0]   → trace_root envelope
# result.envelopes[1:]  → one envelope per observation, in original order
# result.mapping_report → MappingReport (mapped_fields, preserved_extras, dropped_fields)

Mappable Langfuse fields:

Foreign Phionyx
id subject.foreign_trace_id
name, userId, sessionId, release, version, input, output, metadata, tags, public, createdAt, updatedAt record.<snake_case>
Observation id record.observation_id
Observation type subject.event_type
Observation name, startTime, endTime, input, output, level, statusMessage, model, modelParameters, usage, parentObservationId record.<snake_case>

Schema: phionyx.imported_langfuse_envelope.v1.

LangSmith

from phionyx_eval import import_langsmith_run

result = import_langsmith_run(
    root_run_dict,
    descendants=descendant_run_dicts,  # optional; resolved via child_run_ids
)
# result.envelopes is in depth-first pre-order traversal of the run tree.

Mappable LangSmith fields per run:

Foreign Phionyx
id subject.foreign_trace_id
run_type subject.event_type
name, inputs, outputs, start_time, end_time, error, extra, parent_run_id, child_run_ids, events, feedback record.<snake_case>

Schema: phionyx.imported_langsmith_envelope.v1. Tree shape preserved in record.parent_run_id / record.child_run_ids so a downstream consumer can reconstruct the tree.

Composition with the judge

The output of either importer is a list of Phionyx envelopes. The LLMAsJudge can then run over any envelope's record payload to score a specific claim (e.g. the drafting step's output addresses the input) under an evidence-coverage rubric — turning a third-party trace into a Phionyx-evaluable evidence record without re-running the original system.

Composing with AIREP decision records

The four built-in rubrics implement Phionyx's cross-domain evidence baseline. They compose cleanly with the AI Runtime Evidence Protocol (AIREP) — an experimental, vendor-neutral open format for a per-decision AI decision receipt: one signed, hash-chained, offline-checkable record per AI runtime decision, readable by anyone and tied to no vendor.

An AIREP record names what happened in a decision — its claim, the evidence cited, the output, and the integrity hash chain that ties them together. This package names how a judge grades the evidence quality behind one of those claims. The two compose: a judge can run EVIDENCE_COVERAGE_RUBRIC over the claim/evidence pair carried in an AIREP record to grade whether the claim is actually supported by the evidence cited.

The Phionyx Reasoned Governance Envelope (RGE) is developed alongside AIREP — a conformant projection between the two is not implemented (measured 2026-08-06: AIREP's own reference verifier rejects an RGE envelope handed to it directly) — maturing by conforming to the format. AIREP is an experimental, proposed open format with no conformant producer yet; it is not a ratified standard.

License

AGPL-3.0-or-later, consistent with the rest of the Phionyx open-source distribution.

Links

Download files

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

Source Distribution

phionyx_eval-0.1.0a2.tar.gz (37.9 kB view details)

Uploaded Source

Built Distribution

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

phionyx_eval-0.1.0a2-py3-none-any.whl (32.9 kB view details)

Uploaded Python 3

File details

Details for the file phionyx_eval-0.1.0a2.tar.gz.

File metadata

  • Download URL: phionyx_eval-0.1.0a2.tar.gz
  • Upload date:
  • Size: 37.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for phionyx_eval-0.1.0a2.tar.gz
Algorithm Hash digest
SHA256 221861fabeed69a442ef3596c4e5936a4d20a5a100a8b5299b2cd592b933bbac
MD5 a1e2425e48b3d3e226f2cf75bc834e1b
BLAKE2b-256 83faef85379e258013d16c8352a0db0e59f353ac25a2d51c36ca8bf22e4534d1

See more details on using hashes here.

Provenance

The following attestation bundles were made for phionyx_eval-0.1.0a2.tar.gz:

Publisher: release.yml on halvrenofviryel/phionyx-eval

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file phionyx_eval-0.1.0a2-py3-none-any.whl.

File metadata

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

File hashes

Hashes for phionyx_eval-0.1.0a2-py3-none-any.whl
Algorithm Hash digest
SHA256 44ac1deb977707dee4860d061a1d7559d54451926a6379794bd1b979c3908c93
MD5 8d65f018d29d54a778a3f74eadf9b474
BLAKE2b-256 5fcfadf6684b055c0e2e49c072728e885fc9faa19e7128fa1339d1d286461e75

See more details on using hashes here.

Provenance

The following attestation bundles were made for phionyx_eval-0.1.0a2-py3-none-any.whl:

Publisher: release.yml on halvrenofviryel/phionyx-eval

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0a2 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page