Views
No views yet
1git clone https://github.com/john-rocky/coreai-kit
2open coreai-kit/Examples/VLChat/VLChat.xcodeproj
3# → Run, then pick "Holo2 4B" in the model picker
4
5# agents / headless (macOS):
6cd coreai-kit/Examples/VLChat
7swift run vlchat-cli --model holo2-4b --image screenshot.png --prompt "Localize an element on the GUI image according to my instructions and output a click position as Click(x, y) with x num pixels from the left edge and y num pixels from the top edge. Instruction: click the Submit button."1import CoreAIKit
2import FoundationModels
3
4let vlm = try await KitVisionModel(catalog: "holo2-4b")
5let session = LanguageModelSession(model: vlm)
6let image = try ImageFile.load(imageURL) // any image file → CGImage + EXIF orientation
7let reply = try await session.respond(to: Prompt {
8 prompt
9 Attachment(image.cgImage, orientation: image.orientation)
10})
11// reply.content: "Click(x, y)" in 0-1000-normalized coordinates for a grounding prompt,
12// or a plain answer for a normal question - all generated on-deviceExamples/VLChat/Sources/QuickStart.swift
— this exact code as one typed function, no UI; the CLI is an argument shell over it, and
the GUI drives the same KitVisionModel(catalog:) behind a LanguageModelSession.
Holo2 is a GUI-grounding model: feed a screenshot and H Company's localization prompt
(see the card's grounding section) and it returns Click(x, y) in 0-1000-normalized
coordinates — multiply by imageSize / 1000 for pixels. It also answers free-form
questions like its Qwen3-VL base.https://github.com/john-rocky/coreai-kit → product CoreAIKitNSPhotoLibraryUsageDescription — only if you use PhotosPickercom.apple.developer.kernel.increased-memory-limitdownloadProgress callback)gpu-pipelined/)holo2_4b_decode_int8lin_s1/ — the decode bundle (static query=1, per-block-32 int8 linear
body; rides Apple's coreai-pipelined GPU engine, specializes on-device — no AOT needed). ~4.4 GB.holo2_4b_vision/ — the fixed-grid vision encoder .aimodel (fp16): patches [784,1536] -> (image_embeds [196,2560], deepstack [3,196,2560]). Run once per image. ~0.8 GB.LICENSE.