You design the product. Your contract manufacturer builds it. But when quality problems slip through, your brand takes the hit. TofuPilot lets you share test procedures with subcontractors and collect every result in your workspace, so you have the same visibility as if you were on the factory floor.
The OEM/CM Visibility Problem
Most OEMs get a weekly yield report from their CM, maybe a spreadsheet, maybe an email with a number. That's not enough. You need measurement-level data for every unit: what was tested, what passed, what failed, and what the actual values were.
Without this data, you can't tell whether a 96% yield means the process is healthy or whether it's hiding a measurement that's drifting toward the limit. By the time the weekly report shows a yield drop, hundreds of bad units may have shipped.
Set Up the Workflow
The setup is straightforward. You write the test procedures, the subcontractor runs them, and results upload to your TofuPilot workspace.
- You write and version-control the OpenHTF test scripts
- You provide the subcontractor with the scripts and a TofuPilot API key scoped to your workspace
- The subcontractor installs the scripts on their test stations and runs production
- TofuPilot collects every run with station metadata identifying the subcontractor's site
The subcontractor doesn't need access to your TofuPilot dashboard. They just run the tests. You see everything.
Write Tests the Subcontractor Will Run
Keep test scripts self-contained. The subcontractor's operators shouldn't need to modify anything. Use station_id to identify the CM's stations in your data.
import openhtf as htf
from openhtf.util import units
from tofupilot.openhtf import TofuPilot
@htf.measures(
htf.Measurement("vbus_voltage")
.in_range(minimum=23.5, maximum=24.5)
.with_units(units.VOLT),
htf.Measurement("phase_current")
.in_range(minimum=0.9, maximum=1.1)
.with_units(units.AMPERE),
htf.Measurement("pwm_frequency")
.in_range(minimum=19500, maximum=20500)
.with_units(units.HERTZ),
)
def test_motor_output(test):
test.measurements.vbus_voltage = 24.01
test.measurements.phase_current = 1.02
test.measurements.pwm_frequency = 20010
def main():
test = htf.Test(
test_motor_output,
station_id="CM-ACME-SZ-FCT-01",
)
with TofuPilot(test):
test.execute(test_start=lambda: "MDR-2026-04417")
if __name__ == "__main__":
main()Prefix the station ID with the subcontractor's name or code (like CM-ACME-SZ) so you can filter by CM in TofuPilot.
Provide Deployment Instructions
Package everything the subcontractor needs:
| Item | Purpose |
|---|---|
| Test scripts (Git repo or zip) | The exact procedures to run |
requirements.txt | Python dependencies including openhtf and tofupilot |
| Environment setup guide | How to set the TOFUPILOT_API_KEY environment variable |
| Station naming convention | How to set station_id for each machine |
| Instrument configuration | VISA addresses, serial ports, fixture pin maps |
The subcontractor sets the API key as an environment variable. The TofuPilot client picks it up automatically.
# The subcontractor sets this once per station
export TOFUPILOT_API_KEY=tp_live_xxxxxxxxxxxx
# The TofuPilot client reads it automatically
# No code changes neededHandle Multiple Subcontractors
If you work with more than one CM, use distinct station ID prefixes for each:
import openhtf as htf
from openhtf.util import units
from tofupilot.openhtf import TofuPilot
@htf.measures(
htf.Measurement("temp_accuracy")
.in_range(minimum=-0.5, maximum=0.5)
.with_units(units.DEGREE_CELSIUS),
htf.Measurement("humidity_accuracy_pct")
.in_range(minimum=-3.0, maximum=3.0),
)
def test_sensor_accuracy(test):
test.measurements.temp_accuracy = 0.12
test.measurements.humidity_accuracy_pct = -1.3
def main():
test = htf.Test(
test_sensor_accuracy,
# CM-BETA identifies this subcontractor's facility
station_id="CM-BETA-GDL-EOL-03",
)
with TofuPilot(test):
test.execute(test_start=lambda: "SNS-2026-09102")
if __name__ == "__main__":
main()This gives you clean filtering: see all of CM-BETA's results, compare CM-ACME vs CM-BETA yield, or drill into a specific station.
Monitor Subcontractor Quality in TofuPilot
With all CMs uploading to your workspace, TofuPilot gives you:
- Yield by subcontractor so you can compare CM performance at a glance
- Measurement distributions per CM to catch process differences. If CM-ACME's voltage readings are shifted compared to CM-BETA, one of them has a calibration issue.
- Failure Pareto per site to see whether different CMs struggle with different tests
- Real-time run feed so you see results as they happen, not in a weekly report
Keep Procedures in Sync
When you update a test procedure, every CM needs the new version. Use Git tags or release versions so you can verify which version each site is running. TofuPilot tracks the procedure used for each run, so you can filter by procedure version and confirm the rollout.
Don't let CMs modify test limits or skip tests. The procedures you ship are the single source of truth. If a CM reports that a test is failing too often, investigate the root cause instead of loosening limits.