HomeWork / SwiftLLM Selected work

Project notes

SwiftLLM

A Swift-native reliability layer for local-first, on-device language model features on Apple platforms.

SwiftApache-2.0v1.0.0Stable

Repository snapshot

  • 23Commits
  • Aug 2026Last updated
  • Apache-2.0License
  • May 2026Started
  • Swift 99.8%
  • Shell 0.2%

Overview

SwiftLLM is not an attempt to make Apple's small on-device model behave like a frontier cloud model. It is the orchestration layer that production AI features need anyway, even when the model is local and offline: prompt contracts, token budgeting, chunked long-input pipelines, structured-generation validation, source-aware local RAG, and deterministic fallbacks.

Highlights

  • 01

    Prompt contracts & versioning

    Versioned prompts with regression-friendly evaluation and redacted local diagnostics.

  • 02

    Context & chunking

    Boundary-aware text and transcript chunking with score-density context packing and map/reduce.

  • 03

    Structured generation

    Schema descriptors, generic validators, and repair and fallback policies in a provider-neutral pipeline.

  • 04

    Local RAG

    Source references, deterministic keyword retrieval, source-diverse packing, and citation rendering.

  • 05

    Foundation Models adapter

    Availability normalization, token counting, prewarming, typed guided generation, and error mapping.

  • 06

    Deterministic fallbacks

    Graceful degradation with local-only run metadata and diagnostics; the core makes no network calls, and cloud providers are opt-in adapters.

Products

SwiftLLM
Core prompt, context, fallback, validation, and metadata primitives.
SwiftLLMFoundationModels
Apple Foundation Models availability, token counting, prewarming, generation, and error normalization.
SwiftLLMOpenAI
OpenAI Responses API adapter, opt-in.
SwiftLLMAnthropic
Anthropic Messages API adapter, opt-in.
SwiftLLMEvaluation
Lightweight prompt regression and output assertion utilities.

Shortcut

Curious what my part was? Ask your AI.

It reads the same facts behind this page: what shipped, what I built, and where it fits with the rest of my work.

SwiftLLM is open source.

Browse the code and docs, or get in touch if you need a platform or developer tool built.