# Function: init() (/jsdoc/pixi-vn-ai/index/namespaces/ai/functions/init)



\> **init**(`options?`): `Promise`\<`void`>

Defined in: [src/ai.ts:35](https://github.com/DRincs-Productions/pixi-vn-ai/blob/f5205e28d51c043e8eeb27fcb2b61433f3751ac2/src/ai.ts#L35)

Initialize Pixi'VN AI. Call this once, typically at application startup, before using
`ai.text.generateDialog`, `ai.image.generateBackground` or `ai.image.generateElement`.

When neither option is given, a small local [WebLLM](https://github.com/mlc-ai/web-llm)
model is downloaded and used for dialogue generation (no image support).

## Parameters [#parameters]

### options? [#options]

The [AI SDK](https://ai-sdk.dev) models to use.

#### imageProvider? [#imageprovider]

`ImageModel`

Image model used for `ai.image.generateBackground` and `ai.image.generateElement`.

#### textProvider? [#textprovider]

`LanguageModel`

Language model used for `ai.text.generateDialog`, and as a fallback for image
generation on multimodal models (e.g. Gemini image generation).

## Returns [#returns]

`Promise`\<`void`>
