gen-cards: regenerate Use-it block
Browse files
README.md
CHANGED
|
@@ -37,6 +37,8 @@ on `inputs_embeds`, so this is a pure-export port (not the static-input-buffer V
|
|
| 37 |
<!-- gen-cards:use-it begin id=unlimited-ocr (managed by scripts/gen-cards β edit cards.json / QuickStart.swift, not this block) -->
|
| 38 |
## Use it
|
| 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,21 +46,24 @@ on `inputs_embeds`, so this is a pure-export port (not the static-input-buffer V
|
|
| 44 |
let markdown = try await CoreAI.read(documentAt: url, options: .model("unlimited-ocr"))
|
| 45 |
```
|
| 46 |
|
| 47 |
-
Every op, one shape β [Cookbook](https://github.com/john-rocky/coreai-kit/blob/
|
| 48 |
|
| 49 |
-
βΆοΈ **Run it (source)** β the [ReadDoc runner](https://github.com/john-rocky/coreai-kit/tree/
|
| 50 |
(GUI + CLI, one app for every document-OCR model in the catalog):
|
| 51 |
|
| 52 |
```bash
|
| 53 |
-
git clone https://github.com/john-rocky/coreai-kit
|
| 54 |
-
|
|
|
|
| 55 |
# β Run, then pick "Unlimited-OCR" in the model picker
|
| 56 |
|
| 57 |
# agents / headless (macOS):
|
| 58 |
cd coreai-kit/Examples/ReadDoc
|
| 59 |
-
swift run readdoc-cli --model unlimited-ocr --image sample.png
|
| 60 |
```
|
| 61 |
|
|
|
|
|
|
|
| 62 |
π» **Build with it** β complete; the glue is kit API, copy-paste runs:
|
| 63 |
|
| 64 |
```swift
|
|
@@ -70,7 +75,7 @@ let markdown = try await reader.read(imageAt: imageURL)
|
|
| 70 |
// <|det|> layout boxes, reading order β fully on-device
|
| 71 |
```
|
| 72 |
|
| 73 |
-
The take-home is [`Examples/ReadDoc/Sources/QuickStart.swift`](https://github.com/john-rocky/coreai-kit/blob/
|
| 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 `KitDocReader(catalog:)` on the image you pick.
|
| 76 |
One `read(imageAt:)` call per page; chunk a PDF into page images first. The output keeps
|
|
@@ -79,10 +84,10 @@ strip or render it as your app prefers.
|
|
| 79 |
|
| 80 |
**Integration checklist**
|
| 81 |
|
| 82 |
-
- SPM: `https://github.com/john-rocky/coreai-kit` β product **CoreAIKit**
|
| 83 |
- Info.plist: none needed
|
| 84 |
- Entitlements: none needed
|
| 85 |
-
- First run downloads the model β 4
|
| 86 |
local cache (Application Support; progress via the `downloadProgress` callback)
|
| 87 |
- Measure in Release β Debug is ~3Γ slower on per-token host work
|
| 88 |
<!-- gen-cards:use-it end -->
|
|
|
|
| 37 |
<!-- gen-cards:use-it begin id=unlimited-ocr (managed by scripts/gen-cards β edit cards.json / QuickStart.swift, not this block) -->
|
| 38 |
## Use it
|
| 39 |
|
| 40 |
+
**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.
|
| 41 |
+
|
| 42 |
β‘ **One line** β run the kit's task op on this model
|
| 43 |
(`import CoreAIOps`; no session, no model plumbing, downloads on first use):
|
| 44 |
|
|
|
|
| 46 |
let markdown = try await CoreAI.read(documentAt: url, options: .model("unlimited-ocr"))
|
| 47 |
```
|
| 48 |
|
| 49 |
+
Every op, one shape β [Cookbook](https://github.com/john-rocky/coreai-kit/blob/0.7.1/docs/COOKBOOK.md).
|
| 50 |
|
| 51 |
+
βΆοΈ **Run it (source)** β the [ReadDoc runner](https://github.com/john-rocky/coreai-kit/tree/0.7.1/Examples/ReadDoc)
|
| 52 |
(GUI + CLI, one app for every document-OCR model in the catalog):
|
| 53 |
|
| 54 |
```bash
|
| 55 |
+
git clone --branch 0.7.1 --depth 1 https://github.com/john-rocky/coreai-kit
|
| 56 |
+
export DEVELOPER_DIR=/Applications/Xcode-27.0.0-RC.app/Contents/Developer
|
| 57 |
+
open -a /Applications/Xcode-27.0.0-RC.app coreai-kit/Examples/ReadDoc/ReadDoc.xcodeproj
|
| 58 |
# β Run, then pick "Unlimited-OCR" in the model picker
|
| 59 |
|
| 60 |
# agents / headless (macOS):
|
| 61 |
cd coreai-kit/Examples/ReadDoc
|
| 62 |
+
swift run -c release readdoc-cli --model unlimited-ocr --image sample.png
|
| 63 |
```
|
| 64 |
|
| 65 |
+
Use Xcode build **27A266a** from the release's `.xcode-pin`; adjust the app path if your installation is named differently.
|
| 66 |
+
|
| 67 |
π» **Build with it** β complete; the glue is kit API, copy-paste runs:
|
| 68 |
|
| 69 |
```swift
|
|
|
|
| 75 |
// <|det|> layout boxes, reading order β fully on-device
|
| 76 |
```
|
| 77 |
|
| 78 |
+
The take-home is [`Examples/ReadDoc/Sources/QuickStart.swift`](https://github.com/john-rocky/coreai-kit/blob/0.7.1/Examples/ReadDoc/Sources/QuickStart.swift)
|
| 79 |
β this exact code as one typed function, no UI; the CLI is an argument shell over it, and
|
| 80 |
the GUI drives the same `KitDocReader(catalog:)` on the image you pick.
|
| 81 |
One `read(imageAt:)` call per page; chunk a PDF into page images first. The output keeps
|
|
|
|
| 84 |
|
| 85 |
**Integration checklist**
|
| 86 |
|
| 87 |
+
- SPM: `https://github.com/john-rocky/coreai-kit` (exact **0.7.1**) β product **CoreAIKit**
|
| 88 |
- Info.plist: none needed
|
| 89 |
- Entitlements: none needed
|
| 90 |
+
- First run downloads the model β ~4,532 MB (Mac) β then it loads from the
|
| 91 |
local cache (Application Support; progress via the `downloadProgress` callback)
|
| 92 |
- Measure in Release β Debug is ~3Γ slower on per-token host work
|
| 93 |
<!-- gen-cards:use-it end -->
|