Agent guide · rapid-mlx 0.10.3 · ← Back to README

Aider

Aider is a terminal-first paired coder that reads your file, sends it to the LLM with a natural-language instruction, and applies the returned SEARCH...REPLACE blocks locally. It does NOT use OpenAI function calling — the correctness signal is "did aider actually rewrite the file the way I asked", not "did tool_calls fire".

Wire: LiteLLM → /v1/chat/completions · Setup: env vars OPENAI_API_BASE / OPENAI_API_KEY · Matrix cell: ✅ ✅ ✅ ✅ (all four families PASS — aider's plain-text edit format works with reasoning-only models).

Install

$ pip install aider-chat

Config

Env vars (from rapid-mlx agents aider):

$ export OPENAI_API_BASE=http://localhost:8000/v1
$ export OPENAI_API_KEY=not-needed

Or per-invocation flags:

$ aider \
    --model openai/default \
    --openai-api-base http://localhost:8000/v1 \
    --openai-api-key not-needed \
    main.py

Run

$ rapid-mlx serve qwen3.5-9b-4bit \
    --tool-call-parser hermes --enable-auto-tool-choice
$ aider --openai-api-base http://localhost:8000/v1 \
        --openai-api-key not-needed \
        --model openai/qwen3.5-9b-4bit \
        main.py

Recommended aliases (per rapid-mlx agents aider): qwen3.5-9b-4bit, qwen3.6-35b-4bit, qwen3.5-4b-4bit, deepseek-r1-8b-4bit.

LiteLLM openai/ prefix

Aider drives LiteLLM under the hood. Without the openai/ prefix on the model string LiteLLM tries to pick a provider from the alias name and fails on rapid-mlx aliases (which aren't in LiteLLM's registry). The test_aider.sh harness constructs LITELLM_MODEL="openai/${MODEL}" exactly for this reason.

Integration harness (test_aider.sh)

The bash harness at tests/integrations/test_aider.sh seeds a scratch add.py with return a - b # BUG, drives aider one-shot with --message, and asserts the file was rewritten to return a + b (AST + runtime add(2, 3) == 5 gate). The exact aider invocation:

$ HOME="$SCRATCH_HOME" \
  AIDER_ANALYTICS_ASKED=1 \
  AIDER_CHECK_UPDATE=false \
  OPENAI_API_BASE="$BASE_URL" \
  OPENAI_API_KEY="rapidmlx" \
  aider \
    --model openai/"$MODEL" \
    --openai-api-base "$BASE_URL" \
    --openai-api-key rapidmlx \
    --no-git --no-analytics --no-check-update \
    --no-show-model-warnings --no-pretty --no-stream \
    --map-tokens 0 --yes-always \
    --message "Fix the bug in add.py — this function should add, not subtract. Change the '-' operator to '+' in the return statement." \
    add.py

Family × wall-time from the 2026-07-07 pilot (single aider run, real inference): Qwen 3.5-4B-4bit 2.81 s, Gemma-4-31B-4bit 7.14 s, DeepSeek R1-Distill-32B-4bit 22.26 s (long <think> block before the SEARCH/REPLACE edit), gpt-oss-20B-MXFP4-Q8 3.15 s — all four PASS with add.py rewritten to return a + b.

Gotchas

See also