Skip to content
ShahabFallahPublic

About

AI components that leverage the foundation models already on the device, with built‑in tool calling. Apple Intelligence and Gemini Nano, wired into production-ready UI. Private, offline, instant.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

76 stars

Watchers

0 watching

Forks

Repository files navigation

ondai

AI components for on-device foundation models.

Production-ready UI that runs on the model already inside the phone.
Leveraging Apple Intelligence and Gemini Nano with built-in tool calling, wired into components you own.

ondai.dev Apple Intelligence Gemini Nano React Native MIT

A phone rises as the on-device models circle it; inside, Ondai components take a request, run an agent with an approval, search by meaning and turn a voice memo into to-dos.


Every phone shipping today carries a capable foundation model. Ondai turns it into product: commands that take action, agents that ask before they act, search that understands meaning, forms that fill themselves, voice that becomes tasks. Each component is a complete feature (the UI, the prompts, the schema, every state from thinking to refusal), and the code lands in your repo, so it is yours to shape.

  • On-device first. Requests run on Apple Intelligence or Gemini Nano. No API bill, no data leaving the phone, and it works in airplane mode. A cloud model joins only if you allow it.
  • One router, every model. @ondai/core picks the best model the device has for each capability (text, structured output, tools, vision, speech) and falls back to the next one on its own.
  • Built-in tool calling. Agents call your app's tools and the phone's out of the box, and ask before anything is written.
  • Built for small models. Prompts budgeted for a 4K context, output validated with zod, streaming, and calm states for refusals and devices without a model.
  • Designed to the last state. Eight skins, light and dark, every state designed, accessible, reduced motion respected.

Components

Act and chat Command bar · Agent run · Tool confirm card · Chat · Assistant message · Prompt composer
Search and ask Semantic search · Ask page · Natural filter
See and hear Voice memo · Voice input · Scan to data · Photo caption
Fill and organize Smart input · Text to event · Auto tag · Inline suggest
Write and rewrite Summarize · Rewrite · Translate · Tone check · Smart reply

Browse them live, in every variant and state, at ondai.dev/docs/components.

Packages

Package
ondai The CLI: init, add, list and diff copy components into your project.
@ondai/core The runtime: capability router over on-device models, hooks, built-in tool calling, small-model helpers.
@ondai/tokens Design tokens and the variant system shared by every component.

Quickstart

npx ondai init                 # pnpm dlx · yarn dlx · bunx work too
npx ondai add command-bar      # the component and everything it needs, in components/ondai/
import { CommandBar, defineActions, defineAction } from '@/components/ondai/command-bar'

const actions = defineActions([
  defineAction({ id: 'email.send', title: 'Send email', risk: 'high', params: z.object({ to: z.string(), subject: z.string() }), run: (p) => mail.send(p) }),
])

<CommandBar actions={actions} presentation="spotlight" variant="bevel" />

init writes the provider, the polyfills and ondai.json, and installs through expo install so native modules match your SDK. The models are native modules, so build a development client (npx expo prebuild or EAS). Full guide: ondai.dev/docs/installation.

Runs on

Device Model
iPhone 15 Pro and newer, iPad and Mac with Apple silicon (iOS 26, Apple Intelligence on) Apple Foundation Models
Pixel 9 and newer, Galaxy S26, and other Android 14+ phones with AICore Gemini Nano
Anything, if you opt in A cloud model of your choice

Measured on Apple silicon: about 360 ms to the first token and 86 tokens per second. Device lists: device support.

What's next

Ondai starts with React Native and Expo. The same components, prompts and router are coming to more of the stack:

  • More platforms: SwiftUI, Jetpack Compose, and the web with the browser's built-in model.
  • More models: Llama, Gemma and Qwen through llama.cpp and LiteRT, for phones without a built-in model.
  • More components: an agent sheet, smart paste, redact private data, explain this, key points, and natural date input.
  • More ways in: a Figma kit, and an MCP server so your coding assistant can add components for you.

Built on

Callstack react-native-ai · Vercel AI SDK · Expo · Reanimated

Contributing

Issues and pull requests are welcome. Start with CONTRIBUTING.md (setup, checks, and the checklist for a new component) and the Code of Conduct. Report security issues privately: SECURITY.md.

pnpm install
pnpm turbo typecheck lint test

License

MIT

About

AI components that leverage the foundation models already on the device, with built‑in tool calling. Apple Intelligence and Gemini Nano, wired into production-ready UI. Private, offline, instant.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

76 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages