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.0Incubating

Repository snapshot

  • 1Commits
  • May 2026Updated in snapshot
  • Apache-2.0License
  • May 2026Started
  • Swift 99.5%
  • Shell 0.5%

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; nothing leaves the device.

Products

SwiftLLM
Core prompt, context, fallback, validation, and metadata primitives.
SwiftLLMFoundationModels
Apple Foundation Models availability, token counting, prewarming, generation, and error normalization.
SwiftLLMEvaluation
Lightweight prompt regression and output assertion utilities.

SwiftLLM is open source.

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