<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/how-to-use-apple-s-foundation-models-in-a-web-app-with-a-macos-companion-meb39q1kw" -->

---
title: How to Use Apple’s Foundation Models in a Web App with a...
description: A step-by-step guide to building a web app that uses Apple's on-device Foundation Models and Vision frameworks via a Swift macOS companion app. The companion...
canonical: https://daily.dev/posts/how-to-use-apple-s-foundation-models-in-a-web-app-with-a-macos-companion-meb39q1kw
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: How to Use Apple’s Foundation Models in a Web App with a macOS Companion | daily.dev
og:description: A step-by-step guide to building a web app that uses Apple's on-device Foundation Models and Vision frameworks via a Swift macOS companion app. The companion...
og:url: https://daily.dev/posts/how-to-use-apple-s-foundation-models-in-a-web-app-with-a-macos-companion-meb39q1kw
og:image: https://api.daily.dev/og/posts/meb39q1kw.png
og:image:alt: How to Use Apple’s Foundation Models in a Web App with a macOS Companion
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Use Apple’s Foundation Models in a Web App with a macOS Companion

**[freeCodeCamp](https://daily.dev/sources/freecodecamp)** · 16 min read · 1 upvotes · 0 comments

## Summary

A step-by-step guide to building a web app that uses Apple's on-device Foundation Models and Vision frameworks via a Swift macOS companion app. The companion exposes a local HTTP API that accepts image uploads from a React frontend, runs OCR with Apple Vision, feeds the results into Foundation Models for structured analysis, and returns JSON to the browser — all without sending data to the cloud. Covers project structure, React image upload and base64 encoding, Swift routing, availability checks, Vision OCR, prompt construction, and JSON response handling.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.freecodecamp.org/news/how-to-use-apple-s-foundation-models-in-a-web-app-with-a-macos-companion>

## Questions this post answers

### Can Apple's Foundation Models framework accept an image directly as input?

No, the public Foundation Models framework only accepts text input and does not currently expose direct image input like a multimodal cloud model would. To work with images, developers must first run Apple Vision OCR to extract text observations, confidence scores, and bounding boxes, then feed that structured text into the Foundation Models prompt instead of the raw pixels.

_Developers building on-device AI features can track Apple framework capabilities like this on daily.dev._

### How do I check if Apple's on-device Foundation Models are available on a user's Mac?

Check SystemLanguageModel.default.availability, which returns .available, .unavailable(reason), or an unknown case. When unavailable, the reason (such as Apple Intelligence being disabled or unsupported hardware) can be surfaced as a string like unavailable.appleIntelligenceNotEnabled so the app can explain why rather than silently failing.

_Anyone shipping Apple Intelligence features can follow daily.dev for practical on-device AI implementation patterns._

### What macOS version and hardware do I need to use Apple's Foundation Models framework?

You need macOS 26 or newer, Xcode with the macOS 26 SDK, and a Mac that supports Apple Intelligence. Availability additionally depends on the specific Mac model and whether Apple Intelligence is enabled in system settings, so apps should check this at runtime rather than assume it works.

_Developers planning Apple Intelligence integrations can keep up with framework requirements via daily.dev._

## Similar posts on daily.dev

- [When to Use Apple Foundation Models on Mobile](https://daily.dev/posts/when-to-use-apple-foundation-models-on-mobile-nuyxlcjm5) · Callstack Blog · 1 upvotes · 0 comments
- [Working with Images Using Foundation Models](https://daily.dev/posts/working-with-images-using-foundation-models-7j2tfzath) · AzamSharp · 3 upvotes · 2 comments
- [Building AI features using Foundation Models. Multimodal input.](https://daily.dev/posts/building-ai-features-using-foundation-models-multimodal-input--rspctzfvk) · Swift with Majid · 0 upvotes · 0 comments

---

Tags: [#react](https://daily.dev/tags/react), [#swift](https://daily.dev/tags/swift), [#local-ai](https://daily.dev/tags/local-ai)

[View this post on daily.dev](https://daily.dev/posts/how-to-use-apple-s-foundation-models-in-a-web-app-with-a-macos-companion-meb39q1kw)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"How to Use Apple’s Foundation Models in a Web App with a macOS Companion","url":"https://daily.dev/posts/how-to-use-apple-s-foundation-models-in-a-web-app-with-a-macos-companion-meb39q1kw","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/how-to-use-apple-s-foundation-models-in-a-web-app-with-a-macos-companion-meb39q1kw"},"datePublished":"2026-07-20T23:10:52.038Z","dateModified":"2026-09-14T07:38:54.863Z","description":"A step-by-step guide to building a web app that uses Apple's on-device Foundation Models and Vision frameworks via a Swift macOS companion app. The companion...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/cfc4609e0717432d1edfca2cfbcc0be0?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/cfc4609e0717432d1edfca2cfbcc0be0?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"freeCodeCamp","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"freeCodeCamp","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1628412854/logos/freecodecamp","url":"https://daily.dev/sources/freecodecamp"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/how-to-use-apple-s-foundation-models-in-a-web-app-with-a-macos-companion-meb39q1kw","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"react,swift,local-ai","timeRequired":"PT16M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"freeCodeCamp","item":"https://daily.dev/sources/freecodecamp"},{"@type":"ListItem","position":3,"name":"How to Use Apple’s Foundation Models in a Web App with a macOS Companion"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/how-to-use-apple-s-foundation-models-in-a-web-app-with-a-macos-companion-meb39q1kw#faq","mainEntity":[{"@type":"Question","name":"Can Apple's Foundation Models framework accept an image directly as input?","acceptedAnswer":{"@type":"Answer","text":"No, the public Foundation Models framework only accepts text input and does not currently expose direct image input like a multimodal cloud model would. To work with images, developers must first run Apple Vision OCR to extract text observations, confidence scores, and bounding boxes, then feed that structured text into the Foundation Models prompt instead of the raw pixels. Developers building on-device AI features can track Apple framework capabilities like this on daily.dev."}},{"@type":"Question","name":"How do I check if Apple's on-device Foundation Models are available on a user's Mac?","acceptedAnswer":{"@type":"Answer","text":"Check SystemLanguageModel.default.availability, which returns .available, .unavailable(reason), or an unknown case. When unavailable, the reason (such as Apple Intelligence being disabled or unsupported hardware) can be surfaced as a string like unavailable.appleIntelligenceNotEnabled so the app can explain why rather than silently failing. Anyone shipping Apple Intelligence features can follow daily.dev for practical on-device AI implementation patterns."}},{"@type":"Question","name":"What macOS version and hardware do I need to use Apple's Foundation Models framework?","acceptedAnswer":{"@type":"Answer","text":"You need macOS 26 or newer, Xcode with the macOS 26 SDK, and a Mac that supports Apple Intelligence. Availability additionally depends on the specific Mac model and whether Apple Intelligence is enabled in system settings, so apps should check this at runtime rather than assume it works. Developers planning Apple Intelligence integrations can keep up with framework requirements via daily.dev."}}]}
```

