Build with LedgeKit
See what your models did. Use real application inputs to make the next version better.
LedgeKit records your app's model requests and brings their inputs, responses, timing, and errors into one place. Add tracing to an Apple Foundation Models session, inspect the result in the console, and turn useful inputs into evaluation datasets.
Record your first request
Connect the Swift SDK and see a Foundation Models response in the console.
Explore the Swift SDK
Trace structured responses, multi-turn sessions, and agent workflows.
Evaluate real inputs
Save captured inputs and run them through your current application code.
Use the HTTP API
Upload traces and evaluations, read traces, and download datasets.
From a request to a better result
- Record a model request. Wrap your existing Foundation Models session. Your app still receives Apple's original response.
- Inspect what happened. Open the trace to see native model input/output, agent version, timing, and errors.
- Save an input. Add a useful trace or span's captured application input to a dataset in the console.
- Evaluate your current code. Download the dataset into your test target, execute your application's current implementation, and score its results.
- Review the report. Upload the original native evaluation file and inspect its samples and metrics.
Choose an integration
The Swift SDK includes a Foundation Models adapter, durable trace delivery, dataset loading, and evaluation reporting. Start with the quickstart.
For another model provider, record the request using the invocation APIs. Other clients can use the HTTP API directly.
What gets recorded
A run groups model invocations. Each invocation records the agent's identity and version, its model input/output, native capture, timing, and outcome. Your app can also attach original inputs, prompt templates, and output references.
Read runs, agents, and invocations to understand how the records relate to the trace and span views in the console.