mlboydaisuke commited on
Commit
4648a23
Β·
verified Β·
1 Parent(s): c4cdbf7

gen-cards: regenerate Use-it block

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