Read the pen strokes of a doodle and guess what it is, out of 345 everyday things, even before the drawing is finished. On the device itself: Android, iOS, desktop and the web, from one Kotlin Multiplatform library.
Free up to 10k monthly active devices · No API key · On Maven Central · Android, iOS, desktop, web
This is the actual Chalk library, compiled to WebAssembly and running in your browser. Doodle any of 345 everyday things with your mouse or finger. It guesses while you draw. Your drawing never leaves this page.
Chalk guesses
No server, no API key, no per-request bill. A small Kotlin library that you can read, test and ship.
Pass the points the finger drew, straight from your canvas. Size and position on screen don't matter; the drawing is simplified on the device the same way the training data was.
Trained on half-finished drawings too, so it can guess after the first strokes, like the Quick, Draw! game. It beats a 200× larger model there.
Pure Kotlin inference. There is no ONNX Runtime, TFLite, ML Kit or native code, and it runs on Android (minSdk 21), iOS, macOS, JVM desktop, JavaScript and WebAssembly, from Kotlin or Java.
The model ships inside the library on every platform. It makes no network calls, needs no permissions and sends no telemetry.
Real output from the sample app on an Android emulator, drawn with touch events. These are not mockups.

house 89% · barn 6%

sun 93%

fish 97%

walls and roof only: house 86%
The Kotlin Multiplatform sample app, built from the published artifacts, gives the same result on Android, iOS, desktop and the web.

house 72% · barn 19%

house 72% · barn 19%

house 72% · barn 19%

