Skip to content

Rust API (Internal)

This section provides technical documentation for the paiOS engine Rust implementation. The engine is a runtime daemon that provides AI inference capabilities via gRPC over Unix Domain Sockets (UDS).

Two documentation formats are available to suit different needs:

Section titled “📖 Native Starlight Integration (Recommended)”

Best for: Understanding how Rust modules relate to the gRPC API and overall architecture.

  • ✅ Fully integrated with Starlight documentation
  • ✅ Consistent navigation and search
  • ✅ Cross-references with gRPC API docs
  • ✅ Contextual architecture information

Browse: Continue reading in the following sections or use the sidebar navigation.

Best for: Deep-dive into Rust types, traits, and implementations (familiar to Rust developers).

  • ✅ Standard rustdoc format (familiar to Rust developers)
  • ✅ Direct links to GitHub source code
  • ✅ Interactive type exploration
  • ✅ “Implementations” and “See also” links
Open Standard rustdoc

The engine is a Cargo workspace under engine/ with domain crates and a single binary:

  • pai-engine: Composition root (binary). Entry point, config load, adapter wiring. See Composition Root and Workspace and Build.
  • Domain crates (common, core, vision, audio, inference, api, peripherals): Hexagonal modules with ports and feature-gated adapters. See Engine Domains.

For the primary API documentation, see the gRPC API Reference.


Engine Runtime

CLI arguments, boot process, and daemon entry point (pai-engine binary). View Runtime