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

# AI Model Configuration

> Configure AI providers for Corbulo analysis

Corbulo uses AI models for semantic code analysis: understanding PR intent, finding issues that static analyzers miss, generating architecture reviews, detecting conventions, and creating documentation.

## Model Slots

Corbulo uses four model slots that you can configure independently:

| Slot                          | Used For                                              | Required |
| ----------------------------- | ----------------------------------------------------- | -------- |
| **Large (OpenAI-compatible)** | PR analysis, architecture reviews, health assessments | Yes      |
| **Small (OpenAI-compatible)** | Convention detection, drift analysis, summarization   | Yes      |
| **Large (Anthropic)**         | Optional override for specific tasks                  | No       |
| **Small (Anthropic)**         | Optional override for specific tasks                  | No       |

## Cloud Configuration

For cloud-hosted Corbulo, AI models are managed for you. No configuration is needed.

## Per-Project Configuration (BYOK)

Each project can use its own AI model configuration. This is useful when you want to:

* **Bring your own API keys** to control costs and billing
* **Choose specific models** for cost or capability reasons
* **Route through your own proxy** (e.g., OpenRouter)

Configure per-project AI settings in **Settings > AI & Analysis**.

For each model slot, you can set:

| Field        | Description                                                        |
| ------------ | ------------------------------------------------------------------ |
| **Provider** | The model provider                                                 |
| **Model**    | Specific model to use (e.g., `gpt-4o`, `claude-sonnet-4-20250514`) |
| **API Key**  | Your API key for the provider                                      |
| **Base URL** | Custom endpoint for OpenAI-compatible proxies                      |

<Note>
  Per-project settings override the platform defaults. If you clear a slot's configuration, it falls back to the platform-managed model.
</Note>

## Supported Providers

Any OpenAI-compatible API works, including:

* **OpenAI** -- GPT-4o, GPT-4o-mini, and others
* **Anthropic** -- Claude Sonnet, Claude Haiku, and others
* **OpenRouter** -- access to multiple providers through a single API
* **Azure OpenAI** -- for Azure-hosted deployments
* **AWS Bedrock** -- via an OpenAI-compatible gateway
* **Self-hosted models** -- Ollama, vLLM, or any OpenAI-compatible server

## Usage Tracking

Monitor AI token usage per project in **Settings > AI & Analysis**. The usage view shows total tokens consumed and a cost breakdown by model slot.

## Best Practices

1. **Start with the defaults.** The platform-managed models work well for most codebases.
2. **Use smaller models for lightweight tasks.** Convention detection and summarization do not need the most capable model.
3. **Use the most capable models for deep analysis.** PR analysis and architecture reviews benefit from stronger reasoning.
4. **Monitor usage and adjust.** If costs are higher than expected, consider switching the small slot to a cheaper model.
