> For the complete documentation index, see [llms.txt](https://codemash.gitbook.io/codemash/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://codemash.gitbook.io/codemash/cloud/project/settings/ai.md).

# AI

Set up the AI your end users talk to — default LLM, assistants, embeddings, knowledge and plans.

**Where:** Project → Settings → **AI** · `/projects/<project>/settings?tab=AI`

The **AI** tab sets up the assistants your end users talk to in the [Admin Portal](/codemash/cloud/project/settings/admin-portal.md): which LLM they use, what they may do, what knowledge they search, and how much each user may use. An assistant only ever sees the signed-in user's own data.

| Section                | What it holds                                                                                                    |
| ---------------------- | ---------------------------------------------------------------------------------------------------------------- |
| End-user AI            | **Chat shown** / **Chat hidden** — the chat is switched on the Admin Portal tab.                                 |
| Default LLM            | The **Integration** and **Model** every assistant without its own uses; **Save default**.                        |
| Assistants             | The assistants; **Add assistant**.                                                                               |
| Embedding integrations | Providers that turn text into vectors for knowledge search; **Add embedding integration**.                       |
| Knowledge              | **Embed uploaded files**.                                                                                        |
| Plans                  | Your users' AI tiers: assistants, models, monthly quota, features, and which role gets which plan; **Add plan**. |

## Before you start

* An account role that may update the project settings.
* At least one LLM integration in this environment — [LLM integrations](/codemash/cloud/ai/llm.md). Without one the tab says *No LLM integrations in this environment yet*.

## Steps

1. Open **Settings → AI**.

   <figure><img src="https://712692422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHy372bqsaex2cqS3ikhL%2Fuploads%2Fgit-blob-42c1f4c99651e94b58623e003e4398d3d939247b%2Fai-1.png?alt=media" alt="AI tab: Chat hidden, Default LLM with Acme OpenAI, no assistants, no embedding integrations, Embed uploaded files off, no plans"><figcaption><p>The AI tab of Acme Store.</p></figcaption></figure>
2. Under **Default LLM**, pick the **Integration** (for example `Acme OpenAI`) and the **Model** (or **Integration default model**), and press **Save default**. Until then the tab says *Not saved yet — the environment's default LLM is suggested.*
3. Under **Assistants**, press **Add assistant** and fill in the editor:

   | Field             | Required | What it does                                                                                                                                       | Example                                                          |
   | ----------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- |
   | Name              | yes      | What users see (up to 100 characters).                                                                                                             | `Support`                                                        |
   | Welcome message   | no       | The first chat message; public.                                                                                                                    | `Hi! I can look at your own orders and profile.`                 |
   | System prompt     | no       | Instructions the user never sees (up to 20,000 characters).                                                                                        | `Answer only about the signed-in user's own orders and profile.` |
   | Toolsets          | no       | **Own records** (`own:records`), **Own profile** (`own:profile`), **Own preferences** (`own:preferences`) — always only the signed-in user's data. | Own records, Own profile                                         |
   | LLM integration   | no       | Its own LLM; empty = the default LLM.                                                                                                              | `Acme OpenAI`                                                    |
   | Model             | no       | A model of that integration.                                                                                                                       | `GPT-4.1 (gpt-4.1)`                                              |
   | Memory            | —        | Remember facts about the user across chats.                                                                                                        | off                                                              |
   | Default assistant | —        | The one users get first (one per project).                                                                                                         | off                                                              |
   | Plan              | —        | Read-only: plans are set in **Plans**.                                                                                                             | No plan                                                          |

   **RAG sources** is marked *Coming later*.

   <figure><img src="https://712692422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHy372bqsaex2cqS3ikhL%2Fuploads%2Fgit-blob-afa7e4f992a1b6c1e04743cffbe0d28dece7b3b6%2Fai-2.png?alt=media" alt="New assistant editor filled with Support, welcome message, system prompt, Own records and Own profile, Acme OpenAI, GPT-4.1"><figcaption><p>A new assistant.</p></figcaption></figure>
4. Press **Add assistant**.
5. (Optional) **Add embedding integration** (Provider **Voyage AI** or **OpenAI**, Name, Model, Dimension, API key) and press **Test** on its row; switch **Embed uploaded files** on to put uploaded text files (up to 1 MB) into the knowledge; **Add plan** to limit usage per user, then map roles to plans under **Who gets which plan** and press **Save plan assignments**.

## Result

The assistant is listed: **Support** — *LLM: Acme OpenAI · gpt-4.1 · Toolsets: Own records, Own profile* — with **Edit** and **Remove**. Turn the chat on with **Show AI chat** on the [Admin Portal](/codemash/cloud/project/settings/admin-portal.md) tab; this tab then says **Chat shown**.

<figure><img src="https://712692422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHy372bqsaex2cqS3ikhL%2Fuploads%2Fgit-blob-958aa2babfb35fc9bfa3a13202fcf32546c35c58%2Fai-3.png?alt=media" alt="Assistants list with Support, LLM Acme OpenAI gpt-4.1, Toolsets Own records, Own profile, Edit and Remove"><figcaption><p>The Support assistant.</p></figcaption></figure>

## Change or remove it later

* **Edit** an assistant and press **Save assistant**; **Remove** deletes it. While the chat is shown, at least one assistant with an LLM must stay.
* A plan in use by a role or as the default cannot be removed.
* Plans, knowledge and credits have no SDK method — set them on this tab.

## Do it from code

```ts
const { result } = await norbix.hub.account.getProjectAiSettings({ projectId: 'pr_7FUKofhEBNMnISkqust2De' });
console.log(result.assistants.map((a) => [a.id, a.name, a.model])); // [["ast_48AouZgVEl2X1Mq5fLgr8f","Support","gpt-4.1"]]
```

```sh
norbix project ai settings --project pr_7FUKofhEBNMnISkqust2De
```

The client setup is on the [Account page](/codemash/cloud/account.md#use-it-from-code). API: [Get Project Ai Settings](/codemash/api-reference/account/projects/get-project-ai-settings.md) · [Update Project Ai Settings](/codemash/api-reference/account/projects/update-project-ai-settings.md) · [Create Project Ai Assistant](/codemash/api-reference/account/projects/create-project-ai-assistant.md)
