gen-cards: regenerate Use-it block
Browse files32 unmodified lines3334353637381 unmodified line404142434445464748495051525354555657585960616263646566676869707172731 unmodified line7576777879808182838432 unmodified lines<!-- gen-cards:use-it begin id=glm-4.7-flash (managed by scripts/gen-cards β edit cards.json / QuickStart.swift, not this block) -->## Use itβ‘ **One line** β run the kit's task op on this model(`import CoreAIOps`; no session, no model plumbing, downloads on first use):1 unmodified linelet tldr = try await CoreAI.summarize(text, options: .model("glm-4.7-flash"))```Every op, one shape β [Cookbook](https://github.com/john-rocky/coreai-kit/blob/main/docs/COOKBOOK.md).βΆοΈ **Run it (source)** β the [ChatDemo runner](https://github.com/john-rocky/coreai-kit/tree/main/Examples/ChatDemo)(GUI + CLI, one app for every chat model in the catalog):```bashgit clone https://github.com/john-rocky/coreai-kitopen coreai-kit/Examples/ChatDemo/ChatDemo.xcodeproj# β Run, then pick "GLM-4.7-Flash (MoE+MLA)" in the model picker# agents / headless (macOS):cd coreai-kit/Examples/ChatDemoswift run chat-cli --model glm-4.7-flash --prompt "What can you do, offline?"```π» **Build with it** β complete; the glue is kit API, copy-paste runs:```swiftimport CoreAIKitlet chat = try await ChatSession(catalog: "glm-4.7-flash")let reply = try await chat.respond(to: prompt)// reply: the answer, generated fully on-device```**When Apple's FoundationModels built-in model isn't enough, keep your session code and swap the model β one line.** CoreAIKit's [`KitLanguageModel`](https://github.com/john-rocky/coreai-kit#when-foundationmodels-isnt-enough) plugs this bundle into the same system `LanguageModelSession`; your `Tool`s, `@Generable` types and transcripts work unchanged, and capabilities (tool calling, guided generation) auto-detect per model.The take-home is [`Examples/ChatDemo/Sources/QuickStart.swift`](https://github.com/john-rocky/coreai-kit/blob/main/Examples/ChatDemo/Sources/QuickStart.swift)β this exact code as one typed function, no UI; the CLI is an argument shell over it, andthe GUI drives the same `ChatSession` across turns for its transcript.Multi-turn? Hold the `ChatSession` and call `respond(to:)` per turn β it keeps the1 unmodified line**Integration checklist**- SPM: `https://github.com/john-rocky/coreai-kit` β product **CoreAIKit**- Info.plist: none needed- Entitlements: none needed (macOS)- First run downloads the model β 30.0 GB (Mac) β then it loads from thelocal cache (Application Support; progress via the `downloadProgress` callback)- Measure in Release β Debug is ~3Γ slower on per-token host work<!-- gen-cards:use-it end -->32 unmodified lines33343536373839401 unmodified line4243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788891 unmodified line91929394959697989910032 unmodified lines<!-- gen-cards:use-it begin id=glm-4.7-flash (managed by scripts/gen-cards β edit cards.json / QuickStart.swift, not this block) -->## Use it**New to Core AI? [Start with CoreAIKit 0.7.1](https://github.com/john-rocky/coreai-kit#readme).** Follow its requirements and first-run steps for `qwen3-0.6b`, then open the same release's [ChatDemo](https://github.com/john-rocky/coreai-kit/tree/0.7.1/Examples/ChatDemo). The README records the tested OS/SDK and download size; model and device coverage is stated per example.β‘ **One line** β run the kit's task op on this model(`import CoreAIOps`; no session, no model plumbing, downloads on first use):1 unmodified linelet tldr = try await CoreAI.summarize(text, options: .model("glm-4.7-flash"))```Every op, one shape β [Cookbook](https://github.com/john-rocky/coreai-kit/blob/0.7.1/docs/COOKBOOK.md).βΆοΈ **Run it (source)** β the [ChatDemo runner](https://github.com/john-rocky/coreai-kit/tree/0.7.1/Examples/ChatDemo)(GUI + CLI, one app for every chat model in the catalog):```bashgit clone --branch 0.7.1 --depth 1 https://github.com/john-rocky/coreai-kitexport DEVELOPER_DIR=/Applications/Xcode-27.0.0-RC.app/Contents/Developeropen -a /Applications/Xcode-27.0.0-RC.app coreai-kit/Examples/ChatDemo/ChatDemo.xcodeproj# β Run, then pick "GLM-4.7-Flash (MoE+MLA)" in the model picker# agents / headless (macOS):cd coreai-kit/Examples/ChatDemoswift run -c release chat-cli --model glm-4.7-flash --prompt "What can you do, offline?"```Use Xcode build **27A266a** from the release's `.xcode-pin`; adjust the app path if your installation is named differently.π» **Build with it** β complete; the glue is kit API, copy-paste runs:```swiftimport CoreAIKitlet id = "glm-4.7-flash"let chat: ChatSessionif id == "qwen3-0.6b" {// Freeze the release starter; other selections retain the live catalog's// model-specific dispatch (including paired Gemma bundles).guard let model = ModelCatalog.builtin.entry(id: id)?.modelID else {throw CoreAIKitError.modelNotAvailableOnPlatform(id: id)}chat = try await ChatSession(model: model)} else {chat = try await ChatSession(catalog: "glm-4.7-flash")}let reply = try await chat.respond(to: prompt)// reply: the answer, generated fully on-device```**When Apple's FoundationModels built-in model isn't enough, keep your session code and swap the model β one line.** CoreAIKit's [`KitLanguageModel`](https://github.com/john-rocky/coreai-kit#works-with-apples-foundationmodels-api) plugs supported chat bundles into the system `LanguageModelSession`. Tool calling depends on the model's dialect; guided generation also requires a compatible sequential engine. Check the linked support matrix before using either capability.The take-home is [`Examples/ChatDemo/Sources/QuickStart.swift`](https://github.com/john-rocky/coreai-kit/blob/0.7.1/Examples/ChatDemo/Sources/QuickStart.swift)β this exact code as one typed function, no UI; the CLI is an argument shell over it, andthe GUI drives the same `ChatSession` across turns for its transcript.Multi-turn? Hold the `ChatSession` and call `respond(to:)` per turn β it keeps the1 unmodified line**Integration checklist**- SPM: `https://github.com/john-rocky/coreai-kit` (exact **0.7.1**) β product **CoreAIKit**- Info.plist: none needed- Entitlements: none needed (macOS)- First run downloads the model β ~30,000 MB (Mac) β then it loads from thelocal cache (Application Support; progress via the `downloadProgress` callback)- Measure in Release β Debug is ~3Γ slower on per-token host work<!-- gen-cards:use-it end -->
README.md+26-10