house 72% · barn 19%
One line in your Gradle file, from Maven Central. Works in commonMain for Android, iOS, macOS, JVM desktop, JavaScript and WebAssembly. No API key, no account.
// build.gradle.kts: commonMain, or any platform source set
dependencies {
implementation("io.github.rajumark:chalk:2.0.0")
}
// Gradle picks the right artifact per platform:
// chalk-android · chalk-jvm · chalk-iosarm64 · chalk-iossimulatorarm64
// chalk-macosarm64 · chalk-js · chalk-wasm-js
Add Chalk from rajumark to this Kotlin Multiplatform or Android project.
What it does: on-device doodle recognition. Given the pen strokes of a drawing (screen pixels), it returns the most likely of 345 everyday things (the Quick, Draw! categories), even for half-finished drawings. 1.7 MB, no dependencies, no network.
Install (Maven Central, no extra repository):
build.gradle.kts (commonMain or any source set): implementation("io.github.rajumark:chalk:2.0.0")
Platforms: Android, iOS, macOS, JVM desktop, JavaScript, WebAssembly
Usage:
val chalk = Chalk() // off the main thread, keep one instance
val strokes = listOf(Stroke(xs, ys), ...) // one Stroke per finger-down ... finger-up
val guesses = chalk.guess(strokes) // [Guess(label=house, score=0.89), ...]
Repo: https://github.com/rajumark/chalk#readme
Add the dependency, then follow the README for the exact API and current version.
Load once and reuse the instance. guess() is thread-safe; call it after every stroke to guess live.
val chalk = Chalk()
val strokes = mutableListOf<Stroke>()
// on every finger-up:
strokes += Stroke(xs.toFloatArray(), ys.toFloatArray())
chalk.guess(strokes)
// [Guess(label=house, score=0.89), Guess(label=barn, score=0.06), ...]
chalk.guess(strokes, count = 5)
chalk.close()
try (Chalk chalk = new Chalk()) {
List<Guess> guesses = chalk.guess(strokes);
String best = guesses.get(0).getLabel();
}
Anywhere people draw with a finger or a stylus.
Pictionary-style party games and "draw this in 20 seconds" challenges, fully offline.
guess after every stroke → "Is it a house?""Draw a fish": check the drawing on the device, with no child's data leaving the phone.
fish 97%Draw an icon to find an emoji, a sticker, an app or a product category.
draw a sun → ☀️Tag doodles in handwritten notes so they are searchable, or turn a rough sketch into a clean clip-art icon.
doodle → tag "bicycle"Real problems Chalk solves today. Pick one and ship it.
Offline Pictionary · A party game where the phone guesses your drawing live, no internet needed.
Kids drawing buddy · Cheer "That's a cat!" while a child draws, and suggest what to draw next.
Sketch search · Draw a shoe or a chair to search a shop catalogue instead of typing.
Draw-to-emoji · Sketch a heart, sun or pizza in chat and insert the matching emoji or sticker.
Vocabulary flashcards · Show "manzana" and ask the learner to draw it to prove they know the word.
Toddler first words · A toddler draws a dog, the app says "dog" out loud and shows a picture.
Classroom quiz · The teacher says "draw a triangle" and every tablet checks the answer offline.
Speed drawing challenge · "Draw 5 things in 60 seconds" daily streak game with an on-device judge.
Interactive storybook · The child draws a dragon, and the story continues with that dragon in it.
Doodle cleanup · Swap rough whiteboard doodles for clean icons in a notes or slides app.
Sketchbook search · Auto-tag old doodles so users can search their notebook for "bicycle".
Gesture shortcuts · Draw an envelope to open mail or a camera to open the camera.
Smartwatch doodle input · Draw a tiny heart or coffee cup on a watch to send it as a reply.
Picture talk (AAC) · People who can't speak or type draw what they need, like water or a bed.
Drawing lessons · Check each practice sketch and show when it becomes recognisable.
Greeting card maker · Sketch rough shapes and get matching clip-art placed on the card.
Brain-training game · Timed recall rounds: "draw the 3 objects you just saw".
Doodle shopping list · Draw a banana and a carrot; get a readable list for kids or low-literacy users.
Human check · Ask users to draw a simple object as a friendlier offline alternative to text CAPTCHAs.
Multiplayer guessing · Pass-the-phone game where players race the AI to guess each drawing.
Quick, Draw! drawings never used for training (50 per category, 17,250 in total), through the same touch-input pipeline the library uses. Top-1 = the first guess is right; top-3 = the answer is among the first three.
| Chalk | BEiT-base sketch classifier | MobileViT-small (QuickDraw) | |
|---|---|---|---|
| Finished drawings: top-1 / top-3 | 81.5% / 94.3% | 83.3% / 95.6% | 70.6% / 87.9% |
| Half-drawn: top-1 / top-3 | 53.3% / 73.9% | 50.1% / 69.7% | 40.4% / 59.7% |
| Size | 1.8 MB | 348 MB | 21 MB |
| Latency, one drawing, 1 CPU thread (laptop) | ~1 ms | ~69 ms | ~2.5 ms |
A 200× larger image model is 1.8 points more accurate on finished drawings; Chalk is better at guessing while the user is still drawing, and about the same for drawings from every country (India 80.4%, US 81.1%, UK 80.3%). Hardest categories: marker, bear, garden hose, aircraft carrier (34–40%); easiest: helicopter, angel, star, ladder, The Mona Lisa (97–98%).
| Member | Description |
|---|---|
Chalk() | Loads the bundled model. Implements AutoCloseable. |
guess(strokes, count = 3) | The count most likely labels, best first, as Guess(label, score). Empty for no points. |
probabilities(strokes) | A probability for every label, in the order of labels; null for no points. |
labels | The 345 labels, as Quick, Draw! names them. |
Stroke(x, y) · Stroke.of(x0, y0, …) | One stroke: the points from finger-down to finger-up, in any coordinates. |
No API key, no sign-up, no license file. Add Chalk to your project and ship. It stays free until your product passes 10,000 monthly active devices, and there's never a limit on how often each device runs it.
For indie developers, startups and growing apps, up to 10,000 monthly active devices.
For products above 10,000 monthly active devices on any platform.
A small, fast on-device model trained for your language, domain or task.
A monthly active device is a phone, tablet or other device that runs Chalk at least once in a calendar month.
The 10,000 limit applies separately to each product, each platform (Android, iOS, web…) and each Hoverfly model. Crossed it? You have 30 days to get a commercial license.
Questions about licensing? Email raju348636@gmail.com or call / WhatsApp +91 63533 21951. Full terms: Hoverfly Community License.
A Kotlin Multiplatform library (Android, iOS, macOS, JVM desktop, JavaScript, WebAssembly) that recognises doodles: give it the strokes of a drawing and it guesses which of 345 everyday things it shows.
The 345 categories of Google's Quick, Draw!: animals (cat, dog, lion, fish …), food (pizza, banana, cake …), vehicles, household objects, shapes, body parts and landmarks like The Eiffel Tower. chalk.labels lists them all. Anything else gets the nearest of these.
No. Chalk reads strokes, the points a finger or stylus draws. It is much smaller and faster than an image model, and it knows the order the lines were drawn in, which is what lets it guess early.
Yes. It was trained on half-finished drawings too. Call guess() after every stroke, or every few points while the finger moves.
A few milliseconds on a laptop JVM, and in the same speed class as Hoverfly's other libraries on an Android emulator. Load it once, off the main thread, and call it from a background thread.
From screen-like float coordinates, the simplified points, the top-3 guesses and the probabilities (within 0.000002) match the reference implementation on all 150 test drawings, on the JVM and on an Android device.
Nothing for products with up to 10,000 monthly active devices per platform, including commercial apps. There is no API key or account, and no limit on how often it runs. Above that, a commercial license is needed; see Pricing.
Yes. Hoverfly trains custom on-device models for your task and ships them as a small library like this one. Email raju348636@gmail.com or call / WhatsApp +91 63533 21951.
Built by a developer, for developers.
Every model here started as a problem I hit in my own apps. I made them small, private and free to start, so you can spend your time on the part your users will love.
Eight small on-device models, one job each. Same install, same free tier, and the same promise: nothing leaves the device.