Skip to content

rudrankriyam/Foundation-Models-Adapter-Studio

Repository files navigation

Adapter Studio

Adapter Studio is a macOS companion app for exploring custom adapters built on top of Apple’s Foundation Models framework.

It lets you load a .fmadapter, run the system language model and the adapted model side by side, and watch their responses stream in real time.

The experience focuses on giving adapter authors fast feedback so they can iterate on prompts, training data, and adapter packaging without touching production code.

What You Can Do

  • Run live comparisons: Type a prompt once and stream responses from the base model and the adapter simultaneously. The interface highlights token flow, timing, and completion state for each side.
  • Inspect adapter context: Keep an eye on the adapter’s filename, last-modified timestamp, size, and any creator metadata exposed by the package. Quick actions let you swap adapters, reveal them in Finder, or re-import an updated build.
  • Measure latency: Each column surfaces time-to-first-token and total duration, making it easy to spot latency regressions or gains after an adapter tweak.
  • Log everything: OSLog instrumentation captures prompt runs, token counts, failures, and completions so you can correlate UI observations with Console output during development.

How It Works

  1. Select an adapter using the toolbar or header controls. The picker copies the file into ~/Library/Application Support/AdapterStudio/Adapters so the app can reuse it across runs.
  2. Submit a prompt. Adapter Studio trims the input, cancels any previous stream, and asks the ModelCompareEngine to run the prompt through both the baseline system model and the adapter-backed model.
  3. Watch the stream. As tokens arrive, the columns update with monospaced text, in-place metrics, and placeholder states when a model has not yet produced output.
  4. React to outcomes. Toast banners bubble up successes, warnings, or recoverable errors, while persistent state in the header and columns keeps the latest result visible until the next run.

Key Concepts

  • ModelCompareEngine maintains long-lived LanguageModelSessions so each run starts instantly. It emits a structured async stream describing run lifecycle events, token snapshots, availability issues, and final summaries.
  • CompareViewModel listens to those events, keeping track of prompts, streaming text, metrics, and the high-level run state (idle, running, failed, completed). SwiftUI views bind directly to this observable state.
  • AdapterProvider handles import/copy, exposes previously saved adapters, and produces an AdapterContext containing both the instantiated adapter and the metadata needed for the UI.

Requirements

  • macOS 26 or later with Apple Intelligence enabled
  • Xcode 26 or later
  • Access to .fmadapter packages generated by the Foundation Models training toolkit

Build & Launch

xcodebuild -scheme "Adapter Studio" -project "Adapter Studio.xcodeproj" -destination 'platform=macOS' build

Run the target from Xcode to open the Adapter Studio window. Import an adapter, craft a prompt, and evaluate how the adapted model behaves relative to the baseline system model.

Roadmap

Longer-term ideas—such as transcript history, diff visualizations, batch comparisons, and automation hooks—are tracked in AdapterStudioPlan.md. For now, the focus remains on delivering a frictionless side-by-side evaluation loop for adapter developers.

Star History Chart

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published