Skip to content

OpenAirInterface from Python

Use real OpenAirInterface 5G NR code through oai_python.bindings from one Python application. Call a PHY block, keep a complete link alive for thousands of slots, connect MAC decisions to real PHY paths, or test a scheduler without running separate UE and gNB terminals.

Install Quickstart Browse examples

Install

uv add oai-python==0.1.0
uv run oai-python-diagnose
"""Run a persistent OAI full-PHY link from one Python process."""

from oai_python.bindings.nr.phy.link import NrPhyLink

payload = bytes(range(64))
with NrPhyLink() as link:
    slot = link.step(downlink_payload=payload)
    link.run_slots(100)

(received,) = slot.transmissions
assert received.crc_ok and received.decoded_payload == payload
print(f"decoded {len(received.decoded_payload)} downlink bytes")

Expected output:

decoded 64 downlink bytes

The NrPhyLink owner persists across every call to step() and run_slots(). It shuts down cleanly when the with block exits.

What is covered

Public surface Coverage in 0.1
Supported workflows 42 exports
Supported granular/shared capabilities 476 exports
Additional reference-only OAI inventory 1,189 exports
Default NR wheel 1,707 exports across 272 leaf modules

The supported surface spans NR PHY, coding, MAC, RLC, PDCP, SDAP, RRC, NAS/security, FAPI/nFAPI, signaling, and O-RAN value/codecs. The coverage page separates supported workflows from granular capabilities and reference-only inventory.

What is excluded?

The 0.1 wheel contains the OpenAirInterface bindings, not alternative Python implementations, propagation models, Sionna RT, or native/custom CUDA. It does not provide RF/UHD/DPDK execution, an attached 5G core, live E2/O-RAN runtime, LTE/EPC/NSA, MIMO, mobility/handover, or coordinated inter-cell interference. Windows, macOS, and ARM wheels are also outside this release. External channel models remain user-owned Python connected at the time-domain IQ insertion point. See Platform and support for the exact boundary and future direction.

Performance per slot

Warm steady-state latency on the release benchmark host. Each row compares an identical workload at the direct-C and public Python-call boundaries.

Workload Original pinned OAI Python bindings
Connected gNB MAC slot 5.08 us p50 / 6.26 us p95 235.21 us p50 / 249.47 us p95
FR1 SISO PUSCH receive 185.81 us p50 / 194.54 us p95 985.10 us p50 / 1032.57 us p95

These rows do different telecom work. They are not a universal slot benchmark; see method and scope before comparing a number.

Pick a starting point