Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
rust-ringo-fm-sdk
Rust bindings for Apple's on-device Foundation Models framework.
Workspace layout
crates/ringo-fm-sys— raw FFI bindings (bindgen) to the Swift bridge fromringo-fm-bridge.crates/ringo-fm— idiomatic, async (tokio) wrapper. Public surface mirrors the Python package:SystemLanguageModel,LanguageModelSession,Prompt,GenerationSchema,Tool,Transcript, …crates/ringo-fm/examples/— Rust ports of the three Python examples.
Requirements
- macOS 26+ with Apple Intelligence enabled.
- Full Xcode 26+ install (
xcode-selectpointing atXcode.app, not just the CLI tools). - The vendored
crates/ringo-fm-sys/vendor/foundation-models-cSwift package included in this repository, or setAPPLE_FM_SDK_SWIFT_PKGto another compatiblefoundation-models-c/directory.
Quick start
use ;
async
Build & run
The Rust examples automatically add an rpath to crates/ringo-fm-sys/vendor/foundation-models-c/.build/release.
If your Swift package checkout lives elsewhere, set APPLE_FM_SDK_SWIFT_PKG to the absolute path
of that foundation-models-c directory before building or running.
Schema Discovery
LanguageModelSession::discover_schema uses guided generation to infer a
reviewable schema candidate from text, JSON, or already-extracted documents.
The response includes field candidates, evidence, warnings, metrics, and review
findings; treat it as a draft for human review, not an approved schema.
use ;
# async
Status
V1 ships everything from the Python public API except:
#[derive(Generable)]proc macro — implementGenerablemanually for now.- Multi-tool sessions — the C bridge maps every tool call through a single trampoline symbol, so v1 reliably supports one registered tool per session. Multi-tool dispatch needs a libffi-style closure trampoline; tracked as a follow-up.
License
Apache-2.0
Third-party code
This repository vendors crates/ringo-fm-sys/vendor/foundation-models-c from ringo-fm-bridge, which is
licensed under Apache-2.0. The vendored package retains its original source headers, and a copy of
the bridge license is included at crates/ringo-fm-sys/vendor/foundation-models-c/LICENSE.md.