API Reference
For a first calculation, use Choosing a Python API. For implementation navigation, follow the code walkthrough.
This reference is generated from package docstrings during a full documentation build. It covers the entry points declared in the documentation configuration and public calculation classes in engine/scenario_definitions/. To browse registry entries (GPUs, models, or fleets), use the Zoo.
Engine and scenarios
Entry points that turn a workload and a system into an estimate.
| engine.engine.Engine | The core analytical engine for single-node Roofline performance modeling. |
| engine.scenarios.Scenario | Concrete executable case: a workload on a system with constraints. |
| engine.dse.DSE | Declarative Design Space Exploration (DSE) Engine. |
| engine.calibration | Parameters for analytical solvers and the roofline engine. |
| engine.accuracy_curve | Measured accuracy curves for compression (opt-in). |
Workloads and systems
Typed objects that describe what runs and what it runs on.
| models.types.Workload | Layer A (Workload Demand): Base representation of an ML model or task. |
| models.types.TransformerWorkload | Workload representation of an autoregressive Transformer (e.g., LLMs). |
| models.types.SparseTransformerWorkload | Workload representation of a Mixture-of-Experts (MoE) Transformer. |
| models.types.CNNWorkload | Workload representation of a Convolutional Neural Network (e.g., Vision). |
| hardware.HardwareNode | Layer B (Hardware Supply): Represents a complete hardware accelerator. |
| systems.types.Node | Represents a physical server chassis containing multiple accelerators. |
| systems.types.Fleet | Layer D (Systems/Topology): The complete distributed cluster environment. |
Registries
Vetted, sourced catalogs of hardware, models, fleets, and physical systems. Browse their contents in the Zoo.
| hardware.Hardware | Registry namespace for Hardware. |
| models.Models | Registry namespace for Models. |
| systems.Systems | Registry namespace for Systems. |
| infrastructure.Infrastructure | Registry namespace for Infrastructure. |
| platforms.Platforms | Deployment paradigms with latency, memory, and power envelopes. |
| datasets.Datasets | |
| literature.Literature | Registry namespace for Literature. |
| ops.Ops | Registry namespace for Ops. |
| embodied.Embodied | Authoritative registry of embodied AI platforms, cyber-physical machines, and robotic embodiments. |
| embodied.EmbodiedPlatform | Vetted cyber-physical machine platform (quadruped, humanoid, manipulator, drone, AMR, AV). |
| sensors.Sensors | Authoritative registry of robotics perception sensors. |
| sensors.Sensor | Base sensor type for cyber-physical perception systems. |
| sensors.SafetyLaserScanner | Certified planar safety laser scanner (an AOPDDR type-tested under IEC 61496-3). |
| sensors.SafetyLightCurtain | Certified safety light curtain (an AOPD type-tested under IEC 61496-2), added 2026-10-20. |
| actuators.Actuators | Authoritative registry of robotic actuators and joint transmissions. |
| actuators.ActuatorJoint | Vetted robotic joint actuator (motor + transmission + driver). |
| actuators.FramelessMotor | Frameless brushless servo motor kit (stator and rotor) for integration in a joint. |
| actuators.SafetyRelay | Dual-channel safety relay that removes a drive’s torque enables when an E-stop opens. |
| actuators.WheelHubMotor | Direct-drive brushless wheel hub motor (motor, tire, and encoder in one wheel). |
| agents.Agents | Authoritative registry of agent system profiles and execution harnesses. |
| agents.AgentArchitecture | Vetted agent system profile (SWE-bench coding, deliberation tree search, multi-agent fleet, streaming). |
| agents.AgentWorkload | Recurring agent workload profile: task-level scenario inputs for one archetype. |
Solvers
Analytical models, solvers, and optimizers. Import them from mlsysim.solvers.
| solvers.SingleNodeModel | Resolves single-node hardware Roofline bounds and feasibility. |
| solvers.NetworkRooflineModel | Analyzes the Distributed Performance Bounds (The Network Wall). |
| solvers.EfficiencyModel | Models the gap between peak and achieved FLOPS (Wall 3: Software Efficiency). |
| solvers.ForwardModel | Forward-evaluating mechanistic engine (Y = f(X)). |
| solvers.ServingModel | Analyzes the two-phase LLM serving lifecycle: Pre-fill vs. Decoding. |
| solvers.TrainingMemoryModel | Decomposes per-accelerator training memory into teachable components. |
| solvers.ServingCapacityModel | Sizes an LLM serving deployment from a QPS and tail-latency target. |
| solvers.ContinuousBatchingModel | Compares static KV reservation with PagedAttention under continuous batching. |
| solvers.WeightStreamingModel | Analyzes Wafer-Scale inference (e.g., Cerebras CS-3) using Weight Streaming. |
| solvers.TailLatencyModel | Analyzes queueing delays and P99 tail latency for deployed inference models. |
| solvers.DataModel | Analyzes the ‘Data Wall’ — the throughput bottleneck between storage and compute. |
| solvers.TransformationModel | Quantifies the CPU preprocessing bottleneck (Wall 9: Transformation). |
| solvers.TopologyModel | Models bisection bandwidth for different network topologies (Wall 10). |
| solvers.ScalingModel | Analyzes the ‘Scaling Physics’ of model training (Chinchilla Laws). |
| solvers.InferenceScalingModel | Models inference-time compute scaling (Wall 12: Reasoning/CoT Cost). |
| solvers.CompressionModel | Analyzes model compression trade-offs (Accuracy vs. Efficiency). |
| solvers.DistributedModel | Resolves fleet-wide communication, synchronization, and pipelining constraints. |
| solvers.MoERoutingModel | Models first-order MoE routing imbalance and expert-parallel all-to-all cost. |
| solvers.ReliabilityModel | Calculates Mean Time Between Failures (MTBF) and optimal checkpointing intervals. |
| solvers.OrchestrationModel | Analyzes Cluster Orchestration and Queueing (Little’s Law). |
| solvers.EconomicsModel | Calculates Total Cost of Ownership (TCO) including Capex and Opex. |
| solvers.SustainabilityModel | Calculates Datacenter-scale Sustainability metrics. |
| solvers.CheckpointModel | Analyzes the storage constraints and I/O burst penalties of saving model states. |
| solvers.ResponsibleEngineeringModel | Models the computational cost of responsible AI practices (Wall 20: Safety). |
| solvers.SensitivitySolver | Identifies the binding constraint via numerical sensitivity analysis (Wall 21). |
| solvers.SynthesisSolver | Given an SLA, synthesizes the required hardware specs (Wall 22: Inverse Solve). |
| solvers.ParallelismOptimizer | Searches for the optimal 3D/4D parallelism split (DP, TP, PP, EP). |
| solvers.BatchingOptimizer | Finds the maximum batch size that satisfies a P99 latency SLA. |
| solvers.PlacementOptimizer | Finds the datacenter region that minimizes TCO plus a carbon tax. |
| solvers.FailureIntervalModel | Interval between failures across identical, independent components. |
| solvers.SeriesFailureModel | Failure interval of a synchronous job built from heterogeneous components. |
| solvers.ZeroFailureModel | Upper bound on the per-trial failure rate after a failure-free campaign. |
| solvers.FailureTriageModel | Failures that counterfactual probes remove below the weights, and the price of training on all of them. |
| solvers.ErrorFeedbackModel | A compressor that sends each value rounded to a whole unit, with error feedback. |
| solvers.TimingAttitudeErrorModel | Position errors from a timing error and an angle error, for a target at distance. |
| solvers.StereoDepthErrorModel | One-sigma stereo depth error against range, and where it spends each clearance. |
Physics: compute and memory
Closed-form formulas behind the solvers. Every function is also importable from mlsysim.physics.
| physics.performance | Training time, scaling, roofline, and pipeline performance. |
| physics.memory | Model and activation memory accounting. |
| physics.transformer | Transformer FLOP accounting identities. |
| physics.quantities | Quantity-first formula helpers for LEGO cells — return Pint quantities, never strings. |
Physics: communication and serving
| physics.communication | Collective communication time models (α–β). |
| physics.networking | Network latency and distance physics. |
| physics.serving | Inference serving and queueing models. |
Physics: reliability, statistics, and economics
| physics.reliability | Reliability, checkpointing, and availability models. |
| physics.statistics | Statistical and workflow propagation helpers. |
| physics.economics | Fleet economics and cloud cost models. |
| physics.retrieval | Retrieval from long-term memory: the equations behind a read and its index. |
Physics: agents and physical AI
| physics.agents | Agentic ML systems physics and memory accounting formulas (Volume III). |
| physics.policy_gradient | Policy-gradient training on verifiable rewards: coefficients, forks, and clipping. |
| physics.drivetrain | Braking-drive physics for a wheeled mobile base (Volume IV, added 2026-09-28, M6). |
| physics.robotics.stopping | Stopping envelopes, S-curve trajectories, and velocity bounds for Physical AI. |
| physics.robotics.actuation | Joint mechanics, contact dynamics, and thermal/electrical actuation limits. |
| physics.robotics.kinematics | Manipulator kinematics: the Jacobian’s conditioning and damped inverse kinematics (added 2026-10-20). |
| physics.robotics.control | Action chunking, watchdog leases, real-time fieldbuses, and CBF safety. |
| physics.robotics.perception | Spatial memory footprints, evidence horizons, and teleoperation data budgets. |
| physics.robotics.sensing | Sensing error scales: stereo triangulation, lever arms, scan sectors, fog, and expansion (added 2026-10-20). |
| physics.robotics.assurance | Statistical release gates, Clopper-Pearson bounds, and fleet hazard rates. |
| physics.robotics.estimation | State estimation and belief expiry: scalar fusion, inertial coasting, and error-bound growth (added 2026-10-20). |
| physics.robotics.learning | Policy training physics: discounting, trial campaigns, iterative decoders, and contact models. |
Solvers by domain
Every analytical model, grouped by the module that defines it. Each is also importable from mlsysim.solvers.
| engine.solvers.acceptance | Agent evaluation solvers: what a set of graded trials supports about a configuration. |
| engine.solvers.agents | Agent solvers: reliability, cost, and context over a whole trajectory. |
| engine.solvers.collective | Collective-communication solvers: AllReduce schedules, hierarchy, AllToAll |
| engine.solvers.context | Context-engineering solvers: what one agent request carries, and what it costs. |
| engine.solvers.cost_accounting | Agent cost-accounting solvers: what one accepted task costs, and what each lever buys (added 2026-10-20). |
| engine.solvers.curation | Trajectory curation solvers: what a recorded corpus may teach, and what collecting it costs. |
| engine.solvers.deliberation | Test-time deliberation solvers: spending more work on one decision with the weights fixed. |
| engine.solvers.durability | Durable-execution solvers: what a runtime pays to survive a crash (added 2026-10-20). |
| engine.solvers.embodied | Embodied solvers: how far a machine travels before it stops, and what the floor allows. |
| engine.solvers.estimation | Spatial-memory solvers: state estimation, estimator consistency, drift, and belief expiry (added 2026-10-20). |
| engine.solvers.facility | Facility solvers: power transients, coolant flow, and outage cost. |
| engine.solvers.fine_tuning | Fine-tuning solvers: what a serialized trajectory teaches, and what the update costs. |
| engine.solvers.goodput | Fleet goodput solvers: ML productivity goodput and runtime goodput. |
| engine.solvers.grounding | Grounded-intent solvers: how long a learned target stays true, and the lease that bounds it. |
| engine.solvers.harness | Agent-harness solvers: what the runtime holds, shares, and admits (added 2026-10-20). |
| engine.solvers.interconnect | Interconnect solvers: transfer bounds across link tiers, alpha-beta messages, |
| engine.solvers.kv_cache | KV cache management solvers: what retained attention state costs a serving node. |
| engine.solvers.mapping | Volumetric-map solvers: clearance-query reads, map storage, update traffic, and encoder rate (added 2026-10-20). |
| engine.solvers.model_call | Model-call solvers: what one call admits, samples, and costs, and what a trajectory resends. |
| engine.solvers.neural | Neural computation solvers: a dense network’s counts, and one training epoch’s time. |
| engine.solvers.operations | Agent-operations solvers: traces, retention, and staged release (added 2026-10-20). |
| engine.solvers.orchestration | Cluster orchestration and queueing solvers. |
| engine.solvers.parallelism | Distributed-training solvers: parallel layouts, ZeRO sharding, data-parallel |
| engine.solvers.perception | Sensor-perception solvers: capture timing, observation age, and measured error scales (added 2026-10-20). |
| engine.solvers.performance | Single-node, network-roofline, efficiency, and inverse-design solvers. |
| engine.solvers.plant | Physical-plant solvers: the stopping, actuation, heat, and power budgets of an |
| engine.solvers.proposer | Learned-proposer solvers: what one fresh evaluation costs, and how long its evidence lasts. |
| engine.solvers.realtime | Real-time solvers: the timed path between a learned proposer and the drives. |
| engine.solvers.recovery | Failure-recovery solvers: what the runtime does once an effect has failed (added 2026-10-20). |
| engine.solvers.reinforcement | Reinforcement learning from verifiable rewards: what a reward measures and what the loop costs. |
| engine.solvers.reliability | Reliability and checkpoint-interval solvers. |
| engine.solvers.retrieval | Retrieval solvers: what a read from long-term memory stages, ranks, streams, and maintains. |
| engine.solvers.sandboxes | Agent-sandbox solvers: the cost of an isolation envelope (added 2026-10-20). |
| engine.solvers.security | Agent-security solvers: injection exposure and defense evaluation (added 2026-10-20). |
| engine.solvers.serving_scale | Serving-at-scale solvers: KV-cache admission and quantization capacity dividends. |
| engine.solvers.storage | Storage solvers: what a training fleet reads, saves, and pays to move. |
| engine.solvers.supervision | Responsible physical AI solvers: a detection gap in meters and joules, one assistant’s queue. |
| engine.solvers.sustainability | Sustainability solvers: facility power, run footprints, carbon placement, time shifting, and demand. |
| engine.solvers.tool_calls | Tool-calling solvers: what a retry duplicates, an observation carries, a poll costs, a catalog stages. |
| engine.solvers.training | Training memory, checkpointing, and scaling-law solvers. |
| engine.solvers.trajectory | Trajectory-planning solvers: joint rates, handoff deadlines, seams, swings, and jerk-limited stops. |
Physics: further domains
Closed-form formulas for numerics, neural layers, scaling, fine-tuning, agents’ tools and context, coordination, privacy, fairness, and power. Every function is also importable from mlsysim.physics.
| physics.context | Context engineering: the equations behind what one agent request carries. |
| physics.coordination | Coordination of several agents: partitions, schedules, shared writes, and correlated votes. |
| physics.fairness | Fairness arithmetic: error-rate identities, the bias feedback model, and gap sample sizes. |
| physics.fine_tuning | Fine-tuning on serialized trajectories: weighting, packing, and preference pairs. |
| physics.layers | Layer-level counting laws for neural network architectures (added 2026-10-20). |
| physics.motors | Model electric-motor heat, voltage limits, and geared-joint inertia. |
| physics.neural | Neural computation: what a dense network costs, and what its activations and loss compute. |
| physics.numerics | Number formats: the range a binary floating-point or two’s-complement format holds. |
| physics.power | Power delivery: load steps on a supply rail and their voltage droop. |
| physics.privacy | Differential privacy and information-leakage formulas (added 2026-10-20). |
| physics.scaling | Scaling-law arithmetic: power-law price lists and compute-optimal allocation. |
| physics.thermal | Heat removal by a coolant stream. |
| physics.tool_calls | Tool calling: the equations behind a mediated call, its retry, and its catalog. |
Provenance and formatting
How sourced values carry their audit trail, and how quantities are formatted for prose.
| core.provenance.Provenance | How we know a numeric value (package audit trail; not BibTeX). |
| core.provenance.ProvenanceKind | How a registry value is known. Evidence-backed kinds (datasheet, |
| core.provenance.Sourced | Scalar with mandatory Provenance. Subclasses float so notebooks and |
| fmt.fmt | Format a Pint Quantity (or plain number) for narrative text. |
| fmt.fmt_int | Format a value as an integer for narrative text. |
Calculation scenarios
Browse scenarios by domain, or find a known class in the alphabetical index. Each type has its own contract page.