[{"data":1,"prerenderedAt":253},["ShallowReactive",2],{"project-45052200":3},{"id":4,"name":5,"line":6,"line_source":7,"title":8,"url":9,"domain":10,"maker":11,"posted_at":12,"year":13,"points":14,"comments":15,"rank_in_year":16,"shown_in_year":17,"top":18,"tier":19,"category":20,"subcategory":21,"format":22,"keywords":23,"reception":29,"sentiment":30,"stance_mix":31,"scored_comments":36,"aspects":37,"strip":45,"post_text":47,"what":48,"said":80,"maker_in_thread":142,"shape":153,"grid":157,"attempts":215,"same_week":216,"maker_shows":39,"maker_hidden":245,"reader_version":246,"card":247},"45052200","SwiftAI","open-source library to easily build LLM features on iOS\u002FmacOS","title","Show HN: SwiftAI – open-source library to easily build LLM features on iOS\u002FmacOS","https:\u002F\u002Fgithub.com\u002Fmi12labs\u002FSwiftAI","github.com","mi12-root",1756389111,2025,74,24,967,3837,26,"notable","dev_tools","swift library for llm integration","library",[24,25,26,27,28],"swift","ios llm","on-device llm","apple foundation models","swift ai sdk","roasted",-0.159,{"positive":32,"neutral":33,"mixed":34,"critical":35},4,2,0,6,12,{"idea":38,"design":41,"performance":42,"docs":43,"execution":44},{"positive":39,"critical":40},1,3,{"positive":39,"critical":34},{"positive":34,"critical":34},{"positive":39,"critical":33},{"positive":39,"critical":39},[46,34,46,34,40,34,40,34,39,34,34,34,34,34,39,39,34,39,34,39,46,46,39,34],5,"We built SwiftAI, an open-source Swift library that lets you use Apple’s on-device LLMs when available (Apple opened access in June), and fall back to a cloud model when they aren’t available — all without duplicating code.\n\nSwiftAI gives you: - A single, model-agnostic API - An agent\u002Ftool loop - Strongly-typed structured outputs - Optional chat state\n\nBackstory: We started experimenting with Apple’s local models because they’re free (no API calls), private, and work offline. The problem: not all devices support them (older iPhones, Apple Intelligence disabled, low battery, etc.). That meant w",{"problem":49,"audience":55,"pricing":60,"motivation":61,"time_to_build":60,"stack":65,"openness":78,"stage":79,"team_size":79},{"value":50,"source":51,"evidence":52},"Writing separate code paths for on-device and cloud LLMs on Apple platforms","maker",[53],{"id":54},"post",{"value":56,"source":57,"evidence":58},"iOS and macOS developers building LLM features","inferred",[59],{"id":54},null,{"value":62,"source":51,"evidence":63},"Apple's local models are free, private and work offline, but not all devices support them",[64],{"id":54},[66,70,74],{"value":67,"source":51,"evidence":68},"Swift",[69],{"id":54},{"value":71,"source":51,"evidence":72},"Apple on-device system LLM",[73],{"id":54},{"value":75,"source":51,"evidence":76},"OpenAI API",[77],{"id":54},"open_source","unknown",{"praise":81,"objections":94,"requests":124,"questions":129,"alternatives":137},[82],{"value":83,"source":84,"evidence":85},"Useful wrapper for LLM calls on Apple platforms, API looks Swift-native","commenter",[86,90],{"id":87,"by":88,"text":89},"45056982","deanputney","Awesome, this is a good idea! Having a nice wrapper to make LLM calls easier is very helpful too :) Nice to see someone digging in on the system models. That's on my list to play…",{"id":91,"by":92,"text":93},"45057456","jc4p","I do a lot of AI work and right now the story for doing LLMs on iOS is very painful (but doing Whisper or etc is pretty nice) so this is existing and the API looks Swift native…",[95,106,113],{"value":96,"source":84,"evidence":97},"Documentation lacks examples for custom LLM integrations",[98,102],{"id":99,"by":100,"text":101},"45057381","keyle","Needs more example on custom.",{"id":103,"by":104,"text":105},"45063843","jdmg94","There is no examples or documentation on `CustomLLM` the README file has examples on `SystemLLM` and `OpenaiLLM` but there's no way for us to know if we need to bring in guff…",{"value":107,"source":84,"evidence":108},"Possibly built with AI coding tools, seen as vibe coded",[109],{"id":110,"by":111,"text":112},"45058211","lawgimenez","Another vibe coded.",{"value":114,"source":84,"evidence":115},"Name may conflict with Apple's Swift trademarks",[116,120],{"id":117,"by":118,"text":119},"45058136","rafram","You may get a letter from Apple’s lawyers because of the name - Swift and SwiftUI are trademarks, and this seems like something they’d want to keep for themselves.",{"id":121,"by":122,"text":123},"45058612","andsoitis","> Swift and SwiftUI are trademarks This is called SwiftAI, though.",[125],{"value":126,"source":84,"evidence":127},"Support for bringing own CoreML or on-device models",[128],{"id":91,"by":92,"text":93},[130],{"value":131,"source":84,"evidence":132},"Quality of Apple's on-device LLM responses and length control",[133],{"id":134,"by":135,"text":136},"45058876","hbcondo714","Mind me asking what your thoughts are on the overall quality of Apple's on-device LLMs? I've found that LanguageModelSession always returns very lengthy responses:…",[138],{"value":139,"source":84,"evidence":140},"llama.cpp with GGUF models",[141],{"id":91,"by":92,"text":93},{"comments":35,"answered":33,"key":143},[144,147,150],{"id":145,"text":146},"45057367","We’ve begun internally evaluating the model and will share our findings more in details later. So far, we’ve found that it performs well on tasks such as summarization, writing,…",{"id":148,"text":149},"45057630","That’s a good suggestion, and it indeed sounds like something we’d want to support. Could you help us better understand your use case? For example, where do you usually get the…",{"id":151,"text":152},"45065304","Thanks for sharing the details—that makes a lot of sense. Fine-tuning and exporting models on-device can be tedious nowadays. We’re planning to look into supporting popular…",{"commenters":154,"max_depth":46,"maker_replies":35,"first_comment_mins":155,"lifespan_hours":156},15,429,449,[158,160,162,164,166,168,169,171,173,175,177,180,183,185,189,192,194,197,199,202,203,207,210,212],[87,34,46,159,88,34],"project\u002Fpositive\u002Fidea",[145,34,34,161,11,39],"maker\u002Fneutral\u002Fperformance",[91,39,46,163,92,34],"project\u002Fpositive\u002Fdesign",[148,39,34,165,11,39],"maker\u002Fneutral\u002Fnone",[167,39,40,165,92,34],"45058549",[151,39,34,165,11,39],[134,33,40,170,135,34],"project\u002Fneutral\u002Fperformance",[172,33,34,161,11,39],"45065300",[117,40,39,174,118,34],"project\u002Fcritical\u002Fidea",[121,40,34,176,122,34],"commenter\u002Fcritical\u002Fidea",[178,40,34,176,179,34],"45058653","reactordev",[181,40,34,176,182,34],"45060241","steve1977",[184,40,34,176,118,34],"45060035",[186,40,34,187,188,34],"45090426","commenter\u002Fneutral\u002Fidea","farseer",[190,40,39,174,191,34],"45061324","leobg",[193,40,39,174,188,34],"45090411",[195,40,34,187,196,34],"45090527","fragmede",[99,32,39,198,100,34],"project\u002Fcritical\u002Fdocs",[200,32,34,201,11,39],"45057524","maker\u002Fneutral\u002Fdocs",[103,32,39,198,104,34],[204,32,46,205,206,34],"45109208","maker\u002Fpositive\u002Fdocs","achrafmam2",[208,32,46,209,206,34],"45258874","project\u002Fpositive\u002Fexecution",[110,46,39,211,111,34],"project\u002Fcritical\u002Fexecution",[213,46,34,214,11,39],"45065295","maker\u002Fneutral\u002Fexecution",[],[217,222,227,231,236,241],{"id":218,"name":219,"points":220,"category":221},"45071722","Hacker News em dash user leaderboard",377,"data",{"id":223,"name":224,"points":225,"category":226},"45088427","NeuroPriest",155,"games",{"id":228,"name":229,"points":230,"category":20},"45063874","Sosumi.ai",133,{"id":232,"name":233,"points":234,"category":235},"45064210","HN Overlooked",118,"productivity",{"id":237,"name":238,"points":239,"category":240},"45115974","Writing Arabic in English",111,"languages",{"id":242,"name":243,"points":244,"category":20},"45102664","Moribito",106,false,"v2",{"id":248,"name":5,"line":6,"ai":245,"cat":20,"year":13,"points":14,"comments":15,"rec":29,"s":249,"top":18,"kw":250,"maker":11,"domain":10,"tier":19,"attempts":34,"strip":251,"url":9,"mix":252,"praise":83,"objection":96,"sub":21},45052200,-0.16,[24,25,26,27,28],"505030301000001101015510",[32,33,34,35],1794036681509]