> ## 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.

# LoRA Adapters

> Layer an adapter onto the loaded base model

A LoRA adapter specialises a base model without swapping it out. The base model stays loaded
throughout, so switching behaviour costs far less than switching models. On a phone that
difference is the whole point.

```ts theme={null}
await RunAnywhere.lora.apply('legal-summarizer')

const result = await RunAnywhere.llm.generate('Summarize this clause: …')

await RunAnywhere.lora.remove('legal-summarizer')
```

## The namespace

```ts theme={null}
lora.apply(adapterId: string, scale?: number): Promise<void>
lora.remove(adapterId: string): Promise<void>
lora.removeAll(): Promise<void>
lora.list(): Promise<LoraState>
```

## Scale

`scale` controls how strongly the adapter pulls the base model. Leave it unset for the
adapter's own default.

Lower values blend the adapter with base behaviour; higher values commit to it. If output
degrades after applying an adapter, scale is the first thing to turn down.

## Removing

```ts theme={null}
await RunAnywhere.lora.remove('legal-summarizer')
await RunAnywhere.lora.removeAll()
```

Removal is keyed by adapter id.

## Switching adapters

Adapters stack. Remove before applying another, or two of them fight and the output is worse
than either alone.

```ts theme={null}
async function useAdapter(id: string): Promise<void> {
  await RunAnywhere.lora.removeAll()
  await RunAnywhere.lora.apply(id)
}
```

## The base model has to support it

An adapter is trained against a specific base model. Applying one to a different base either
fails or produces nonsense. Check the model's `supportsLora` flag before offering adapters in
your interface.

React Native exposes the short form only. Catalog management is available on the Swift and
Electron SDKs.
