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

# Aider

> Use Radium with Aider for AI pair programming

# Aider

Aider is a command-line tool for AI pair programming. Use Radium as the backend for aider's coding assistance.

## Prerequisites

* Aider installed (`pip install aider-install`)
* A Radium API key from the [dashboard](https://deploy.radium.cloud)

## Setup

### Via environment variables

```bash theme={null}
export RADIUM_API_KEY="YOUR_RADIUM_API_KEY"
export OPENAI_API_BASE="https://api.radium.cloud/v1"

aider --model openai/hal-1.0
```

### Via .aider.model.settings.yml

Create `.aider.model.settings.yml` in your project root:

```yaml theme={null}
- name: radium-hal
  edit_format: diff
  weak_model_name: radium-tycho
  use_repo_map: true
  reminder: sys
  examples_as_sys_msg: true
  extra_params:
    model: hal-1.0
    api_base: https://api.radium.cloud/v1
    api_key: YOUR_RADIUM_API_KEY
  caches_by_default: true

- name: radium-clarke
  edit_format: diff
  weak_model_name: radium-tycho
  use_repo_map: true
  reminder: sys
  examples_as_sys_msg: true
  extra_params:
    model: clarke-1.0
    api_base: https://api.radium.cloud/v1
    api_key: YOUR_RADIUM_API_KEY
  caches_by_default: true

- name: radium-tycho
  edit_format: whole
  weak_model_name: radium-tycho
  use_repo_map: false
  reminder: user
  examples_as_sys_msg: false
  extra_params:
    model: tycho-1.0
    api_base: https://api.radium.cloud/v1
    api_key: YOUR_RADIUM_API_KEY
```

Then run:

```bash theme={null}
aider --model radium-hal
```

### Using a .env file

```bash theme={null}
# .env
RADIUM_API_KEY=YOUR_RADIUM_API_KEY
OPENAI_API_BASE=https://api.radium.cloud/v1
```

```bash theme={null}
aider --model openai/hal-1.0 --env-file .env
```

## Recommended models

| Mode | Model | Why |
| - | - | - |
| Main editor | hal-1.0 | Best reasoning, diff editing |
| Commits / linting | tycho-1.0 | Fast, cheap for small tasks |
| Code review | clarke-1.0 | Strong correctness analysis |

## Model aliases

Create convenient aliases in your shell profile:

```bash theme={null}
alias aider-hal='aider --model openai/hal-1.0 --api-key $RADIUM_API_KEY'
alias aider-clarke='aider --model openai/clarke-1.0 --api-key $RADIUM_API_KEY'
alias aider-tycho='aider --model openai/tycho-1.0 --api-key $RADIUM_API_KEY'
```

## Context windows

Aider sends the entire repo map and relevant files as context. Radium models support up to 1M tokens:

| Model | Context | Good for |
| - | - | - |
| hal-1.0 | 250K | Medium-large codebases |
| clarke-1.0 | 1M | Large codebases, multi-file changes |
| tycho-1.0 | 125K | Small files, quick edits |

## Troubleshooting

| Symptom | Fix |
| - | - |
| "Model not found" | Ensure you're using `openai/hal-1.0` format with `--model` |
| "401 Unauthorized" | Check API key is valid and starts with your Radium key prefix |
| Slow diffs | Switch to tycho-1.0 or reduce repo map size with `--map-tokens` |
| Context exceeded | Use clarke-1.0 or split the task into smaller edits |

## Next steps

<CardGroup cols={2}>
  <Card title="Quickstart" icon="bolt" href="/quickstart">Your first Radium request</Card>
  <Card title="Models" icon="brain" href="/models/overview">Compare model capabilities</Card>
  <Card title="Tool calling" icon="hammer" href="/core-concepts/tool-calling">How Radium handles function calling</Card>
  <Card title="Rate limits" icon="gauge" href="/core-concepts/rate-limits">Current limits by tier</Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.