An optical circuit, comprising: a substrate having a substrate front surface, the substrate defining a cavity that extends into the substrate front surface, the cavity having at least one sidewall, the sidewall including a substrate optical port, the substrate including an optical path that extends through the substrate from a connector optical port to the substrate optical port; and a photonic integrated circuit PIC, attachable to the substrate, the PIC having a PIC front surface that includes a plurality of electrical connections, the PIC having a PIC back surface, the PIC having a PIC edge surface that extends around at least a portion of a perimeter of the PIC between the PIC front surface and the PIC back surface, the PIC having a PIC optical port disposed on the PIC edge surface and configured to accept or emit an optical beam along a PIC optical axis, the PIC optical axis being aligned with the substrate optical port when the PIC is attached to the substrate, characterized in that the substrate includes a lens integral with the substrate, the lens configured to collimate a beam emitted from the PIC along the PIC optical axis when the PIC is attached to the substrate or focus a beam directed toward the PIC along the PIC optical axis when the PIC is attached to the substrate. a substrate having a substrate front surface, the substrate defining a cavity that extends into the substrate front surface, the cavity having at least one sidewall, the sidewall including a substrate optical port, the substrate including an optical path that extends through the substrate from a connector optical port to the substrate optical port; and the substrate defining a cavity that extends into the substrate front surface, the cavity having at least one sidewall, the sidewall including a substrate optical port, the substrate including an optical path that extends through the substrate from a connector optical port to the substrate optical port; and a photonic integrated circuit PIC, attachable to the substrate, the PIC having a PIC front surface that includes a plurality of electrical connections, the PIC having a PIC back surface, the PIC having a PIC edge surface that extends around at least a portion of a perimeter of the PIC between the PIC front surface and the PIC back surface, the PIC having a PIC optical port disposed on the PIC edge surface and configured to accept or emit an optical beam along a PIC optical axis, the PIC optical axis being aligned with the substrate optical port when the PIC is attached to the substrate, characterized in that the substrate includes a lens integral with the substrate, the lens configured to collimate a beam emitted from the PIC along the PIC optical axis when the PIC is attached to the substrate or focus a beam directed toward the PIC along the PIC optical axis when the PIC is attached to the substrate. the PIC having a PIC front surface that includes a plurality of electrical connections, the PIC having a PIC back surface, the PIC having a PIC edge surface that extends around at least a portion of a perimeter of the PIC between the PIC front surface and the PIC back surface, the PIC having a PIC optical port disposed on the PIC edge surface and configured to accept or emit an optical beam along a PIC optical axis, the PIC optical axis being aligned with the substrate optical port when the PIC is attached to the substrate, characterized in that the substrate includes a lens integral with the substrate, the lens configured to collimate a beam emitted from the PIC along the PIC optical axis when the PIC is attached to the substrate or focus a beam directed toward the PIC along the PIC optical axis when the PIC is attached to the substrate.