> ## Documentation Index
> Fetch the complete documentation index at: https://docs.runanywhere.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuration

> Initialization, models, storage, and platform services

## Initializing

```ts theme={"theme":"css-variables"}
await RunAnywhere.initialize({})
```

```ts theme={"theme":"css-variables"}
interface InitializeOptions {
  apiKey?: string // omit for keyless local mode
  baseUrl?: string // omit for the environment's default control plane
  environment?: Environment
}
```

## Reading state

| Accessor | Type | Meaning |
| - | - | - |
| `RunAnywhere.isReady` | `boolean` | Local inference is usable |
| `RunAnywhere.version` | `string` | SDK version |
| `RunAnywhere.deviceId` | `Promise<string>` | Stable per-install identifier |
| `RunAnywhere.events` | `AsyncIterable<SdkEvent>` | Lifecycle and error breadcrumbs |

> [!NOTE]
>
> `deviceId` is a **promise** here. It is a plain string on Swift and Web. `await` it.

`SdkEvent` is a small union on React Native:

```ts theme={"theme":"css-variables"}
type SdkEvent =
  | { type: 'ready' }
  | { type: 'modelLoaded'; id: string; category: ModelCategory }
  | { type: 'modelUnloaded'; id: string }
  | { type: 'error'; message: string; recoverable: boolean }
```

## Capabilities

```ts theme={"theme":"css-variables"}
const capabilities = RunAnywhere.capabilities() // synchronous
```

> [!NOTE]
>
> On React Native `capabilities()` returns a **static literal**, not a live probe. It lists
> llama.cpp and ONNX as the backends even when `@runanywhere/mlx` or `@runanywhere/qhexrt` are
> installed, and it always reports `agents`, `wakeword`, and `realtime` as unavailable. Treat it as
> a description of the API surface rather than of your build. The Web SDK generates its own from
> live runtime probes. Electron is in between: a thin addon reports the plugins actually registered,
> while a fat addon starts from the backends compiled into the binary and subtracts only the ones
> the runtime refused — so read `unavailable` there, not just `backends`.

## Models

```ts theme={"theme":"css-variables"}
const models = await RunAnywhere.models.list()
const loaded = await RunAnywhere.models.loaded(ModelCategory.MODEL_CATEGORY_LANGUAGE)

for await (const event of RunAnywhere.models.download('qwen3-0.6b')) {
  if (event.type === 'progress') setProgress(event.fraction ?? 0)
}

const model = await RunAnywhere.models.load('qwen3-0.6b')
await RunAnywhere.models.unload('qwen3-0.6b')
await RunAnywhere.models.unloadAll()
await RunAnywhere.models.delete('qwen3-0.6b')
await RunAnywhere.models.register(registration)
await RunAnywhere.models.unregister('qwen3-0.6b')

const state = await RunAnywhere.models.state()
```

> [!NOTE]
>
> There is no `models.get(id)` on React Native. Use `models.loaded(category)` to ask what is
> currently resident, or `models.list()` and filter.

You rarely need `load` directly. Generation auto-loads what it needs and downloads when
`options.model` names a model that is absent.

## Platform services

Five services sit alongside the modality namespaces. None of them exist under these names on
the other SDKs.

```ts theme={"theme":"css-variables"}
// Storage
await RunAnywhere.storage.info() // StorageInfo | null
await RunAnywhere.storage.clearCache()
await RunAnywhere.storage.cleanTempFiles()

// Logging
RunAnywhere.logging.setLevel(level)
RunAnywhere.logging.setDebugMode(true)
RunAnywhere.logging.addDestination(destination)
RunAnywhere.logging.setLocalEnabled(true)
RunAnywhere.logging.configure(config)
await RunAnywhere.logging.flush()

// Control-plane identity
await RunAnywhere.auth.isAuthenticated() // boolean
await RunAnywhere.auth.isDeviceRegistered() // boolean
await RunAnywhere.auth.userId() // string | null
```

`auth` becomes meaningful only once the network phase has landed. In keyless local mode all
three return `false` or `null` rather than throwing.

`pluginLoader` and `solutions` are also exposed for loading engine plugins and running
YAML-defined pipelines.

## Resetting

```ts theme={"theme":"css-variables"}
await RunAnywhere.reset()
```

Unloads models, closes sessions, and clears state.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.