API Surface

Core AI has two API layers.

AI SDK Adapters

Use these when you want portable AI SDK app code:

import { coreAI } from '@react-native-ai/core-ai'
import { generateText } from 'ai'

const language = coreAI.languageModel({
  id: 'qwen3-0.6b',
  source: { type: 'file', uri: qwen3ModelDirectory },
  variant: 'iOS',
})

await generateText({ model: language, prompt: 'Hello' })

AI SDK adapter status:

CapabilityAI SDK APICore AI APIStatus
Text generationgenerateText, streamTextcoreAI.languageModel(...)Supported
Structured outputgenerateText / streamText response formatcoreAI.languageModel(...)Not supported yet
Tool callingtools optioncoreAI.languageModel(...)Not supported yet
Image generationgenerateImagecoreAI.imageModel(...)Supported
Text embeddingsembed, embedManycoreAI.embeddingModel(...)Throws unsupported error
TranscriptiontranscribecoreAI.transcriptionModel(...)Throws unsupported error

coreAI.embeddingModel(...) and coreAI.transcriptionModel(...) exist so the API is in place, but they throw until the package has native runners for CLIP/CLAP and wav2vec2/Whisper models (#237).

There are no adapters for reranking, speech generation, or video generation, because coreai-models has no models for them. Use @react-native-ai/apple for system speech synthesis.

Direct Native APIs

Use direct APIs when Core AI has no AI SDK equivalent or when you need Core AI-specific lifecycle control:

import { CoreAI, coreAI, toNativeModelConfig } from '@react-native-ai/core-ai'

const config = {
  id: 'qwen3-0.6b',
  source: { type: 'file', uri: qwen3ModelDirectory },
  variant: 'iOS',
} as const

await CoreAI.inspectModel(toNativeModelConfig({ ...config, task: 'language' }))

const model = coreAI.languageModel(config)

await model.prepare()

const session = await model.createSession({
  instructions: 'Keep answers short.',
})

await session.respond('Create a vocabulary card for "flower".')

Native-only API status:

CapabilityAPIStatusWhy native-only
Model inspectionCoreAI.inspectModel(...)SupportedAI SDK does not manage Core AI asset metadata.
SpecializationCoreAI.specializeModel(...)Returns metadata only, does not compileCore AI-specific preparation step.
Persistent sessionsmodel.createSession(...)Supported for language modelsAI SDK owns message history; Core AI sessions own native transcript state.
SegmentationCoreAI.runTask('segmentation', ...)SupportedAI SDK image APIs do not model segmentation masks.
Object detectionCoreAI.runTask('object-detection', ...)SupportedAI SDK has no detection primitive.
Depth estimationCoreAI.runTask('depth', ...)Throws unsupported errorAI SDK has no depth primitive.
Super-resolutionCoreAI.runTask('super-resolution', ...)Throws unsupported errorAI SDK has no image-to-image upscaling primitive.
Raw .aimodel callsCoreAI.runRawFunction(...)Throws unsupported errorRaw tensor APIs need Core AI-specific ownership and performance rules.

When the AI SDK owns message history, every request sends the whole chat. To keep it inside the context window, see Conversation History.

Loading Models

Core AI loads models from local .aimodel / .aimodelc files, so download them into app storage yourself and pass a local source: { type: 'file', uri }. Built-in download, specialization and caching is tracked in #235.

Starter Models

The package does not ship a model catalog. The starter models page is a reference list of models known to work; your app decides which models to bundle or download.

Need React or React Native expertise you can count on?

Need help with React or React Native projects?
We support teams building scalable apps with React and React Native.