SuperAPIAI Directory

pcq

github.com · AI developer platforms

ML experiment contracts (cq.yaml plus JSON) to run, validate, compare and trace experiments in any framework, including PyTorch, Lightning and sklearn.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsLinux

About this tool

pcq is a machine learning experiment contract for agent operation. The repository contains the contract specification under spec/ and a reference Python implementation under src/pcq/. The reference implementation can be installed with uv add pcq and is licensed under Apache-2.0.

Purpose pcq turns projects that have a cq.yaml into reproducible experiment units. The reference Python implementation is responsible for loading configuration, resolving output paths, collecting metrics, writing standard artifacts, finalizing run evidence, and exposing JSON/JSONL/MCP interfaces for consumption by coding agents, CI jobs, notebooks, and services. pcq is not a training framework, model library, adapter matrix, or CQ-only client; training stacks can continue to use PyTorch, Hugging Face Trainer, Lightning, sklearn, TabPFN, PyCaret, XGBoost, shell scripts, remote jobs, or project-local research code, with the contract serving as the integration layer.

Main capabilities

  • Framework-neutral: keep the training stack that fits the problem.
  • Agent-readable: use JSON/JSONL instead of terminal scraping.
  • Agent-verifiable: verify provenance, configuration, environment, metrics, artifacts, and run records.
  • Agent-operable: execute runs, observe, verify, describe, compare, trace lineage, and iterate through stable commands.
  • Service-ready: CQ can consume the same contract for hosted execution and automated experiment loops.

v4.4-v4.6 add three fillable metadata fields that make each run's evidence richer, in most cases without additional code:

  • attribution (who): records the human author, AI submitter, and operator who launched the run; coding agents (Claude Code, Codex) can populate it automatically from their identity context.
  • worker_spec (where): records CPU model, core count, GPU type/memory, total memory, and operating system; calling it without arguments performs full automatic detection.
  • fingerprint (what): records dataset modality, task type, number of samples, scale category, domain, and PII-safe summary statistics; accepts NumPy/pandas arrays or DataFrames and infers most fields. All three fields are optional, and existing runs remain valid; when present, they appear as first-class evidence in run_record.json and are surfaced through pcq describe-run --json.

Reproducibility substrate Provide an independently reproducible substrate in run_record.json via three optional fields. pcq does not perform validation—it makes validation possible. For detailed mode, the PHI gate (R5), integrity extensions, and the R8 limitation statement, see spec/SPEC.md § Reproducibility Pack. Note: the code content sha proves what code was recorded, not that this code produced these outputs; pcq records claims rather than judgments—intent is a recorded assertion, not pcq's verdict on success.

Usage Minimal contract: cq.yaml declares a run; train.py can use any framework, with no need for a sklearn adapter, and the same pattern applies to HF Trainer, Lightning, XGBoost, TabPFN, PyCaret, shell commands, or custom code. Agent command surface: read and validate a project, run a project, validate and summarize outputs. Agent rules: prefer JSON/JSONL interfaces over scraping human output; pcq reports facts, and the agent or service chooses the policy. Standard artifacts: a completed run should produce run_summary.json, run_record.json, and validation_report.json; run_record.json is the canonical completion object, combining execution, provenance, environment, input identity, metric schema, artifact manifest, agent provenance, validation, and summary evidence. Agent runtime assets: pcq can install canonical agent instructions and skills into a project; package installation itself does not modify project agent files. If you also want to wire it up for MCP-capable agents (Claude Code, Codex), install pcq[mcp] and pass --mcp to expose 14 mcp__pcq__* tools (resolve_project, validate_run, describe_run, compare_runs, etc.), letting agents call pcq directly without subprocess parsing. Reusable assets include templates/AGENTS.pcq.md and skills/pcq/SKILL.md. Docker: a minimal container image is published, packaging pcq[mcp] from PyPI and running pcq mcp serve over stdio; the image is intentionally limited to the MCP server interface. For pcq run, pcq describe-run, pcq agent install, and other CLI subcommands, install directly with uv add pcq.

Applicable scenarios Suitable for machine learning experiment management in local, CI, notebook, and third-party orchestrator settings, especially for scenarios that require agents to automatically run, validate, compare, and track experiments. pcq remains useful without CQ.

Limitations pcq is not a training framework, model library, adapter matrix, or CQ-only client; it does not validate the reproducibility substrate, and only records claims rather than judging success. The code content sha cannot prove that the outputs were produced by that code. Other specific limitations are not provided for now.

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools