{"id":30452064,"url":"https://github.com/saharshv/foundation-model-tutorial","last_synced_at":"2025-10-16T05:36:43.286Z","repository":{"id":307912112,"uuid":"1031061210","full_name":"Saharshv/Foundation-Model-Tutorial","owner":"Saharshv","description":"iOS 26 chat app showcasing FoundationModels framework: on-device LLMs, tool calling, EventKit integration, and privacy-first AI implementation","archived":false,"fork":false,"pushed_at":"2025-08-12T06:39:01.000Z","size":14,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-23T18:19:01.905Z","etag":null,"topics":["apple-intelligence","chat-app","eventkit","foundation-models","ios","ios26","llm","mvvm","on-device-ai","swift","swiftui","tutorial"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Saharshv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-02T23:26:34.000Z","updated_at":"2025-08-17T07:03:28.000Z","dependencies_parsed_at":"2025-08-23T17:18:02.685Z","dependency_job_id":null,"html_url":"https://github.com/Saharshv/Foundation-Model-Tutorial","commit_stats":null,"previous_names":["saharshv/foundation-model-tutorial"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Saharshv/Foundation-Model-Tutorial","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saharshv%2FFoundation-Model-Tutorial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saharshv%2FFoundation-Model-Tutorial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saharshv%2FFoundation-Model-Tutorial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saharshv%2FFoundation-Model-Tutorial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Saharshv","download_url":"https://codeload.github.com/Saharshv/Foundation-Model-Tutorial/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saharshv%2FFoundation-Model-Tutorial/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279159535,"owners_count":26116492,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-16T02:00:06.019Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apple-intelligence","chat-app","eventkit","foundation-models","ios","ios26","llm","mvvm","on-device-ai","swift","swiftui","tutorial"],"created_at":"2025-08-23T14:38:05.950Z","updated_at":"2025-10-16T05:36:43.280Z","avatar_url":"https://github.com/Saharshv.png","language":"Swift","readme":"# Foundation Models Chat App Tutorial\n\nA comprehensive iOS chat application demonstrating the new **FoundationModels** framework introduced in iOS 26. This tutorial app showcases how to integrate on-device large language models (LLMs) with custom tools and real-time chat functionality.\n\n## 🎯 Overview\n\nThis chat application serves as a practical example of Apple's FoundationModels framework, featuring:\n\n- **On-device LLM integration** using `FoundationModels`\n- **Custom tool implementation** for calendar event creation\n- **Real-time chat interface** with SwiftUI\n- **MVVM architecture** for clean code organization\n- **Tool calling capabilities** that allow the AI to interact with system APIs\n\n## 🔧 Features\n\n### Core Functionality\n- Interactive chat interface with on-device AI responses\n- Real-time typing indicators and message timestamps\n- Automatic model availability detection and user feedback\n- Calendar event creation through natural language commands\n\n### Technical Highlights\n- **FoundationModels Framework**: Leverages Apple's new on-device LLM capabilities\n- **Tool Integration**: Custom `CreateEventTool` that allows the AI to create calendar events\n- **EventKit Integration**: Seamless calendar access with proper permission handling\n- **Reactive Programming**: Uses Combine for state management and UI updates\n\n## 📱 Requirements\n\n- **iOS 26.0+**\n- **Xcode 26+** (Required for FoundationModels framework)\n- **Apple Intelligence enabled** on the device\n- **Calendar access permissions**\n\n\n## 🔑 Key Components\n\n### OnDeviceLLMManager\nThe heart of the LLM integration, handling:\n- Model availability checking across different states\n- Session management with tool integration\n- Response generation with error handling\n- Publishing loading states for UI updates\n\n### CreateEventTool\nA custom tool implementation that:\n- Conforms to the `Tool` protocol from FoundationModels\n- Uses `@Generable` and `@Guide` for parameter definition\n- Integrates with EventKit for calendar operations\n- Provides structured responses back to the LLM\n\n### ChatRepository\nManages chat data flow:\n- Message storage and publishing\n- Coordination between user input and LLM responses\n- Model availability status communication\n\n## 📚 Learning Resources\n\nThis tutorial demonstrates key concepts from:\n- [Apple's FoundationModels Documentation](https://developer.apple.com/documentation/foundationmodels)\n- [EventKit Framework Guide](https://developer.apple.com/documentation/eventkit)\n\n---\n\n**Note**: This tutorial requires the latest iOS 26 beta and may require adjustments as the FoundationModels framework evolves during the beta period.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaharshv%2Ffoundation-model-tutorial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaharshv%2Ffoundation-model-tutorial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaharshv%2Ffoundation-model-tutorial/lists"}