mlboydaisuke commited on
Commit
2800ef4
Β·
verified Β·
1 Parent(s): c3f35f0

gen-cards: regenerate Use-it block

Browse files
Files changed (1) hide show
  1. README.md +26 -10
README.md CHANGED
@@ -35,6 +35,8 @@ Part of the community Core AI model zoo: **https://github.com/john-rocky/coreai-
35
  <!-- gen-cards:use-it begin id=lfm2.5-8b-a1b (managed by scripts/gen-cards β€” edit cards.json / QuickStart.swift, not this block) -->
36
  ## Use it
37
 
 
 
38
  ⚑ **One line** β€” run the kit's task op on this model
39
  (`import CoreAIOps`; no session, no model plumbing, downloads on first use):
40
 
@@ -42,34 +44,48 @@ Part of the community Core AI model zoo: **https://github.com/john-rocky/coreai-
42
  let tldr = try await CoreAI.summarize(text, options: .model("lfm2.5-8b-a1b"))
43
  ```
44
 
45
- Every op, one shape β€” [Cookbook](https://github.com/john-rocky/coreai-kit/blob/main/docs/COOKBOOK.md).
46
 
47
- ▢️ **Run it (source)** β€” the [ChatDemo runner](https://github.com/john-rocky/coreai-kit/tree/main/Examples/ChatDemo)
48
  (GUI + CLI, one app for every chat model in the catalog):
49
 
50
  ```bash
51
- git clone https://github.com/john-rocky/coreai-kit
52
- open coreai-kit/Examples/ChatDemo/ChatDemo.xcodeproj
 
53
  # β†’ Run, then pick "LFM2.5-8B-A1B (MoE)" in the model picker
54
 
55
  # agents / headless (macOS):
56
  cd coreai-kit/Examples/ChatDemo
57
- swift run chat-cli --model lfm2.5-8b-a1b --prompt "What can you do, offline?"
58
  ```
59
 
 
 
60
  πŸ’» **Build with it** β€” complete; the glue is kit API, copy-paste runs:
61
 
62
  ```swift
63
  import CoreAIKit
64
 
65
- let chat = try await ChatSession(catalog: "lfm2.5-8b-a1b")
 
 
 
 
 
 
 
 
 
 
 
66
  let reply = try await chat.respond(to: prompt)
67
  // reply: the answer, generated fully on-device
68
  ```
69
 
70
- **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.
71
 
72
- The take-home is [`Examples/ChatDemo/Sources/QuickStart.swift`](https://github.com/john-rocky/coreai-kit/blob/main/Examples/ChatDemo/Sources/QuickStart.swift)
73
  β€” this exact code as one typed function, no UI; the CLI is an argument shell over it, and
74
  the GUI drives the same `ChatSession` across turns for its transcript.
75
  Multi-turn? Hold the `ChatSession` and call `respond(to:)` per turn β€” it keeps the
@@ -77,10 +93,10 @@ conversation history; `streamResponse(to:)` yields tokens as they decode.
77
 
78
  **Integration checklist**
79
 
80
- - SPM: `https://github.com/john-rocky/coreai-kit` β†’ product **CoreAIKit**
81
  - Info.plist: none needed
82
  - Entitlements: none needed (macOS)
83
- - First run downloads the model β€” 9.0 GB (Mac) β€” then it loads from the
84
  local cache (Application Support; progress via the `downloadProgress` callback)
85
  - Measure in Release β€” Debug is ~3Γ— slower on per-token host work
86
  <!-- gen-cards:use-it end -->
 
35
  <!-- gen-cards:use-it begin id=lfm2.5-8b-a1b (managed by scripts/gen-cards β€” edit cards.json / QuickStart.swift, not this block) -->
36
  ## Use it
37
 
38
+ **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.
39
+
40
  ⚑ **One line** β€” run the kit's task op on this model
41
  (`import CoreAIOps`; no session, no model plumbing, downloads on first use):
42
 
 
44
  let tldr = try await CoreAI.summarize(text, options: .model("lfm2.5-8b-a1b"))
45
  ```
46
 
47
+ Every op, one shape β€” [Cookbook](https://github.com/john-rocky/coreai-kit/blob/0.7.1/docs/COOKBOOK.md).
48
 
49
+ ▢️ **Run it (source)** β€” the [ChatDemo runner](https://github.com/john-rocky/coreai-kit/tree/0.7.1/Examples/ChatDemo)
50
  (GUI + CLI, one app for every chat model in the catalog):
51
 
52
  ```bash
53
+ git clone --branch 0.7.1 --depth 1 https://github.com/john-rocky/coreai-kit
54
+ export DEVELOPER_DIR=/Applications/Xcode-27.0.0-RC.app/Contents/Developer
55
+ open -a /Applications/Xcode-27.0.0-RC.app coreai-kit/Examples/ChatDemo/ChatDemo.xcodeproj
56
  # β†’ Run, then pick "LFM2.5-8B-A1B (MoE)" in the model picker
57
 
58
  # agents / headless (macOS):
59
  cd coreai-kit/Examples/ChatDemo
60
+ swift run -c release chat-cli --model lfm2.5-8b-a1b --prompt "What can you do, offline?"
61
  ```
62
 
63
+ Use Xcode build **27A266a** from the release's `.xcode-pin`; adjust the app path if your installation is named differently.
64
+
65
  πŸ’» **Build with it** β€” complete; the glue is kit API, copy-paste runs:
66
 
67
  ```swift
68
  import CoreAIKit
69
 
70
+ let id = "lfm2.5-8b-a1b"
71
+ let chat: ChatSession
72
+ if id == "qwen3-0.6b" {
73
+ // Freeze the release starter; other selections retain the live catalog's
74
+ // model-specific dispatch (including paired Gemma bundles).
75
+ guard let model = ModelCatalog.builtin.entry(id: id)?.modelID else {
76
+ throw CoreAIKitError.modelNotAvailableOnPlatform(id: id)
77
+ }
78
+ chat = try await ChatSession(model: model)
79
+ } else {
80
+ chat = try await ChatSession(catalog: "lfm2.5-8b-a1b")
81
+ }
82
  let reply = try await chat.respond(to: prompt)
83
  // reply: the answer, generated fully on-device
84
  ```
85
 
86
+ **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.
87
 
88
+ 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)
89
  β€” this exact code as one typed function, no UI; the CLI is an argument shell over it, and
90
  the GUI drives the same `ChatSession` across turns for its transcript.
91
  Multi-turn? Hold the `ChatSession` and call `respond(to:)` per turn β€” it keeps the
 
93
 
94
  **Integration checklist**
95
 
96
+ - SPM: `https://github.com/john-rocky/coreai-kit` (exact **0.7.1**) β†’ product **CoreAIKit**
97
  - Info.plist: none needed
98
  - Entitlements: none needed (macOS)
99
+ - First run downloads the model β€” ~9,000 MB (Mac) β€” then it loads from the
100
  local cache (Application Support; progress via the `downloadProgress` callback)
101
  - Measure in Release β€” Debug is ~3Γ— slower on per-token host work
102
  <!-- gen-cards:use-it end -->