Card: lead with CoreAIKit ChatSession (kit-enrolled)
Browse files
README.md
CHANGED
|
@@ -43,11 +43,22 @@ iPhone 17 Pro** — the [zoo](https://github.com/john-rocky/coreai-model-zoo) sh
|
|
| 43 |
|
| 44 |
## Use it
|
| 45 |
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
`
|
| 49 |
-
|
| 50 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
|
| 52 |
Engine contract (decode-only static-`[1,1]` graph): set `COREAI_CHUNK_THRESHOLD=1` before engine
|
| 53 |
creation (prefill runs as pipelined S=1 steps); don't call `engine.warmup()` (it warms query
|
|
|
|
| 43 |
|
| 44 |
## Use it
|
| 45 |
|
| 46 |
+
**[CoreAIKit](https://github.com/john-rocky/coreai-kit)** (SPM) — one line, on-device:
|
| 47 |
+
|
| 48 |
+
```swift
|
| 49 |
+
import CoreAIKit
|
| 50 |
+
|
| 51 |
+
let chat = try await ChatSession(catalog: "youtu-llm-2b")
|
| 52 |
+
let reply = try await chat.respond(to: "What can you do, offline?")
|
| 53 |
+
// downloads this repo once, then runs fully on-device; the <think> reasoning
|
| 54 |
+
// arrives as .thinking events, reply.content is the final answer
|
| 55 |
+
```
|
| 56 |
+
|
| 57 |
+
Or the [ChatDemo runner](https://github.com/john-rocky/coreai-kit/tree/main/Examples/ChatDemo)
|
| 58 |
+
(GUI + `swift run chat-cli --model youtu-llm-2b`), or the zoo's
|
| 59 |
+
[CoreAIChat](https://github.com/john-rocky/coreai-model-zoo/tree/main/apps/CoreAIChat) app
|
| 60 |
+
(pick **Youtu-LLM 2B**). 2B (≥2 GB) bundles need the host app's
|
| 61 |
+
`com.apple.developer.kernel.increased-memory-limit` entitlement.
|
| 62 |
|
| 63 |
Engine contract (decode-only static-`[1,1]` graph): set `COREAI_CHUNK_THRESHOLD=1` before engine
|
| 64 |
creation (prefill runs as pipelined S=1 steps); don't call `engine.warmup()` (it warms query
|