Minimal, config-first automation for a full MoE compression run:
This repo is intentionally small. It does not pretend every MoE uses the same vendor command line.
What it does provide:
What you configure up front:
w4a16compress/
README.md
requirements.txt
scripts/
run_moe_pipeline.py
build_master_calibration_bundle.py
render_reap_run_report.py
examples/
automatic_pipeline.example.json
master_calibration_bundle.example.json
run_report_manifest.example.json
run_moe_pipeline.py is the entrypoint. It runs named stages in order, captures logs, writes pipeline state, and stops on first failure.
Supported stage types:
build_calibration_bundlecommandrender_reportThe runner is model agnostic because the architecture-specific work stays in your configured command stages.
The pipeline config supports placeholders like {model_path}.
Available variables:
parameters.*{repo_root}{run_dir}{pipeline_name}{stage_build_calibration_bundle_output_dir}{stage_build_calibration_bundle_summary_json}{stage_build_calibration_bundle_merged_output_jsonl}{stage_observations_log_path}{stage_quantize_status}build_calibration_bundle and render_report both support either a file path or inline JSON:
config or inline_configmanifest or inline_manifestThat means you can drive the whole pipeline from one file.
The bundled calibration example uses the split that has proven most practical for code and agentic REAP work:
100 rows from each public dataset:theblackcat102/evol-codealpaca-v1Salesforce/xlam-function-calling-60kSWE-bench/SWE-smith-trajectoriesopen-r1/Mixture-of-Thoughts codeopen-r1/Mixture-of-Thoughts mathopen-r1/Mixture-of-Thoughts scienceIf your deployment traffic is not code or agentic, change the mix. Do not cargo-cult this bundle into a different workload.
From the repo root:
uv run ./scripts/run_moe_pipeline.py \
--config ./examples/automatic_pipeline.example.json
The example pipeline is a template. Replace the example command strings with the real commands for your MoE stack.
Recommended stage order:
Dry run:
uv run ./scripts/build_master_calibration_bundle.py \
--config ./examples/master_calibration_bundle.example.json \
--output-dir ./output/calibration-plan \
--dry-run
Real build:
uv run --with datasets ./scripts/build_master_calibration_bundle.py \
--config ./examples/master_calibration_bundle.example.json \
--output-dir ./output/master-calibration
Outputs:
uv run ./scripts/render_reap_run_report.py \
--manifest ./examples/run_report_manifest.example.json \
--output-dir ./output/example-report
Outputs:
report.jsonreport.mdindex.htmlThe report renderer expects a JSON manifest with these sections:
modelcalibrationpruningquantizationpublishingbenchmarkingresultsThe pipeline runner does not invent these facts. Your configured commands should write the artifacts and produce a normalized manifest file at the end of the run.
That is the correct boundary:
Treat examples/automatic_pipeline.example.json as the one file you edit for a new model. Keep the stage order. Replace the command strings. Point the final report stage at the normalized manifest produced by your tooling.
$ claude mcp add moe-compress \
-- python -m otcore.mcp_server <graph>