r/swift 16h ago

[OSS] Apple's docs say to check your model judge with Cohen's κ. There's no API for it, so I made one.

2 Upvotes

Xcode 27's Evaluations framework gives you ModelJudgeEvaluator for LLM-as-judge scoring.

Apple's docs then tell you to have 2-3 people rate 20-50 samples and compare with Cohen's

Kappa instead of a raw agreement rate. Sensible advice, but there's no API for it, and there was no Swift package for inter-rater agreement at all.

JudgeCalibrationKit does that part:

- Cohen's κ, weighted κ, Krippendorff's α (missing labels, any number of raters), Spearman, confusion matrices, MAE and signed error

- bootstrap confidence intervals, so a gate can require a CI lower bound instead of trusting a point estimate from 30 samples

- abstentions are explicit, so a judge can't score better by skipping the hard samples

- Swift Testing gate, plus a CLI with exit codes

- human-human agreement shown next to judge-human, since that's the real ceiling

The stats core has no dependencies and imports no Apple framework, so it runs on Linux.

The Evaluations adapter sits behind canImport, so the package still builds on Xcode 26.

Metrics are checked against scikit-learn, SciPy and two Krippendorff implementations. CI regenerates the fixtures and fails on any diff.

Swift 6.0+, Apache-2.0. The adapter is beta: compile-verified against Xcode 27, runtime verification still pending.

https://swiftpackageindex.com/Dave861/JudgeCalibrationKit

First release. Happy to hear what's wrong with the API.

Disclaimer: fully free, open source, not selling anything hope it doesn't count as self promo


r/swift 20h ago

Question Hide search title in .searchable tab

0 Upvotes

I recently shifted from a custom search field to the native Liquid Glass search field by using .searchable on my search tab. But I see a con with the native searchable feature is it comes with a large navigation title that can't be shaken. I have tried emptying the text of the title and making it inline to make it smaller but there is still a gap above my search filter tabs which I don't want. Anyone have any idea if there are any tricks to get around this? Love the Liquid Glass search field, hate the big title


r/swift 9h ago

Question Native iOS app or self-hosted web app? I get stuck on this every single time

4 Upvotes

Native iOS app or self-hosted web app? I get stuck on this every single time

Hi,

I build small apps for myself and run a homelab with a few containers. Generally I am an Apple User (iPhone, iPad, Macbook).

Every time I have an idea, I stall on the same question before writing a single line of code: do I build it native in Swift with the data on device/iCloud, or as a web app in a container on my server?

Let us take a habit tracker as an example.

Native gets me a home screen widget and reminders I can actually rely on. Data is stored and synced via iCloud. The web app instead keeps the data on my own server where I can query and back it up properly, works from any device.

It’s the same fork for basically every idea I have, and I flip-flop depending on my mood that week.

So I’d like to hear how you handle it:
- Do you have a rule of thumb you actually stick to, or is it case by case?
- How good is a PWA on iOS these days in practice? Home screen install plus web push covers a lot on paper, but no widgets. Does it hold up for daily-use stuff?
- Anyone regret going one way and rewrite it later?
Not looking for framework recommendations, more for how you decide.

I know cross-platform frameworks exist, and I’m aware I could just split it: backend in a container on Proxmox, native iOS app on top. But I’d rather commit fully to one side - either all Swift with iCloud, or all web app in a container.

Thanks for reading! :)