inventory_optimization
Calculate safety stock and inventory costs for freight decisions, comparing ocean and air modes to reveal how faster transit frees working capital.
Instructions
Size the INVENTORY a freight decision forces you to hold. The freight choice (mode, reliability, transit time) DETERMINES your safety stock — this computes it. Give the lane + your annual demand (units) + unit value, and it returns, per mode (ocean baseline vs a faster/more-reliable air option): the SAFETY STOCK = z(service level) × σ of lead-time-demand (σ_LTD = sqrt(L·σ_demand² + demand²·σ_lead²), reusing the lane's modeled transit time AND its variability from the transit engine), the REORDER POINT, the Wilson EOQ, and the TOTAL inventory cost (ordering + cycle holding + safety-stock holding). It proves THE trade-off: a faster, more reliable mode shrinks the lead time and its variability → a SMALLER safety stock → released working capital + lower holding — so the 'expensive' freight can pay for itself in less immobilised inventory. Honest (regla 7): textbook OR (normal-approx safety stock, Wilson EOQ) with indicative default cost parameters you should override. PREMIUM: pay per call with x402 (USDC on Base) or a prepaid key.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| origin_port | Yes | Origin port (city name, UN/LOCODE, or 'City, Country'). | |
| dest_port | Yes | Destination port. | |
| container_type | No | Container '20ft'/'40ft'/'40HC'. Optional; default '40ft'. | |
| annual_demand_units | Yes | Annual demand in UNITS. REQUIRED — inventory policy is sized off it. | |
| unit_value_usd | Yes | Per-unit value (USD). REQUIRED — drives holding cost and immobilised capital. | |
| demand_cv | No | Demand coefficient of variation (σ_demand/mean). Optional; default 0.30. | |
| service_level | No | Target cycle service level (in-stock probability, e.g. 0.95). Optional; default 0.95. | |
| annual_holding_rate_pct | No | Annual holding cost as a fraction of unit value (e.g. 0.25). Optional; default 0.25. | |
| ordering_cost_usd | No | Fixed cost per purchase order (USD). Optional; default 250. | |
| units_per_container | No | Units per ocean container (for the annual freight trade-off). Optional. | |
| air_weight_kg | No | Air shipment weight per consignment (kg) to price the air freight side of the trade-off. Optional. | |
| air_volume_m3 | No | Air shipment volume per consignment (m³). Optional. | |
| ship_date | No | Ship date (YYYY-MM-DD). Optional; default today. |