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

# Aider

[Aider](https://aider.chat) is a terminal AI pair-programming tool built around a git diff workflow. You can connect Aider to the ScitiX Model Inference API through its OpenAI-compatible integration.

## Configure

### 1. Install Aider

<CodeGroup>
  ```bash pip (official installer) theme={null}
  python -m pip install aider-install && aider-install
  ```

  ```bash uv theme={null}
  uv tool install --force --python python3.12 --with pip aider-chat@latest
  ```
</CodeGroup>

### 2. Configure the model

Create an API Key on the [API Keys](https://console.scitix.ai/model-inference/api_keys) page, then add the ScitiX configuration to `~/.aider.conf.yml`. Aider reads this file on every launch and in every terminal.

```yaml theme={null}
model: openai/glm-5.2
openai-api-base: https://api.scitix.ai/model-api/v1
openai-api-key: <Your API Key>
```

Keep the following in mind:

* This guide uses `glm-5.2` as the example model. Reasoning models such as `glm-5.2` may output reasoning content before the final response, which can feel slower. Switch to a non-reasoning model if speed matters more.
* The `openai/` prefix routes requests through Aider's OpenAI-compatible integration. There is no `SCITIX_`-prefixed variant.
* As a session-only alternative, you can set `OPENAI_API_BASE` and `OPENAI_API_KEY`, then run `aider --model openai/glm-5.2`. A new terminal session will lose these exports.
* Instead of `~/.aider.conf.yml`, `OPENAI_API_BASE` and `OPENAI_API_KEY` can also live in a `.env` file. Aider searches in the home directory, the git repo root, and the current directory. Later locations take precedence.

Launch Aider from your project directory:

```bash theme={null}
cd your-project
aider
```

<Tip>
  Commit messages and chat-history summaries are generated by a separate weak model. Add `--weak-model openai/DeepSeek-V4-Flash` if you want to use `DeepSeek-V4-Flash` for this role.
</Tip>

### 3. Clear the unknown model warning

On first launch, Aider may show a warning similar to:

```text theme={null}
Warning for openai/glm-5.2: Unknown context window size and costs, using sane defaults. Did you mean openai/gpt-5.2?
```

This is expected when Aider's model database does not yet include ScitiX model IDs. Aider falls back to defaults and may suggest a similar model name. Answer **N** to the documentation prompt and ignore the model-name suggestion.

To clear the warning, add a `.aider.model.metadata.json` file in your project root:

```json theme={null}
{
  "openai/glm-5.2": {
    "max_tokens": 8192,
    "max_input_tokens": 131072,
    "max_output_tokens": 8192,
    "input_cost_per_token": 0,
    "output_cost_per_token": 0,
    "litellm_provider": "openai",
    "mode": "chat"
  }
}
```

* The `litellm_provider` field must match the prefix in the model name. Aider looks for this file in your home directory, the git repo root, and the current directory. Later locations take precedence. You can also pass `--model-metadata-file <path>` explicitly.
* Adjust `max_input_tokens` in `.aider.model.metadata.json` to match the model's actual context window.

## Verify

In interactive mode, ask Aider to make a small change, such as adding a line to the README, and confirm that it generates and applies a diff.

You can also verify the connection non-interactively:

```bash theme={null}
aider --model openai/glm-5.2 --message "say ok" --no-git --yes-always
```

## Other Modes

The same ScitiX configuration also works with Aider's other modes:

* **One-shot**: `--message "<task>"` sends a single instruction, applies the result, and exits. This is useful for scripting.
* **Browser UI**: `aider --browser` runs Aider in your web browser. This mode is experimental.
* **Watch mode**: `aider --watch-files` watches your repo for AI comments. For example, write `// add a factorial() function ai!` in a file and Aider picks it up. `AI!` requests a change, while `AI?` asks a question.
