Skip to content

Add --explain flag to deploy to print inspector, interpretation, generation, and validation trace #30

@AK11105

Description

@AK11105

What problem does this solve?

After a deploy completes, there is no visibility into what the inspector found, what the LLM inferred, how many generation attempts were needed, or what validation produced. When a deploy succeeds but the model behaves unexpectedly, there is no record of the decisions made during the deploy flow.

Proposed solution

Add --explain flag to inference-engine deploy. After generation, before the preview, print a structured DeployTrace block assembled from data already collected during the deploy flow — no extra LLM calls.

Inspector
  Format             pickle / XGBClassifier
  Confidence         medium (xgboost not installed, framework inferred from class name)
  Inspection errors  layer=deep: ModuleNotFoundError: No module named 'xgboost'

LLM Interpretation
  Framework          xgboost (inferred)
  Load format        joblib
  Input hint         numpy array or pandas DataFrame
  Clarifying Q       "Is this an XGBModel or a raw Booster?" → answered: XGBModel

Generation
  Attempt            1 (no repair needed)
  Model              llama-3.3-70b-versatile

Validation
  Result             passed
  Output             0.87
  Duration           34ms

Implementation: a DeployTrace dataclass populated throughout run_deploy(), printed at the end when --explain is set.

Alternatives considered

Logging this information to a file automatically. --explain is opt-in and prints to stdout, keeping the default output clean.

Area

CLI (deploy / fix)

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions