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

# LLM Configurations

> Connect Alethia to OpenAI, Anthropic, Google, and other LLM providers.

To test a model, Alethia needs to know **how to talk to it**. That's what an **LLM Configuration** stores: the provider, the model name, and your API key.

LLM Configurations live at the **team** level, so every project in the team can use them.

## Supported providers

Out of the box, Alethia supports:

| Provider      | Examples                                                                |
| ------------- | ----------------------------------------------------------------------- |
| **OpenAI**    | `gpt-4o`, `gpt-4o-mini`, `gpt-4-turbo`                                  |
| **Anthropic** | `claude-opus-4`, `claude-sonnet-4`, `claude-haiku-4`                    |
| **Google**    | `gemini-2.5-pro`, `gemini-2.5-flash`                                    |
| **Mistral**   | `mistral-large`, `mistral-small`                                        |
| **DeepSeek**  | `deepseek-chat`, `deepseek-coder`                                       |
| **Custom**    | Any HTTP-accessible endpoint with a configurable request/response shape |

<Tip>
  Need a provider not on the list? Use the **Custom** option. You provide the endpoint URL, headers, and the JSON paths to read/write — Alethia handles the rest.
</Tip>

## Adding a configuration

<Steps>
  <Step title="Go to Organization → LLM Configurations">
    You'll see all the configurations your team has set up.
  </Step>

  <Step title="Click 'Add Configuration'">
    Choose the provider from the dropdown.
  </Step>

  <Step title="Fill in the details">
    * **Name** — A friendly label (e.g., "GPT-4o Production")
    * **Model name** — The exact model identifier from the provider
    * **API Key** — Pasted from your provider's dashboard
    * **Mark as test model** — ✅ if this is a model you want to test, ❌ if it's a judge
    * **Generator model** (optional) — ✅ if this model should power [AI prompt generation](/essentials/prompt-library#generate-prompts-with-ai)
    * **Judge prompt** (optional) — Custom instructions for judging behavior. Leave blank for the default.
  </Step>

  <Step title="Test the connection">
    Click **Test Connection**. Alethia sends a tiny ping to the provider with your key.

    * ✅ Green — your model is reachable.
    * ❌ Red — most often a wrong key or wrong model name. Double-check both.
  </Step>

  <Step title="Save">
    Done. Your model is now available to any project in the team.
  </Step>
</Steps>

## Model roles

Alethia uses LLMs in three roles:

<CardGroup cols={3}>
  <Card title="Test model" icon="bullseye">
    The model whose safety you're evaluating. Each project has exactly one. Marked **Is test model: ✅**.
  </Card>

  <Card title="Judge model" icon="gavel">
    The model that grades responses from the test model. Each project uses up to three. Marked **Is test model: ❌**.
  </Card>

  <Card title="Generator model" icon="sparkles">
    The model that drafts adversarial prompts for the library. Flag it **Generator model: ✅**. See [AI prompt generation](/essentials/prompt-library#generate-prompts-with-ai).
  </Card>
</CardGroup>

A single LLM Configuration can serve any of these. For example, you might add `gpt-4o` once and use it as a test model in Project A and as a judge in Project B.

<Warning>
  **Don't use the same model as both test and judge in the same project.** It's biased — the model will tend to grade itself favorably. Pick judges from different model families.
</Warning>

## Custom providers

If your organization runs a self-hosted model or uses a provider Alethia doesn't natively support, choose **Custom**.

You'll need:

| Field             | Example                                                                   |
| ----------------- | ------------------------------------------------------------------------- |
| **Endpoint URL**  | `https://your-llm.example.com/v1/chat/completions`                        |
| **Headers**       | `{"Authorization": "Bearer YOUR_TOKEN"}`                                  |
| **Request path**  | `messages[0].content` (where to put the prompt in the request body)       |
| **Response path** | `choices[0].message.content` (where to read the answer from the response) |

Use **Test Connection** to verify before saving.

## Where do my API keys live?

API keys are encrypted with **AES-256-GCM** before being written to the database. They're never returned in any API response or page — anywhere you'd see a key, it shows as `sk-...****` instead.

The only place a key is decrypted is in memory, momentarily, when Alethia is about to call the provider. It's never written to logs or shown in the UI.

<Tip>
  **Best practice:** create a dedicated API key just for Alethia at your provider, separate from your production key. That way you can rotate it without affecting other systems, and you can see Alethia's usage cleanly in your provider's dashboard.
</Tip>

## Editing or rotating a key

<Steps>
  <Step>Open the configuration from **Organization → LLM Configurations**.</Step>
  <Step>Click **Edit**.</Step>
  <Step>Paste the new key. The old encrypted value is replaced.</Step>
  <Step>Click **Test Connection** to verify the new key works.</Step>
</Steps>

You don't need to update any project — they reference the configuration by name, not by key.
