Skip to content

Integrations

Aider

Aider in the terminal with AI Tokens: two environment variables, the openai/ prefix on the model, and two small files that tell Aider the context window and the edit format.

Last updated: 2026-10-11

Settings

bash
export OPENAI_API_BASE=https://api.aitokens.ch/v1
export OPENAI_API_KEY="sk-at-…"

aider --model openai/qwen3-coder-30b

The openai/ prefix tells Aider to use the OpenAI-compatible API at OPENAI_API_BASE. The model id after it is the one in the catalogue.

The context window and the edit format

Aider does not know AI Tokens's models, and without help it warns that it does not know their context window. Two files in the root of your repository (or in your home directory) fix that.

.aider.model.metadata.json:

json
{
  "openai/qwen3-coder-30b": {
    "max_input_tokens": 32768,
    "max_output_tokens": 8192,
    "litellm_provider": "openai",
    "mode": "chat"
  },
  "openai/qwen3.8-27b": {
    "max_input_tokens": 262144,
    "max_output_tokens": 8192,
    "litellm_provider": "openai",
    "mode": "chat"
  }
}

.aider.model.settings.yml:

yaml
- name: openai/qwen3-coder-30b
  edit_format: diff
  use_repo_map: true
- name: openai/qwen3.8-27b
  edit_format: diff
  use_repo_map: true
  accepts_settings: ["reasoning_effort"]

With edit_format: diff the model sends the lines it changes; with whole it sends every file it edits in full.

What we ran

In a new repository with one file, hello.py, and the two files above:

bash
aider --model openai/qwen3-coder-30b --yes-always --no-stream \
  --map-tokens 0 --message "Add a function add(a, b) to hello.py that returns a + b." hello.py

What came back, shortened:

text
Model: openai/qwen3-coder-30b with diff edit format
hello.py
<<<<<<< SEARCH
def greet(name):
    return f"Hello, {name}!"
=======
def greet(name):
    return f"Hello, {name}!"

def add(a, b):
    return a + b
>>>>>>> REPLACE
Tokens: 2.4k sent, 72 received.
Applied edit to hello.py
Commit a76db4f feat: add add(a, b) function to hello.py

Aider read the context window from the metadata file, applied the edit and committed it with a message written by the same model.

Which model

qwen3-coder-30b for everyday edits: it answers fast, and Aider sends only the files you add to the chat. For larger changes, openai/qwen3.8-27b has 262,144 tokens of context and reasons before it answers. With the settings file above, --reasoning-effort none switches its reasoning off: the same kind of edit, adding sub(a, b), came back on 11 October 2026 with 81 tokens received.

Limits

  • 8,192 output tokens per answer. With edit_format: diff that is rarely reached; with whole a large file can be cut.
  • Commit messages are written by the same model, one more request per commit, unless you name another with --weak-model.

Search the docs

Type to search…