> ## Documentation Index
> Fetch the complete documentation index at: https://gigi-f9937525.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Configure LLM Providers

> Add guild-scoped provider credentials and select Gigi's chat and routing models.

# Configure LLM Providers

Guild LLM behavior is live when a server has a sealed provider credential and active model profiles.

## Prerequisites

* Discord gateway enabled
* slash commands synced
* `GIGI_LLM_SECRET_KEY_BASE64` configured
* your Discord user has `llm.provider.write`, `llm.provider.test`, and `llm.provider.select`

Generate the sealing key with:

```bash theme={null}
openssl rand -base64 32
```

Set it as:

```env theme={null}
GIGI_LLM_SECRET_KEY_BASE64=<base64-32-byte-key>
GIGI_LLM_SECRET_KEY_ID=local-v1
```

Provider API keys are not environment variables. Enter them through `/llm provider add` or `/llm provider rotate` private modals.

## Grant access

Create and assign an LLM manager role:

```text theme={null}
/permissions role create name:Gigi LLM Managers preset:llm-manager
/permissions role assign role:@Gigi LLM Managers user:@person
```

## Add and test a provider

Start credential entry:

```text theme={null}
/llm provider add provider:gemini label:main
```

Paste the provider key into the private modal.

Then test it:

```text theme={null}
/llm provider test label:main
```

## Select models

Set the chat model for guild mention replies:

```text theme={null}
/llm model set purpose:chat label:main model:auto
```

Set the routing model for semantic external app dry-run routing:

```text theme={null}
/llm model set purpose:routing label:main model:auto
```

`model:auto` picks Gigi's static default for the credential provider and purpose. Pass a provider model ID instead when you want a specific model:

```text theme={null}
/llm model set purpose:chat label:main model:gemini-2.5-flash
```

Confirm:

```text theme={null}
/llm model show purpose:chat
/llm model show purpose:routing
```

Enable or inspect LLM tool routing:

```text theme={null}
/llm routing show
/llm routing set mode:dry-run
/llm routing set mode:enabled
```

New guilds default to `off`. Use `dry-run` first when testing flexible guild mention routing. Use `enabled` only when you want validated native memory tools and public external app dispatch to execute after capability checks.

## Verify usage

Ask Gigi a guild mention after the chat model is set:

```text theme={null}
@Gigi explain recursion in one paragraph
```

Or use `/ask`:

```text theme={null}
/ask question:explain recursion in one paragraph context:none visibility:private
/ask question:how often did we mention postgres here context:channel visibility:public
```

`context:channel` lets the agent load permitted recent full-mode channel memory into a cited context pack and choose current-channel memory tools only when tool routing and memory permissions allow it.

Then check aggregate token usage:

```text theme={null}
/llm usage guild
```

Usage events store actor, guild, provider, model, purpose, billing owner, status, and token counts. They do not store raw prompts, completions, provider responses, or secrets.

## Current limits

* Personal BYOK commands are not live.
* Rich DM chat is not live.
* Provider fallback between guild, user, and tenant owners is not automatic.
